Ask your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW) 10 Online
OpenStudy (anonymous):

On Problem 1 of PS12, for the doesClear() method, are we supposed to generate a random number, and if it's higher than self.clearProb, return True? I am confused by the statement "this method returns True with probability self.clearProb". Thank you.

OpenStudy (anonymous):

Similarly, for the reproduce() method, generate a random number and if it's higher than self.maxBirthProb * (1 - popDensity), the virus does get to reproduce and then we instantiate a new SimpleVirus object? Thanks!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!