Java Applet
For
Buffon's Needle
An Analysis and Simulation

Introduction :

Buffon's Needle is one of the oldest problems in the field of geometrical probability. It was first stated in 1777. It involves dropping a needle on a lined sheet of paper and determining the probability of the needle crossing one of the lines on the page. The remarkable result is that the probability is directly related to the value of pi.

Suppose, you have a tabletop with a number of parallel lines drawn on it, which are equally spaced (say the spacing is 1 inch, for example). Suppose, you also have a pin or needle, which is also an inch long. If you drop the needle on the table, you will find that one of two things happens :

(1) The needle crosses or touches one of the lines.
(2) the needle crosses no lines.

The idea now is to keep dropping this needle over and over on the table, and to record the statistics. Namely, we want to keep track of both the total number of times that the needle is randomly dropped on the table (call this tries), and the number of times that it crosses a line (call this hits). If you keep dropping the needle, eventually you will find that the number 2n/h approaches the value of Pi !

Method

Let's take the simple case first. In this case, the length of the needle is one unit and the distance between the lines is also one unit. There are two variables, the angle at which the needle falls (theta) and the distance from the center of the needle to the closest line (D). Theta can vary from 0 to 180 degrees and is measured against a line parallel to the lines on the paper. The distance from the center to the closest line can never be more that half the distance between the lines. The graph below depicts this situation.


The needle in the picture misses the line. The needle will hit the line if the closest distance to a line (D) is less than or equal to 1/2 times the sine of theta. That is, D <= (1/2)sin(theta). How often will this occur?

In the graph below, we plot D along the ordinate and (1/2)sine(theta) along the abscissa. The values on or below the curve represent a hit (D <= (1/2)sin(theta)). Thus, the probability of a success it the ratio shaded area to the entire rectangle. What is this to value?


The shaded portion is found with using the definite integral of (1/2)sin(theta) evaluated from zero to pi. The result is that the shaded portion has a value of 1. The value of the entire rectangle is (1/2)(pi) or pi/2. So, the probability of a hit is 1/(pi/2) or 2/pi. That's approximately .6366197.

To calculate Pi from the needle drops, simply take the number of tries and multiply it by two, then divide by the number of hits, or

2(total tries) / (number of hits) = pi (approximately).

There are three types of Needle method for calculate value of Pi :
(1) Simple Method
(2) Frame Method
(3) Table Method