cs215 ยป

Thanks to ked4r for his post on solving this problem without calculus (http://forums.udacity.com/cs215/questions/3277/spoilers-mathematical-proofs-for-ps4-2-and-ps4-3/3296):

The question requests that given a list of numbers

you calculate a value toExpanding the square, we get:

Note that

does not depend on so equation is equivalent to calculating

Let

. Then we can write

We can then add and subtract

, which completes the square.

Again, note that

doesn't depend on , and that . This implies that Equation is minimized when and , which is the mean of .Calculating the mean of `sum(L)/len(L)`

.