Library

Statistics foundations

The probability and statistics that data science and ML rounds test directly. Bayes' rule and expected values, distributions and the central limit theorem, t-tests and p-values, ranking from few ratings, regression with controls, likelihood and cross entropy, KL divergence, and statistics across many machines.

Practice questions

40
Probability you can compute: Bayes' rule, expected values and waiting times
  1. 1.1 order in 200 is fraud, a check flags 90% of fraud and 2% of good orders. What share of flagged orders is fraud?
  2. 2.What does Bayes' rule look like in odds form?
  3. 3.20 labels go on 20 parcels in a random order. What's the expected number of parcels with their own label?
  4. 4.A loop repeats with chance 0.75 after each pass. How many passes does it make on average?
  5. 5.Why does a fair 1 to 7 from two calls of rand5 throw away 4 of the 25 pairs?
Distributions and the central limit theorem
  1. 1.What are the mean and variance of a uniform from 2 to 6?
  2. 2.Orders arrive independently at 3 a minute on average. What's the standard deviation of the count in a minute?
  3. 3.How much data does it take to cut an average's standard error to a tenth?
  4. 4.What does the central limit theorem say?
  5. 5.Revenue per user has a skewness of 18. What does that mean for an experiment on it?
The t-test, and what a p-value says
  1. 1.25 deliveries average 4.4 days with a standard deviation of 1.0. What's the t statistic against 4.0, and its degrees of freedom?
  2. 2.Why does t have heavier tails than the normal?
  3. 3.Which statement about p = 0.03 is right?
  4. 4.The same 12 routes ran with both carriers. Which test fits?
  5. 5.You test 10 metrics and want most of your finds to be real, not zero false alarms. Which correction fits?
Ranking from few ratings: shrinkage and Bayesian averages
  1. 1.Why does a ranking by raw average fill its top and bottom with items that have few ratings?
  2. 2.What is a Bayesian average?
  3. 3.Ratings are noisy, with σ² = 0.78, and true averages differ with τ² = 0.052. About how many imaginary ratings does empirical Bayes add?
  4. 4.Which thumbs-up item should rank first by the Wilson lower bound?
  5. 5.You launch the 5 features with the biggest measured wins out of 50 tests. What should you expect?
Linear regression: coefficients, controls and standard errors
  1. 1.Spend rises $4.62 per discount point, but loyal customers get bigger discounts and spend more. With tenure added, the coefficient is $1.51. Why?
  2. 2.When does leaving a variable out cause no bias?
  3. 3.In an A/B test of a discount, should you control for the number of items in the cart?
  4. 4.A coefficient of 0.165 on log spend means what?
  5. 5.Why default to robust standard errors?
Likelihood, logistic regression and cross entropy
  1. 1.Why sum log probabilities instead of multiplying the probabilities?
  2. 2.The maximum likelihood variance of 8 delivery times divides the summed squared distances by what?
  3. 3.A logistic regression gives a sale a coefficient of 0.7. What does a sale do?
  4. 4.The true return rate is 20%. What's the lowest log loss any prediction can reach?
  5. 5.A language model's loss stops falling near 1.7 nats per token, however big the model. What's the likeliest reading?
Entropy and KL divergence, for continuous distributions too
  1. 1.KL(p ‖ q) is 0.244 and KL(q ‖ p) is 0.311. What does that show?
  2. 2.A model gives a size a 0% chance, but 5% of sales are that size. What's KL(p ‖ q)?
  3. 3.The same delivery times are measured in weeks instead of days. What changes?
  4. 4.Which unbiased estimate of KL(p ‖ q) from samples of p never goes negative on a single sample?
  5. 5.Fit one normal to a two-peaked distribution by minimizing KL(q ‖ p). What do you get?
Mean, median and mode across many machines
  1. 1.Ten servers report their mean order values. Why is the average of those means usually wrong?
  2. 2.What does the δ² × na × nb / n term add when two variance summaries merge?
  3. 3.Each server's best seller is a different product. Can the overall best seller be none of them?
  4. 4.The exact median search asks each server how many values are at or below v. What makes it fast?
  5. 5.A quantile sketch promises 1% error on a billion values. What is promised?