(a) Write a program to determine the value of by numerically casting a needle of length D on a ruled grid with spacing S as shown in Figure 1. You must first determine a random position (relative ruled grid as shown in Figure 1. You must first determine a random position (relative to a ruled line), then determine a random angle, and thirdly, see whether the needle falls within the ruled lines. You may find it instructive to compute approximations for versus the number of trials, e.g. N = 10, 100, 1,000 and 10,000. For S > D, your answer for the fraction of time, F, the needle falls within the grid should be :
Figure 1 Illustration of Buffon's Needle Problem. View Figure
(b) Verify the above equation. What is the corresponding formula for S < D? (Warning: there is considerable effort involved in this derivation!)
(c) Using a needle and a piece of paper upon which you have placed a ruled grid, perform a physical experiment to determine using the above equation. Perform first 10, then 100, and then 1,000 trials. Comment on the accuracy of these results relative to the accuracy of the results from the numerical experiment. Discuss reasons for any bias apparent in the results.