Built with my classmate Louis during the first-year statistics lab at DUT STID Niort, this project reimagines the iconic Galton board, the 19th-century apparatus invented by Sir Francis Galton, entirely in VBA inside Microsoft Excel.
The application drops virtual rockets through a triangular grid of pegs. At each peg, the rocket goes left or right with equal probability. After many drops, the bottom slots fill up and reveal two foundational results of probability theory. First, the Law of Large Numbers: the empirical distribution converges to the binomial. Second, the Central Limit Theorem: with enough rows of pegs, the binomial itself converges to the Gaussian.
The work was carried out under the supervision of Laurent Bureau and François Garnier, and was singled out by the faculty as a particularly polished take on the assignment.
VBA
Tech
Excel macros
2020
January
1st-year lab
2
Authors
Ammar & Louis
B → N
Distribution
binomial → normal
What it shows
- Galton’s pinball, animated. Rockets fall through a triangular peg grid, deflecting left or right with equal probability at each row.
- Law of Large Numbers. As the number of rockets grows, the histogram at the bottom converges to the binomial distribution. Theoretical and empirical curves overlay live.
- Central Limit Theorem. As the number of peg rows grows, the binomial itself converges to a Gaussian. The bell curve emerges from a sum of independent Bernoulli trials.
- All in VBA. No external library, no plug-in. Just Excel macros, native shapes, and event-driven code. Statistical visualisation done with the most ubiquitous tool on Earth.
Demo
Credits
- Concept & engineering
- Ammar Kheder & Louis
- Supervision
- Laurent Bureau & François Garnier
- Course
- DUT STID Niort (now BUT Sciences des données), first-year statistics lab
- Stack
- Microsoft Excel, VBA, native shape API
- Concepts illustrated
- Law of Large Numbers, Central Limit Theorem, Binomial & Normal distributions