This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 2.1. SIMULATION OF CONTINUOUS PROBABILITIES 53 7 For Buffon’s needle problem, Laplace 9 considered a grid with horizontal and vertical lines one unit apart. He showed that the probability that a needle of length L ≤ 1 crosses at least one line is p = 4 L- L 2 π . To simulate this experiment we choose at random an angle θ between 0 and π/ 2 and independently two numbers d 1 and d 2 between 0 and L/ 2. (The two numbers represent the distance from the center of the needle to the nearest horizontal and vertical line.) The needle crosses a line if either d 1 ≤ ( L/ 2) sin θ or d 2 ≤ ( L/ 2) cos θ . We do this a large number of times and estimate π as ¯ π = 4 L- L 2 a , where a is the proportion of times that the needle crosses at least one line. Write a program to estimate π by this method, run your program for 100, 1000, and 10,000 experiments, and compare your results with Buffon’s method described in Exercise 6. (Take L = 1.) 8 A long needle of length L much bigger than 1 is dropped on a grid with horizontal and vertical lines one unit apart. We will see (in Exercise 6.3.28) that the average number a of lines crossed is approximately a = 4 L π ....
View Full Document
- Spring '09
- Probability theory, Monte Carlo method