From sample to world: the central limit theorem
In the previous lesson we learned: an estimate (say, a mean) is a random variable with its own sampling distribution. Now we learn the SHAPE of that distribution for the mean β a surprisingly simple fact on which all further inference rests.
Before you are three panels. Top β the population: skewed, e.g. service response time (many fast requests, rare very slow ones). Middle β one random sample from it: its points and the green line, the sample mean xΜ. Bottom β the distribution of those means, accumulating. Press "take a sample" and notice: xΜ almost never equals the true mean β it misses slightly (the deviation is shown on the right).
It is thanks to the CLT that polling 1,500 people yields a reliable estimate of a whole country's mood β no need to ask everyone. A random sample's mean is predictably close to the truth.
And the larger the sample, the narrower the error bell, i.e. the more precise the estimate β which is why sample size is always center stage.
Quality control checks the mean of 30 parts, not the whole batch. Ratings and indexes average samples. All of it works because means behave predictably.
A/B tests compare the means of two user groups β and lean on exactly this fact about the behavior of means.
Definitions
The CLT needs independent observations and finite variance. With ultra-heavy tails (a power law with Ξ± β€ 2) the variance is infinite β no bell forms, and the mean does not stabilize even for large n.
With strong skew and small n the mean's distribution has not yet turned normal β you need a bigger sample. Dependent or clustered data (one user contributing many observations) effectively shrinks the real n.
Deep dive: the math and the mechanism (optional)
ΠΠΎΡΠ΅ΠΌΡ ΠΈΠΌΠ΅Π½Π½ΠΎ ΠΊΠΎΠ»ΠΎΠΊΠΎΠ»? Π‘ΡΠ΅Π΄Π½Π΅Π΅ β ΡΡΠΎ ΡΡΠΌΠΌΠ° n Π½Π΅Π·Π°Π²ΠΈΡΠΈΠΌΡΡ Π²ΠΊΠ»Π°Π΄ΠΎΠ², Π΄Π΅Π»ΡΠ½Π½Π°Ρ Π½Π° n. ΠΠ°ΠΆΠ΄ΠΎΠ΅ Π½Π°Π±Π»ΡΠ΄Π΅Π½ΠΈΠ΅ ΡΡΠ½Π΅Ρ ΡΡΠ΅Π΄Π½Π΅Π΅ ΡΠΎ Π²Π²Π΅ΡΡ , ΡΠΎ Π²Π½ΠΈΠ·; ΠΏΡΠΈ ΡΠ»ΠΎΠΆΠ΅Π½ΠΈΠΈ ΡΡΠΈ ΡΠ»ΡΡΠ°ΠΉΠ½ΡΠ΅ ΠΎΡΠΊΠ»ΠΎΠ½Π΅Π½ΠΈΡ ΡΠ°ΡΡΠΈΡΠ½ΠΎ Π³Π°ΡΡΡ Π΄ΡΡΠ³ Π΄ΡΡΠ³Π°, ΠΈ ΠΊΡΠ°ΠΉΠ½ΠΈΠ΅ ΠΊΠΎΠΌΠ±ΠΈΠ½Π°ΡΠΈΠΈ (Π²ΡΠ΅ Π½Π°Π±Π»ΡΠ΄Π΅Π½ΠΈΡ ΡΠ°Π·ΠΎΠΌ Π±ΠΎΠ»ΡΡΠΈΠ΅) Π°ΡΡΡΠΎΠ½ΠΎΠΌΠΈΡΠ΅ΡΠΊΠΈ ΡΠ΅Π΄ΠΊΠΈ β ΠΏΠΎΡΡΠΎΠΌΡ ΡΠ΅Π·ΡΠ»ΡΡΠ°Ρ ΠΊΡΡΠΊΡΠ΅ΡΡΡ Ρ ΡΠ΅Π½ΡΡΠ° ΡΠΈΠΌΠΌΠ΅ΡΡΠΈΡΠ½ΠΎ. Π£Π΄ΠΈΠ²ΠΈΡΠ΅Π»ΡΠ½ΠΎ ΡΠΎ, ΡΡΠΎ ΡΠΎΡΠΌΠ° ΠΈΡΡ ΠΎΠ΄Π½ΡΡ Π΄Π°Π½Π½ΡΡ ΠΏΡΠΈ ΡΡΠΎΠΌ ΠΏΠΎΡΡΠΈ Π½Π΅ Π²Π°ΠΆΠ½Π°: ΡΠΊΠ»Π°Π΄ΡΠ²Π°Ρ ΠΌΠ½ΠΎΠ³ΠΎ Π½Π΅Π·Π°Π²ΠΈΡΠΈΠΌΡΡ Π²ΠΊΠ»Π°Π΄ΠΎΠ², ΠΌΡ Π²ΡΠ΅Π³Π΄Π° ΠΏΡΠΈΡ ΠΎΠ΄ΠΈΠΌ ΠΊ Π½ΠΎΡΠΌΠ°Π»ΡΠ½ΠΎΠΉ ΡΠΎΡΠΌΠ΅.
ΠΡΠΊΡΠ΄Π° βn: Π΄ΠΈΡΠΏΠ΅ΡΡΠΈΠΈ Π½Π΅Π·Π°Π²ΠΈΡΠΈΠΌΡΡ ΡΠΊΠ»Π°Π΄ΡΠ²Π°ΡΡΡΡ (ΠΈΠ· ΠΏΡΠΎΡΠ»ΠΎΠ³ΠΎ ΡΡΠΎΠΊΠ°), ΠΏΠΎΡΡΠΎΠΌΡ Var(ΡΡΠΌΠΌΡ) = nΒ·ΟΒ², Π° Π΄Π΅Π»Π΅Π½ΠΈΠ΅ Π½Π° n ΡΠΌΠ΅Π½ΡΡΠ°Π΅Ρ Π΄ΠΈΡΠΏΠ΅ΡΡΠΈΡ Π² nΒ² ΡΠ°Π· β Var(ΡΡΠ΅Π΄Π½Π΅Π³ΠΎ) = ΟΒ²/n, ΠΈ Ο(ΡΡΠ΅Π΄Π½Π΅Π³ΠΎ) = Ο/βn. ΠΠΎΡΠ΅Π½Ρ β ΠΏΡΡΠΌΠΎΠ΅ ΡΠ»Π΅Π΄ΡΡΠ²ΠΈΠ΅ ΡΠΎΠ³ΠΎ, ΡΡΠΎ ΡΠΊΠ»Π°Π΄ΡΠ²Π°ΡΡΡΡ ΠΈΠΌΠ΅Π½Π½ΠΎ Π΄ΠΈΡΠΏΠ΅ΡΡΠΈΠΈ (ΠΊΠ²Π°Π΄ΡΠ°ΡΡ), Π° Π½Π΅ ΡΠ°ΠΌΠΈ ΡΠ°Π·Π±ΡΠΎΡΡ.