Pi refers to the ratio of the circumference of a circle to the diameter on a plane. It is represented by the symbol π (pronounced pài). In ancient China, there were names such as cycle, cycle rate and week. (generally, π=3. 14)
History of pi
Euclid's Elements of Geometry in ancient Greece (about the beginning of the 3rd century BC) mentioned that pi was a constant, and China's ancient calculation book Zhou Bi Shu Jing (about the 2nd century BC) recorded that pi was a constant. Many approximations of pi have been used in history, most of which were obtained by experiments in the early days. For example, π = (4/3) 4 ≈ 3. 1604 is taken from ancient Egyptian papyrus (about BC 1700). The first person to find pi scientifically was Archimedes. In The Measurement of a Circle (3rd century BC), he determined the upper and lower bounds of the circumference of a circle by using the circumference of a regular polygon inscribed and circumscribed by the circle. Starting with a regular hexagon, he multiplied it by a regular 96-hexagon and got (3+( 10/7 1)).
When Liu Hui, a mathematician in China, annotated Nine Chapters Arithmetic (263), he got the approximate value of π only by inscribing a regular polygon into a circle, and also got the value of π accurate to two decimal places. His method is called the secant circle method by later generations. He used secant technique until the circle inscribed the regular polygon of 192.
Zu Chongzhi, a mathematician in the Northern and Southern Dynasties, further obtained the π value accurate to 7 decimal places (about the second half of the 5th century), gave the insufficient approximation of 3. 14 15926 and the excessive approximation of 3. 14 15927, and also got two approximate fractional values, namely 355//. In the west, the secret rate was not obtained by German Otto until 1573, and was published in the work of Dutch engineer Antoine in 1625, which is called Antoine rate in Europe.
17 At the beginning of the 5th century, the Arabic mathematician Cassie got the exact decimal value of pi17, which broke the record kept by Zu Chongzhi for nearly a thousand years.
1596, the German mathematician Curran calculated the π value to 20 decimal places, and then spent his whole life calculating it to 35 decimal places of 16 10. This value is named Rudolph number after him.
1579 The French mathematician Veda gave the first analytical expression of π.
Since then, various expressions of π value such as infinite product, infinite continued fraction and infinite series have appeared one after another, and the calculation accuracy of π value has also improved rapidly. 1706, the British mathematician Mackin calculated the π value, which broke through the decimal mark of 100. 1873, another British mathematician Jean-Jacques calculated π to 707 decimal places, but his result was wrong from 528 decimal places. By 1948, Ferguson in Britain and Ronchi in the United States announced the 808-bit decimal value of π, which became the highest record of manual calculation of pi.
The appearance of electronic computer makes the calculation of π value develop by leaps and bounds. From 65438 to 0949, the Army Ballistics Research Laboratory in Aberdeen, Maryland, USA used a computer (ENIAC) to calculate π value for the first time, and it suddenly reached 2037 decimal places, exceeding thousands of digits. 1989, researchers at Columbia University in the United States used Cray-2 and IBM-VF supercomputers to calculate 480 million digits after the decimal point, and then continued to calculate to 10 1 100 million digits after the decimal point, setting a new record.
Besides the numerical calculation of π, its properties have also attracted many mathematicians. 176 1 year, Swiss mathematician Lambert first proved that π is an irrational number. 1794 French mathematician Legendre proved that π2 is also an irrational number. By 1882, German mathematician Lin Deman proved that π is a transcendental number for the first time, thus denying the problem of "turning a circle into a square" that has puzzled people for more than two thousand years. Others study the characteristics of π and its connection with other numbers. For example, 1929, the Soviet mathematician Gelfond proved that eπ is a transcendental number and so on.
Calculation of pi
For a long time, many people have devoted themselves to the research and calculation of pi. In order to calculate a better approximation of pi, generations of mathematicians have contributed countless time and energy to this mysterious number.
/kloc-Before the 0/9th century, the calculation of pi progressed very slowly. /kloc-after the 0/9th century, the world record for calculating pi has been innovated frequently. The whole nineteenth century can be said to be the century with the most manual calculation of pi.
In the 20th century, with the invention of computer, the calculation of pi has made great progress. With the help of supercomputers, people obtained the precision of pi of 206 1 100 million bits.
One of the most marathon calculations in history is Ludolph Van Ceulen of Germany. He spent almost his whole life calculating the inscribed 262-sided circle and got the 35-bit precision value of pi in 1609, so that pi is called Ludolph number in Germany. The second is William Shanks of England, who spent 15 years to calculate the 707th decimal of pi in 1874. Unfortunately, later generations found him wrong from the 528th place.
It is of little practical significance to calculate the value of pi so accurately. A dozen pi values used in modern science and technology are enough. If the 35-bit precision pi value calculated by Ludolph Van Ceulen is used to calculate the circumference of a circle that can wrap the solar system, the error is less than one millionth of the proton diameter. In the past, people calculated pi to explore whether pi circulated decimals. Since Lambert proved that pi is irrational in 176 1 year and Lin Deman proved that pi is transcendental in 1882, the mystery of pi has been uncovered.
Nowadays, people calculate pi mostly to verify the computing power of computers and also for interest.
Calculation method of pi
The ancients generally used the tangent circle method to calculate pi. In other words, the circumference of a circle is approximated by a regular polygon inscribed or circumscribed. Archimedes used a regular 96-sided polygon to get the precision of three decimal places of pi; Liu Hui uses a regular 3072 polygon to get a precision of 5 digits; Ludolph Van Ceulen obtained 35-bit accuracy by using regular 262-sided polygons. This geometry-based algorithm is computationally intensive, slow and thankless. With the development of mathematics, mathematicians have found many formulas for calculating pi intentionally or unintentionally in mathematical research. Here are some classic commonly used formulas. In addition to these classical formulas, there are many other formulas and formulas derived from these classical formulas, so I won't list them one by one.
1, McKin formula
This formula was discovered in 1706 by John McKin, a British astronomy professor. He used this formula to calculate the pi of 100. Machin formula can get 1.4 decimal precision every time it is calculated. Because its multiplicand and dividend are not greater than long integers in the calculation process, it is easy to program on the computer.
Machin.c source program
There are many arctangent formulas similar to Machin formula. Among all these formulas, Mackin's formula seems to be the fastest. Nevertheless, if we want to calculate more numbers, such as tens of millions, McKin's formula is not enough. The algorithm described below takes about one day to calculate on PC, and the precision of pi exceeding 1 100 million bits can be obtained. These algorithms are more complicated to implement with programs. Because the calculation process involves multiplication and division of two large numbers, FFT (Fast Fourier Transform) algorithm should be used. FFT can shorten the multiplication and division time of two large numbers from O(n2) to O(nlog(n)).
2. Ramanukin formula
19 14 years, Indian mathematician Srinivasa Ramanujan published a series of *** 14 formulas for calculating pi in his paper, which is one of them. This formula can get the precision of 8 decimal places for each calculation. 1985, Gosper used this formula to calculate the digits of17,500,000 of pi.
1989, David &; Brother Gregory chudnovski improved Lamanukin's formula into:
This formula is called chudnovski formula, and the decimal precision of 15 can be obtained for each calculation. 1994, chudnovski brothers calculated 4.044 billion with this formula. Another form of Chudnovsky formula that is more convenient for computer programming is:
3.AGM (arithmetic-geometric average) algorithm.
Gauss-Legendre formula:
Every iteration of this formula will get double decimal precision, for example, to calculate 654.38+0 million bits, 20 iterations is enough. 1September, 1999, Gao Qiao and Jintian used this algorithm to calculate the digits of pi of 206,158,430,000, setting a new world record.
4, Borwein four iterations:
This formula was published by Jonathan Borwein and Peter Borwein in 1985, and it converges to pi four times.
This formula, abbreviated as BBP formula, was published by David Bailey, Peter Bowen and simon plouffe in 1995 * * *. It breaks the traditional algorithm of pi, and can calculate any nth bit of pi without calculating the previous n- 1 bit. This provides feasibility for distributed computing of pi. 1997, Faber-Ribeira discovered a formula that was 40% faster than BBP.