
Needle, thread and pi

Simulation
In order not to spoil the intrigue, let's start with the experiment. So, we have many needles of length L and a skein of green thread. We apply to the surface a number of parallel segments of the same length at a distance L from each other.

Throw 100 needles on this field.

Perhaps not enough. Add 900 more and mark the needles that cross the threads in red.

Suppose we threw not all the needles at once, but one at a time, and recorded at each step the ratio of the number of needles that fell on the threads to the total number of thrown needles, thereby obtaining a larger and larger approximation of the probability that the needle would fall and cross the thread .

If you drop 10,000 needles, the picture will be more accurate.

And now we will do the following transformation: divide the deuce by each number of the resulting series.

For 10,000 needles already more accurate.

If we find the average of the last five thousand members of the series, we get 3.141685 , while the number pi is 3.141593 .
In general, it is no secret to anyone that the last row converges to Pi . But how could this happen? I learned about this at the age of 28 from the aforementioned course. We will plunge into matan.
Theory
We will consider the needle and the line closest to it to the right. The distance from the left end of the needle is denoted by h , the angle of deviation from the line is a .

Obviously, the length of the opposite leg from the angle a will be equal to the sine of the angle times the length of the hypotenuse. Then we can say that if h is less than or equal to the leg opposite the angle a , then the needle crosses the thread.


Let's draw a graph: If we count h and a for each thrown needle and mark these points on the previous graph, then the picture will be as follows:

Thus, the probability that the needle crosses the thread will be equal to the ratio of the area of the figure under the graph to the area of the rectangle, that is, Pi times the length of the needle.

From this the desired approximation of the Pi number is obtained , which was shown by the experiment in the first part.