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

Hello everyone, can someone help with problem 2 on Quiz 2? When standard dev is 0 its obvious we are getting the mean every time, but with say std. dev 20, 95% of the values are within 3 std. dev. so thats (100 +- 60)*1000. But how do you come up with an expected value and why is it so much larger for std. dev. 40

OpenStudy (anonymous):

Is this a program or just math?

OpenStudy (anonymous):

it is a quiz problem so you have to read the code and come up with the expected value

OpenStudy (anonymous):

you are not allowed to run the code so there has to be a mathematical reasoning for it

OpenStudy (anonymous):

You aren't giving enough information either way.

OpenStudy (anonymous):

import random tots = [0.00]*3 maxVals = [0.0]*3 mean = 100.0 stdDevs = [0.0, 20.0, 40.0] for i in range(1000): for j in range(len(tots)): next = random.gauss(mean, stdDevs[j]) tots[j] += next what are the expected values of tots

OpenStudy (anonymous):

Interesting... I would expect the expected values to be the mean, or 100.0 for each individual element... by definition.

OpenStudy (anonymous):

thats what i thought, but the answer is [100,000 100,000 1000,000]

OpenStudy (anonymous):

oh wait, I see.

OpenStudy (anonymous):

The loop is adding 100 each time, but it does this 1000 times.

OpenStudy (anonymous):

yea, i get the first two 100,000s, but how does standard deviation 40 result in the value 1000,000?

OpenStudy (anonymous):

I don't think it should

OpenStudy (anonymous):

me too

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!