Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Whatever this kata improves, it was much mor fun to solve it, than boring "code all day to get an one digit answer" katas.
I really glad that this kata exists, it's just fresh air and why I prefer Codewars to Leetcode and other.
You're calculating the "sample variance" while the "population variance" is required. I think the link in the notes includes the explanation on how to get the expected result.
Can you elaborate please? What do you mean divide by n ? What is n
They want the population variance (divide by
n
). The larger number is the sample variance, corresponding to a denominator ofn - 1
.I don't get why is
variance("London", data) == 57.42(833333333374)
while MATLAB shows me62.649
- I also get this value by using1/n * sum((x_i - m)^2)
. What's wrong? What am I missing here?