1/13
Learn

Means, variances and the CLT, the way the statistics round asks

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). This lesson's practice problem puts that question in code, in three levels:

  1. uniform_moments(a, b), die_moments(n) and moments(values, probs): the mean and variance of a uniform, a fair die and any discrete distribution.
  2. standard_error(sd, n), n_for_standard_error(sd, target) and prob_mean_above(mu, sd, n, threshold): how an average of n draws spreads, how much data a target needs, and the central limit theorem's chance of a high average.
  3. skewness(xs), users_for_normal_mean(skew) and covers(xs, mu): how lopsided data are, how many users a skewed metric needs, and whether the usual interval contains the truth.
CallReturns
uniform_moments(0, 12)(6.0, 12.0)
die_moments(4)(2.5, 1.25)
prob_mean_above(10, 2, 16, 11)0.0228
users_for_normal_mean(4)5,680

The lesson follows the shop's deliveries and orders: the mean and the variance, five common distributions, the standard error, the central limit theorem, and the skewed metrics it handles slowly. Six steps end with a small task in the editor.