Buffon Needles Problem

Method of calculating pi
Collection
zero Useful+1
zero
synonym Bufeng needle (Bufeng needle) generally refers to Pufeng needle problem
In the 18th century, Buffon Put forward the following question: Suppose we have a floor paved with parallel and equidistant wood grains (as shown in the overview diagram), throw a needle whose length is smaller than the distance between the wood grains at random, and calculate the probability of intersection between the needle and one of the wood grains. And with this probability, Buffon A method for calculating Pi - random needle throwing method is proposed. This is the Pufeng needle problem.
Chinese name
Buffon Needles Problem
Foreign name
Buffon's needle problem
Alias
Buffon's needle problem
Presenter
Buffon
Proposed time
1777
Applicable fields
Monte Carlo method
Applied discipline
Calculate Pi, Probability

Needle injection steps

Announce
edit
French mathematician Buffon (1707-1788) was the first to design the injection test.
The steps of this method are:
1) Take a piece of white paper and draw many lines with spacing of a on it Parallel line
2) Take a needle with a length of l (l ≤ a), throw it on the paper with parallel straight lines for n times at random, and observe the number of times the needle intersects the straight line, which is recorded as m.
3) Calculate the probability that the needle intersects the straight line
French mathematician in the 18th century Buffon The "needle projection problem" proposed by Bufon was recorded in his book published in 1777: "a group of spaces a are drawn on the plane Parallel line , throw a needle with a length of l (l ≤ a) on the plane at will, and calculate the probability of intersection between the needle and any of the parallel lines. "
Buffon himself proved that the probability is:
(where π is pi)
Because it is related to π, people thought of using the needle throwing test to estimate the value of pi.
Buffon was surprised to find that the ratio of the times of favorable throwing and unfavorable throwing is an expression containing π. If the length of the needle is equal to a/2, then the probability of throwing is 1/π. The more times of throwing, the more accurate the value of π can be obtained.

experimental data

The following formula is used to obtain pi by probability method Approximate value Some information about.
Experimenter
time
Number of Throws
Number of intersections
Estimated value of pi
Wolf
1850
five thousand
two thousand five hundred and thirty-two
three point one five nine six
1855
three thousand two hundred and four
one thousand two hundred and eighteen point five
three point one five five four
C.De Morgan
1860
six hundred
three hundred and eighty-two point five
three point one three seven
1884
one thousand and thirty
four hundred and eighty-nine
three point one five nine five
Lazzerini
1901
three thousand four hundred and eight
one thousand eight hundred and eight
three point one four one five nine two nine
1925
two thousand five hundred and twenty
eight hundred and fifty-nine
three point one seven nine five
In 1901, Italy Mathematician Lazrini claimed to have carried out many needle injection tests, with 3408 needles per time, on average Number of intersections For 1808 times, the given value of π is 3.1415929 - accurate to 6 decimal places. However, whether or not Lazrini actually threw an injection, his experiment was carried out in the United States Utah Ogden L Bajie of National Weber University Calculus , probability and other wide range and channels to find π, which is really surprising!
Buffon The needle throwing experiment is the first example to express the probability problem in geometric form. It is the first time for him to use random Experimental treatment certainty Mathematical problems, for probability theory The development of has played a certain role in promoting. [1]

prove

Certificate 1: Find an iron wire and bend it into a circle so that its diameter is exactly equal to Parallel line Distance d between. It can be imagined that for such a circle, no matter how it is dropped, it will have two intersections with the parallel line. Therefore, if the circle is dropped n times, the total number of intersecting points must be 2n. Imagine straightening the circle into one Is long π d wire. Obviously, it is more complicated for such wire to intersect with parallel lines when it is dropped than a circle. There may be 4 intersections, 3 intersections, 2 intersections, 1 intersection, or even none. Since the length of the circle and the straight line are both π d, according to the principle of equal opportunity, when they are thrown more times and equal, the total number of intersection points between the two and the parallel line group is expected to be the same. That is to say, when the iron wire with the length of π d is dropped n times, the total number of intersections with the parallel line should be about 2n.
Turn to the case where the length of the wire is l. When the number of tosses n increases, this wire follows Parallel line The maximum total number of intersections m should be proportional to the length l, so: m=kl, where k is Scale factor
In order to find k, note the special case when l=π d, where m=2n. So we get
The formula before substitution is as follows:
If this conclusion is extended to l=a/2, then there is only one intersection point at most, and the ratio of m to n is the probability of intersection of needle and straight line. However, this proof is less rigorous. For example, circle and straight line are expected to be equal, and the intersection point of iron wire and parallel line is proportional. Next, we use probability theory and calculus to provide rigorous proof.
Proof II : Because the needle injection to the desktop is random, use Two-dimensional random variable (X, Y) to determine its specific position on the table. Let X represent the distance between the midpoint of the needle and the parallel line, and Y represent the included angle between the needle and the parallel line. If
When the needle intersects the line.
And X in
obey uniform distribution , Y in
Uniform distribution, XY Mutual independence , from which the (X, Y) probability density function
Buffon Needles Problem
Therefore, the calculated probability

Monte Carlo method

Announce
edit
Like the needle throwing experiment, we use the probability obtained from the probability experiment to estimate a quantity of interest. This method is called the Monte Carlo method. When this kind of model contains uncertain random factors, it is usually more difficult to analyze than the deterministic model. Some models are difficult to make quantitative analysis and cannot obtain analytical results, or although there are analytical results, the calculation cost is too high to use. In this case, the Monte Carlo method can be considered, Monte Carlo method Is on the Second World War During this period, it rose and developed with the birth of computers. This method is used in Applied Physics atomic energy Solid state physics , chemistry ecology , sociology and economic behavior And other fields.
utilize Obtuse triangle Calculate pi by side length of
Besides, name 3 at random Positive number The probability P that these three positive numbers can form an obtuse triangle is also related to π, and the probability is (π - 2)/4. The proof is as follows:
Let these three positive numbers be x, y, z, let's say x ≤ y ≤ z, for each determined z, it must meet the requirements of x+y>z, x ^ 2+y ^ 2<z ^ 2, and it is easy to prove that these two formulas can form an obtuse triangle with these three positive numbers as the side length necessary and sufficient condition , using linear programming It can be known that Feasible region Is a straight line x+y=z and a circle x ^ 2+y ^ 2=z ^ 2; The total feasible region is a side length of z square , then the probability of enclosing an obtuse triangle P=S arch/S square=(π z ^ 2/4-z ^ 2/2)/z ^ 2=(π - 2)/4. Because for each z, the probability is (π - 2)/4, so for any positive number x, y, z, there is P=(π - 2)/4, and the proposition is proved.
In order to estimate the value of π, we need to estimate its probability through experiments. This process can be implemented by computer programming. In fact, x+y>z, x ^ 2+y ^ 2<z ^ 2 is equivalent to (x+y-z) (x ^ 2+y ^ 2-z ^ 2)<0, so we just need to check whether this formula is true. If m times Random test , there are n times to meet the equation, when m is enough Large time , n/m approaches to (π - 2)/4, let n/m=(π - 2)/4, and solve π=4n/m+2 to estimate the value of π.
It is worth noting the method adopted here: design an appropriate experiment, whose probability is related to a quantity we are interested in (such as π), and then use the test results to estimate this quantity. With the development of modern technologies such as computers, this method has developed into a widely used Monte Carlo method.
Monte Carlo method is the basis of computer simulation. Its name comes from the world famous Casino —— Monaco Of Monte Carlo Its history originated from French scientists in 1777 Buffon A method for calculating the circumference π, the random needle casting method, is proposed, that is, the famous Pufeng needle casting problem.
The basic idea of the Monte Carlo method is to first establish a probability model And make the solution of the problem exactly the parameter of the model or other relevant characteristic quantity. Then, by simulating a statistical test, that is, multiple random sampling tests (determine m and n), statistics of the occurrence of an event percentage As long as the number of tests is large, the percentage is close to the probability of the event. This is actually the statistical definition of probability. Using the established probability model To make a request Estimated parameters. Monte Carlo method Belongs to the branch of experimental mathematics.
MATLAB Language programming implementation:
l=1;
n=1000;
d=2;
m=0;
for k=l:n
x=unifrnd(0,d/2);
p=unifrnd(0,pi);
if x<0.5*sin(p)
m=m+1;
else
end
end
p=m/n
pi_m=1/p
Run to get the result.
C++language Programming implementation:
#include
#include
#include
#include
int main()
{
longi,in,N=1000000;
doublex,y,pi;
srand(time(NULL));
for(i=0,in=0;i
{
x=2.0* rand() / RAND_MAX -1;
y=2.0*rand()/RAND_MAX-1;
if((x*x+y*y)<=1)
in++;
}
pi=4.0*in/N;
cout<
return 1;
}
Monte Carlo method It has a wide range of applications. It can solve both deterministic problems and Randomness And scientific research For example, the Monte Carlo method can be used to approximate the definite integral , that is, generate numerical integration Question.
arbitrarily Curved trapezoid The approximate area is the area of the pond. What should we do? measuring method As follows: It is assumed that the pond is located in a rectangular farmland of known area. As shown in Figure 1: Throw stones at this farmland randomly to make them fall into the farmland. The stones thrown into the farmland may or may not be splashed with water. It is estimated that the amount of stones "splashed with water" accounts for the percentage of the total amount of stones. Imagine how to use this estimated percentage to approximate the pond area?
Fig. 1 Monte Carlo method (8.2)