Galton Board Simulation with Physics Engine JS (Bean Machine / Quincunx) #shorts

Added:

Deterministic Chaos and Inelasticity vs. Idealized Simulations

While idealized JavaScript physics simulations rely on perfect elastic collisions and deterministic equations to demonstrate an emergent binomial distribution, they often overlook deterministic chaos and real-world physical non-idealities. In a real Galton board, outcomes are highly sensitive to microscopic variations in initial conditions (chaos theory), meaning that even minor perturbations completely alter a ball's trajectory. Furthermore, real-world factors such as inelastic collisions (energy dissipation), friction, electrostatic forces, ball spin, and air resistance heavily influence the final distribution. Relying solely on simplified 2D elastic simulations can mislead students by ignoring how chaotic instability, energy loss, and physical constraints shape statistical outcomes in actual, non-idealized physical systems.

Basic JavaScript programming, including object-oriented concepts, loops, and canvas rendering APIs.
Fundamentals of 2D vector mathematics, including vector addition, dot products, and normalization.
Introductory classical mechanics, specifically Newtonian kinematics (gravity, velocity) and the conservation of momentum in elastic collisions.
Basic probability concepts, particularly how independent binary choices (left vs. right) generate a binomial distribution.
The Central Limit Theorem and how the binomial distribution transitions into a continuous normal (Gaussian) distribution as the scale increases.
Spatial partitioning algorithms (like Quadtrees or Grid-based partitioning) to optimize collision detection performance for thousands of particles.
Advanced rigid body dynamics, including rotational kinematics, friction, and impulse-based constraint solvers.
Using Monte Carlo simulations to model statistical mechanics, thermodynamic systems, or financial risk analysis.
313 views11likes1:23:37@TheBigIntOriginal Release: 2021-01-30

A Galton Board (or Bean Machine/Quincunx) is a physics simulation device where balls dropped from the top bounce off a series of pegs and collect in bins at the bottom, naturally forming a bell curve (binomial distribution) due to the random left/right decisions at each peg collision. This video demonstrates how to simulate this phenomenon using JavaScript, implementing 2D collision detection and resolution between balls and pegs, where each collision follows elastic collision physics principles including conservation of momentum and kinetic energy.