Buffon’s needle is a classic experiment in the field of Geometric Probability Theory.
A needle of length is thrown on a square floor tile with sides of length . The problem is to determine the probability of the event that the needle will fall across a crack between planks.
Using the geometry, we can calculate
We can physically perform this experiment, or simulate it on a computer.
Suppose we throw the needle times. We count the number of times that the needle falls across a crack between planks. In our computer simulation this event (red needle) happened times and did not happen (blue needle) times.
i.e., with the values from our experiment:
This approximation is an example of the general mathematical technique called the Monte Carlo Method. Monte Carlo methods are widely applied to computer simulations, especially computer games. The problem really is that while theorizing probabilities of chance is perfectly fine, when it comes to practical application, the probabilities are different over different sample space. For example, even thought the probability of tossing a coin is for each face, when an actual coin is picked and tossed over different number of times, the probabilities may not match the theoretical value.
Hence, computer simulations of these weighted natural outcomes are run to get a value for the probability of an occurrence which helps game designers in balancing the game.