Archimedes started with a 1 = 3 tan(π/3) = 3√3 and b 1 = 3 sin(π/3) = 3√3/2 and calculated b 6 < π < a 6.Īrchimedes, of course, didn’t have trigonometry available to him, as it hadn’t been invented yet he had to work out the geometry directly, as well as making all the calculations by hand! Then, simple trigonometry allows us to calculate (1/ a n + 1/ b n) = 2/ a n+1 and a n+1 b n = ( b n+1) 2. Given K = 3 × 2 n-1, the semiperimeters are a n = K tan(π/ K) and b n = K sin(π/ K) by the definitions of sine and tangent. If b n is the semiperimeter of the inscribed polygon, and a n is the semiperimeter of the circumscribed polygon, then as n increases, b 1, b 2, b 3, … defines an increasing sequence, and a 1, a 2, a 3, … defines a decreasing sequence, each with limit π. The second method is due to Archimedes (287–212 BC), a Greek mathematician who lived in Syracuse, who famously bounded the value of π within a small range by measuring the perimeters of inscribed and circumscribed regular polygons with ninety-six sides: 223/71 < π < 22/7.Ĭonsider a circle with radius 1 and circumference 2π in which regular polygons of 3 × 2 n-1 sides are inscribed and circumscribed the diagram for n = 2 is shown at right. Your first task is to implement a program to calculate the value of π using the Monte Carlo method described above. We could do that by building a model, scattering sand over it, and counting the individual grains of sand, but since we are programmers, it is easier to write a program to do the counting for us. Another way of looking at this, as on the diagram, is to consider just the first quadrant of the circle the square has an area of r 2, and the portion of the circle within the square has an area of π r 2/4.īy taking a large number of points randomly distributed throughout the square and counting how many are within the inscribed circle, we can estimate the value of π. If a circle of radius r is inscribed in a square with sides of length 2 r, the area of the circle will be π r 2 and the area of the square will be (2 r) 2, so the ratio of the area of the circle to the area of the square will be π/4. In a previous exercise we used a spigot algorithm to calculate the digits of π our exercise today will use two different methods to calculate the value of π.Īn interesting method for calculating π uses Monte Carlo simulation. π, which is approximately equal to 3.14159, is one of the most important constants in math, science and engineering it pops up regularly in studies of geometry, trigonometry and calculus, Einstein used π in his field equation of general relativity, and it appears in many statistical distributions. It has been known since antiquity that the ratio of the circumference of a circle to its diameter is the same for all circles the ancient Egyptians, Indians, and Babylonians had all calculated approximations for π about two millenia before the birth of Christ. Pi, or π, is a mathematical constant with a value that is the ratio of a circle’s circumference to its diameter.
0 Comments
Leave a Reply. |