Problem 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 \leq 1\) crosses at least one line is $$ p=\frac{4 L-L^{2}}{\pi} $$ To simulate this experiment we choose at random an angle \(\theta\) between 0 and \(\pi / 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} \leq(L / 2) \sin \theta\) or \(d_{2} \leq(L / 2) \cos \theta .\) We do this a large number of times and estimate \(\pi\) as $$ \bar{\pi}=\frac{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 \(\pi\) 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 .)\)
Problem 16
Three points are chosen at random on a circle of unit circumference. What is the probability that the triangle defined by these points as vertices has three acute angles? Hint: One of the angles is obtuse if and only if all three points lie in the same semicircle. Take the circumference as the interval \([0,1] .\) Take one point at 0 and the others at \(B\) and \(C\).