Inspiration
Statistics concepts can often be too abstract for students to grasp. Why not make them visual?
I was inspired by a CS assignment I created earlier this year that stimulated sand falling, and realized that it could have awesome statistics applications!
The Galton board is a device invented by Sir Francis Galton to demonstrate the central limit theorem. With sufficient sample size, the binomial distribution approximates a normal distribution. When beads are dropped from the top, they bounce left or right and collect into bins at the bottom, simulating a bell curve.
What it does
Galton is a normal distribution simulator that you can play with. You can draw your own virtual Galton board and watch the simulation. You can also change the amount of Brownian motion.
How I built it
I used Python to create my program.
This program uses 2d lists to create a 2d simulation of the sand falling. There are five main functions
- do_move, which moves a sand element at (x1, y1) to (x2, y2)
- check_move, which checks the spaces the sand can fall into
- do_gravity, which simulates the falling of sand
- do_brownian, which simulates Brownian motion with a random variable
- do_whole_grid, which applies these functions on the entire grid
The graphics were created with tkinter.
Acknowledgements
The graphics source code was inspired by the CS 106A teaching team at Stanford.
What's next for Galton
In the future, I would like to create different data science visualizations beyond normal distributions! I would also like to create a larger grid to make a more accurate simulation.
Log in or sign up for Devpost to join the conversation.