2/13
Part 1 of 7 · Mean and varianceLearn and do
Every random quantity has a center and a spread
A Netflix data science candidate reports a statistics question on the central limit theorem and on the mean and variance of a uniform distribution (1 report). Both rest on two numbers that describe any random quantity:
- The mean, or expected value, is its long-run average.
- The variance is the average squared distance from the mean. Its square root, the standard deviation, is back in the original units.
For a list of values with their chances, the mean is each value times its chance, added up, and the variance is each squared distance from the mean times its chance, added up.
In the editor, write moments(values, probs). It prints a fair die's mean and variance.