nature-of-code / noc-book

The Nature of Code book (archived repo, see README for new repo / build system!)

Home Page:http://natureofcode.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Calculating Mean and Standard Deviation" section shows incorrect values

augustoclaro opened this issue · comments

The shown avarage variance is 254.23, but the correct one would be 228.81.

the sum of variances is 2288.1 and seems like it's dividing by 9 (to have 254.23) instead of by 10 (the correct length of the array, which will give us 228.81).

This confusion come from the difference between Population Standard Variance and Sample Standard Variance.

In the book, Shiffman is using Sample Standard Variance (254.23). However the 228.81 comes from Population Standard Variance.

I found this article to be very helpful in describing the difference: click here

Looks like this issue was corrected as a part of #65 🙂

Thanks everyone for the comments! Closing this issue, feel free to flag it in noc-book-2