^{1}

^{*}

^{2}

^{1}

^{3}

Buffon’s needle experiment was originally devised to get the value of π. With the advent of computers, Buffon’s needle algorithm has been used pedagogically as an example of Monte Carlo methods in introduction classes, and there are many Buffon’s needle algorithm implementations available on the internet. However, for the calculation of π, the exact value of π is used in the programs for Buffon’s needle angle sampling, and hence the example is not demonstrated correctly. This brief note presents a random angle sampling algorithm for the Buffon’s needle. We then compare the Buffon’s needle and Hit-and-Miss integration algorithms using Monte Carlo laboriousness comparison, and find that the Hit-and-Miss algorithm is superior.

Buffon’s needle experiment [

P = ∫ 0 π l 2 sin θ d θ π d / 2 (1)

and so

π = 2 l P a (2)

where P is the probability, l the length of the needle and a the spacing with l < a .

Here, we should note that the Buffon’s needle problem becomes an integration problem (see

Many variants of the original Buffon’s needle experiment [

With the advent of computers, Buffon’s needle has been pedagogically used as an example in Monte Carlo method introductory classes and many websites pro- vide Buffon’s needle algorithm implementations. However, in these programs, the value of π is used for the random sampling of the needle angular direction. Thus π is used to obtain the value of π itself.

This note presents a sampling algorithm for the random direction of the needle that avoids using π within the algorithm. We then compare the Buffon’s needle and the Hit-and-Miss integration algorithms using the common Monte Carlo algorithm comparison method, the time consumption (laboriousness) [

For random direction sampling of the needle, we use a square enclosing a tightly fitted circle (see

Since the directions of the random points inside the circle are uniform, we obtain uniform needle random directions.

The Hit-and-Miss integration algorithm can also provide the value of π . Using one quadrant of the circle circumscribed by a square (see

We use the common Monte Carlo algorithm comparison, time consumption (laboriousness): [

Buffon’s needle algorithm has been pedagogically used as an introduction to

CPU time per run (s) | Variance ( | Time consumption ( | |
---|---|---|---|

Buffon’s needle | 15.9 | 5.97 | 9.49 |

13.0 | 2.51 | 3.26 |

Monte Carlo methods. However, π is used for needle angle sampling inside the original algorithm. This note presents a method for the needle angle sampling without using π and make the Buffon’s needle algorithm a Monte Carlo method to estimate π . We compared the Buffon’s needle and Hit-and-Miss integration algorithms and found that the Buffon’s needle algorithm is not superior to the Hit-and-Miss integration algorithm.

This research was supported by the Basic Science Research Program through the National Research Foundation of Korea (NRF) funded by the Ministry of Education, Science and Technology (2012R1A1A2003025). Also, later this work was supported by the GIST Research Institute (GRI) in 2017. In addition, this research was a collaborative research project, supercomputing infrastructure service and application, supported by the Korea institute of science and technology information.

Hwang, C.-O., Kim, Y., Im, C. and Lee, S. (2017) Buffon’s Needle Algorithm to Estimate π. Applied Ma- thematics, 8, 275-279. https://doi.org/10.4236/am.2017.83022