Planche de Galton
Binomial → Gauss.
About this tool
Compare a sample with its expectation
Set 1–18 rows, 1–5000 complete paths, right probability p between 0 and 1, and an integer seed from 0 to 4294967295. Generate sample immediately shows all N completed paths. The M controls select the first M paths from that same prepared sample. The board highlights the last selected path and its destination; the histogram compares observed bars with expected marks. At M = 0 there is no selected path and no observed mean or variance.
Paths and the binomial model
Each row makes an independent Bernoulli choice: right with probability p, otherwise left. After n rows, bin K is the number of right choices. In board coordinates, row r and k right choices give x = k − r/2 and y = r downward. Each segment moves half a unit sideways and one row down. This is a probability model, not a simulation of physical ball collisions.
P(K = k) = C(n, k) pᵏ(1 − p)ⁿ⁻ᵏ. At M completed paths, expected bin counts are M · P(K = k) and sum to M. The theoretical mean is np and variance is np(1 − p). Observed moments use only the M completed paths. The displayed observed variance divides by M; it describes this sample and is not the unbiased estimator with denominator M − 1. A dash means undefined, not zero.
Grouped χ²
Adjacent bins are collected from left to right until their expected count reaches at least 5. Any remaining right tail is merged into the last group. Grouping depends only on expected counts; no observed paths are discarded. The details table shows each bin range and its observed O and expected E.
With at least two groups, χ² = Σ(O − E)²/E and the degrees of freedom equal the number of groups minus 1. Here n and p are specified rather than estimated from the sample. With too few groups, χ² and degrees of freedom are undefined. Probabilities p = 0 or 1 give a deterministic destination and no χ² comparison. The tool does not report a p-value, decide whether to reject a hypothesis, or prove that a generator is random.
Reproducibility and playback
The same parameters and seed produce the same ordered sample using the deterministic mulberry32 generator. This is for learning, not cryptographic randomness. Changing any main setting discards the old sample.
Playback reveals 60 completed paths per real second. From M = N it restarts at 0 and stops at N. This is a viewing rate, not a physical falling speed. Editing or focusing the probe pauses playback; +1 and All also pause. A hidden view freezes progress and resumes only if it was playing. Navigation retains a paused result. Reloading or changing language restores valid settings but requires Generate sample again; every new generation starts with M = N.
Sources
NIST: binomial distribution and NIST: chi-square goodness of fit. The adjacent-bin grouping rule is specified above.