Probability, by hand.

Slide the parameters, shade an interval to read off a probability, then draw samples and watch the histogram settle onto the curve.

The essentials

Random variable

X:Ω→RX : \Omega \to \mathbb{R}

A number whose value depends on chance, like the result of a die roll or tomorrow's rainfall.

Discrete vs continuous

{0,1,2,… }vs[a,b]⊆R\{0, 1, 2, \dots\} \quad \text{vs} \quad [a, b] \subseteq \mathbb{R}

Discrete variables take separate values you can list (0, 1, 2, …). Continuous ones can land anywhere in a range, so any single exact value has probability zero.

PMF (discrete)

p(k)=P(X=k),∑kp(k)=1p(k) = P(X = k), \quad \sum_k p(k) = 1

The probability mass function gives the probability of each exact value. The bars always add up to 1.

PDF (continuous)

P(a≤X≤b)=∫abf(x) dxP(a \le X \le b) = \int_a^b f(x)\,dx

The probability density function is not a probability by itself. Probability is the area under it, so f(x) can be bigger than 1.

CDF

F(x)=P(X≤x)F(x) = P(X \le x)

The cumulative distribution function climbs from 0 to 1. The probability of landing between a and b is F(b) − F(a).

Expectation

E[X]=∑kk p(k); or ;∫xf(x) dx\mathbb{E}[X] = \sum_k k\,p(k) ;\text{ or }; \int x f(x)\,dx

The long-run average, and the balance point of the distribution. Draw enough samples and their mean settles here.

Variance and standard deviation

Var⁡(X)=E[X2]−μ2,σ=Var⁡(X)\operatorname{Var}(X) = \mathbb{E}[X^2] - \mu^2, \quad \sigma = \sqrt{\operatorname{Var}(X)}

How spread out the values are around the mean. The standard deviation is in the same units as X.

Central Limit Theorem

Xˉn−μσ/n→dN(0,1)\frac{\bar{X}_n - \mu}{\sigma/\sqrt{n}} \xrightarrow{d} \mathcal{N}(0, 1)

Average enough independent draws from almost any distribution and the average looks normal. Try the Sample means mode on any distribution page.

Discrete

Countable outcomes: heads or tails, the number of emails, the roll of a die.

Continuous

Any value in a range: heights, waiting times, probabilities themselves.