Probability, visually

Interactive notes on probability, statistics and puzzles for quant and ML interviews. Every idea comes with the intuition first, the formula second, and a widget you can play with until it clicks.

How to use these notes

Pattern recognition: which tool do I reach for?

Most interview problems are solved the moment you recognize the pattern. This is the map:

If the problem mentions……reach for
memoryless, waitinggeometric, exponential
trials with success & failureBernoulli, binomial
large sample, averageCLT → approximately Gaussian
bound given only mean / varianceMarkov / Chebyshev inequalities
estimating a parameter from dataMLE, MAP, Bayesian update
update belief from evidenceBayes' rule
a (convex/concave) function of a RVJensen's inequality
expected count of thingslinearity + indicators
expected hitting time / return probabilityfirst-step analysis, solve the recurrence
future depends only on the presentMarkov chain + first-step analysis
Pattern drill
Read a real interview-style question and pick the tool you'd reach for first. Aim for 10 in a row.

The five moves that solve most problems

1 · Linearity
$\E[\sum X_i]=\sum\E[X_i]$, even when the $X_i$ are dependent.
2 · Indicators
Count = sum of 0/1 variables; $\E[\1_A]=P(A)$.
3 · First step
Condition on the first move, then solve for the unknown.
4 · Complement
$P(\text{at least one})=1-P(\text{none})$.
5 · Symmetry
Equivalent things get equal probability, so divide evenly.