Probability and statistics practice problems
20 problems · 0 solved
Probability describes uncertainty, and statistics tells you whether a difference you see is real or just noise. In ML both show up everywhere, from sampling tokens to deciding if a new model actually beats the old one. Running an eval without statistics is like judging a cricket player on a single ball. These problems turn common statistical tools into code. You will compute the KL divergence between diagonal Gaussians, compare token distributions with Jensen-Shannon divergence, sample categories with the inverse CDF, track the mean and variance of a stream in one pass, put a bootstrap confidence interval on an eval score, compute Spearman correlation with tied ranks, compare eval runs with Welch's t-test, run a two-proportion z-test, update a pass rate with a Beta prior, evaluate a multivariate Gaussian log-density with a Cholesky factor, and control false discoveries across many comparisons. Start with the Easy problems on divergences and streaming statistics. Then do bootstrap intervals and the hypothesis tests, and finish with the Gaussian log-density and false discovery control. Interviewers often ask how you would decide if an improvement is significant, and this knowledge keeps teams from shipping changes that only looked better by chance.
Easy 8
- Track mean and variance of a stream in one pass
- Compute the KL divergence between two diagonal Gaussians
- Compare two token distributions with Jensen-Shannon divergence
- Sample categories from fixed uniforms with the inverse CDF
- Compute the mean and variance of a discrete random variable and of aX + b
- Update a discrete posterior over hypotheses after each observation
- Put a Wilson score confidence interval on a success rate
- Compare two classifiers on the same test set with McNemar's test
Medium 9
- Decide if a new prompt really converts better with a two-proportion z-test
- Update your belief about a model's pass rate with a Beta prior
- Put a bootstrap confidence interval on an evaluation score
- Compare two eval runs with Welch's t-test statistic
- Compute Spearman rank correlation with averaged tie ranks
- Run a two-sample permutation test for a difference in means
- Compute the chi-square test of independence for a contingency table
- Build split conformal prediction intervals for a regressor
- Compute the sample size per group for a two-proportion A/B test