Pi estimator
This is an interactive representation of Monte Carlo numerical estimation using a classic example.
Hold Enter/left mouse click or touch the screen in the spawn region to spawn particles, and the program will count the number of particles inside the circle and outside the circle to get a numerical estimate for pi, according to the formula N_circ/N_total ~ Pi*R^2/(2*R)^2 = Pi/4 for large N, and after rearranging: Pi ~ 4*N_circ/N_tot.
One can prove that the accuracy of the numerical estimate increases with the number of sampled points, but this provides an interactive method to see how this works.
Made in Godot.
Leave a comment
Log in with itch.io to leave a comment.