Interactive statistics

56 free interactive lessons: from mean and median to A/B tests and Bayes. Drag the charts and build intuition. No sign-up.

Module 2: Probability

Randomness and the law of large numbers

In the previous lesson we agreed that every event has a probability, and learned to combine them. But where does that probability come from, and where can you actually "see" it in the data? It turns out you can't spot it in a single flip β€” it emerges only over a long series: the more repetitions, the closer the observed share gets to the true probability. That is the law we'll explore on the simplest experiment β€” a coin flip.

00.51probability p = 0.50running share of heads β†’outcome frequenciesheads 40%tails 60%
Flips: 10Heads: 4Share of heads: 0.400dashes are the targets p and 1βˆ’p

A coin lands heads or tails β€” you cannot call it in advance. But the event has a probability: a fair coin comes up heads half the time on average, p = 0.5 (the yellow dashed line). On the left, the running share of heads as flips accumulate; on the right, a frequency histogram of outcomes with target dashes at p and 1βˆ’p. Press "+10 flips".

Why sample size matters

A direct consequence for analytics: the figure "we have 50% conversion" from five visitors means almost nothing β€” there are far too few trials, and the share swings wildly from case to case. On five thousand the same share is already close to the true one, and can be trusted.

So sample size is not a formality but a condition of reliability: it is what turns random noise into a stable estimate.

Where it shows up

Casinos and insurers live off the law of large numbers: a single game or claim can lose money, but over a million events the total is predictable and stable.

Polls too: the more respondents, the closer the measured share is to what all people actually think.

Definitions
ProbabilityP(A)∈[0, 1]P(A) \in [0,\,1]
the share of cases in which the event happens over a very long run. 0 β€” never, 1 β€” always.
Trial
one random observation β€” for example, one coin flip.
Law of large numbersp^β†’p  (nβ†’βˆž)\hat{p} \to p \ \ (n \to \infty)
as trials accumulate, the observed share approaches the true probability.
Convergence speedSD(p^)∝1nSD(\hat{p}) \propto \dfrac{1}{\sqrt{n}}
to cut the typical error of a share in half, you need four times more observations.
Next β†’
Enjoying the materials?

This site is built by the DataSlice Telegram channel: data analytics in plain words β€” real cases, metrics, careers. The channel is in Russian.

Open the Telegram channel