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

Hello again and please excuse me for this slight problem. For ps12, problem 1, what was your "benchmark" for your virus to reproduce itself? I was thinking of setting it to 0.5 but I was wondering whether it would be reasonable. Or am I doing it wrong? For quick reference: (self.maxBirthProb * (1 - popDensity)) > 0.5 where both maxBirthProb and popDensity <=1

OpenStudy (anonymous):

12?! That's a refreshing change of pace. What your test there is saying is that when the population density reaches a certain level a virus never reproduces, but when it's below that level it always reproduces. (self.maxBirthProb * (1 - popDensity)) is supposed to be a *probability* of reproducing. You're then supposed to use random to decide if it actually does. But I think it would be interesting to rerun the experiments using this determinacy instead of randomness, though that's not what we're *supposed* to do for this problem set.

OpenStudy (anonymous):

When I used determinant values nothing happened. The randomness is what makes it all worthwhile.

OpenStudy (anonymous):

Yeah, using 0.5 is too high, all my virus died out too early. I had to use 0.01 or below in order to get substantial result which zig zag up and down. Rather interesting. What was your result for the simulation, dmancine?

OpenStudy (anonymous):

I saved the graph from problem 2 and attached it. Hopefully it'll work (it's an svg). I'm still not clear what you're doing with 0.5 and 0.01. Are you using the random module?

OpenStudy (anonymous):

@dmamcine: self.maxBirthProb * (1 - popDensity)) > 0.5. Changing the 0.5 to 0.05 (I typed the reply in work and all of those values were from my memory. My bad) will yield the graph I've attached. I've just recently tried the random module and I must say, it looks more interesting than my fixed value. Many thanks again for your help.

OpenStudy (anonymous):

Yes, it needs to be a probability. To test if the event occurs you need to use a random number. We used random in some other problem sets, like the robot one. Like he said in lecture, "stochastic" means "use random numbers."

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!