[MAP Logo]

Materials Algorithms Project
Program Library



Program MAP_METALL_BUFFON

  1. Provenance of code.
  2. Purpose of code.
  3. Specification.
  4. Description of subroutine's operation.
  5. References.
  6. Parameter descriptions.
  7. Error indicators.
  8. Accuracy estimate.
  9. Any additional information.
  10. Example of code
  11. Auxiliary subroutines required.
  12. Keywords.
  13. Download source code.
  14. Links.

Provenance of Source Code

George C. Reese,
Office for Mathematics, Science and Technology Education,
University of Illinois Champaign-Urbana,
505 East Armory Avenue,
#341
Champaign, Illinois 61820.

E-mail: g-reese@uiuc.edu or mste@uiuc.edu

Added to MAP: October 1999.

Top | Next

Purpose

Buffon's Needle is one of the oldest problems in the field of geometrical probability. It involves dropping a needle on a lined sheet of paper and determining the probability of the needle crossing one of the lines.

Top | Next | Prev

Specification

Language:N/A
Product form:Executable file for use on an Apple Macintosh computer (binhex format).

Complete program.

Top | Next | Prev

Description

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. The remarkable result is that the probability is directly related to the value of pi.

The program simulates the needle drop in the simplest case scenario in which the length of the needle is the same as the distance between the lines (1 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 centre to the closest line can never be more that half the distance between the lines. The diagram below depicts this situation.

diagram of simplest case

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 is the ratio of the shaded area to the entire rectangle. What is this value equal to?

diagram of simplest case

The area if the shaded portion is found by evaluating the definite integral of (1/2)sin(theta) 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 0.6366197. To calculate pi from the needle drops, simply take the number of drops and multiply it by two, then divide by the number of hits, or (approximately)

2(total drops)/(number of hits) = pi

Buffon's Needle and metallography
The problem of Buffon's Needles has relevance in metallography where it is used to relate the length of grain boundary line in the surface of a polished specimen to the number of intersections made by boundaries with a test line on the specimen surface [3]:

LA = (pi/2).NL

where LA is the length of boundary per unit area and NL is the average number of intersections with a random test line, per unit length of test line.

Downloading and running the program
The executable file has been compressed using STUFFIT software on the Macintosh and can be downloaded in binhex format. The compressed file, buffon.sea.sit, can be uncompressed simply by double clicking on the file icon; it is self extracting. To run the program double-click on the executable file, Buffon's Needles.

Top | Next | Prev

References

  1. W. Cheney and D. Kincaid, 1985, Numerical Mathematics and Computing, 2nd Ed., (Pace Grove, California: Brooks/Cole Publishing Company), pp. 354-354.
  2. L. Schroeder, 1974, Mathematics Teacher, 67, 183-186.
  3. Quantitative Microscopy, 1968, Ed. R.T. DeHoff and F.N. Rhines, (New York: McGraw-Hill), p 78.

Top | Next | Prev

Parameters

Input parameters

Drop 1/10/100
Number of needles to be dropped onto the page. Groups of 1, 10 or 100 needles can be dropped at a time.

Output parameters

Number of needle drops
The total number of needles dropped onto the page.

Number of hits
Number of needles crossing one of the lines.

Ratio hits:drops
Ratio of the number of needles crossing one of the line to the number of needles dropped.

Estimate of pi
The estimate for pi obtained using the formula above.

Top | Next | Prev

Error Indicators

None.

Top | Next | Prev

Accuracy

No information supplied.

Top | Next | Prev

Further Comments

There are two other possibilities for the relationship between the length of the needles and the distance between the lines. A good discussion of these can be found in Schroeder's paper [2]. The situation in which the distance between the lines is greater than the length of the needle is an extension of the above explanation and the probability of a hit is 2L/Kpi where L is the length of the needle and K is the distance between the lines. The situation in which the needle is longer than the distance between the lines leads to a more complicated result.

Further information and an online program are available at http://www.mste.uiuc.edu/reese/buffon/buffon.html.

Top | Next | Prev

Example

1. Program text

Complete program.

2. Program data

Total number of needle drops = 19100

3. Program results

Number of needle drops:     19100
Number of Hits            12099
Ratio hits to drops        .6334554974
Estimate of PI is  3.157285726

Top | Next | Prev

Auxiliary Routines

None.

Top | Next | Prev

Keywords

Buffon, needle, Buffon's needle, probability, grain boundary, intersection

Top | Next | Prev

Download

Download MAP files
Download executable file for the Macintosh

Top | Prev


MAP originated from a joint project of the National Physical Laboratory and the University of Cambridge.

MAP Website administration / map@msm.cam.ac.uk

Top | Index | MAP Homepage Valid HTML 3.2!