Estimating *

advertisement
Calculus II Project Report, compiled from two groups of 2009.
Estimating π
Introduction
There are many ways to approximate the number π. One of which is to use infinite
series as did by James Gregory in the 1600’s. His series is given by the following:
πœ‹
1 1 1
=1− + − +β‹―
4
3 5 7
In this project, an infinite series method will be developed and then compared against
Gregory’s formula. The motivation goal is to improve the approximation accuracy and
computation efficiency as compared to Gregory’s scheme.
Analysis
In fact, Gregory’s series is closely related to arctangent function, tan−1 π‘₯, because
of this identity:
πœ‹
= tan−1 1
4
and the fact that the function has a power series presentation in the interval [−1,1] as
follows
∞
tan
−1
π‘₯ = ∑(−1)π‘˜−1
π‘˜=1
π‘₯ 2π‘˜−1
2π‘˜ − 1
Gregory’s formula is simply the consequence of the continuity of the arctangent function
everywhere and its power series’ convergence in the said closed interval including its
right end point, that is, = 4 ∑∞π‘˜=1(−1)π‘˜−1
1
2π‘˜−1
.
We begin our analysis by presenting a slightly different approach, namely the
Taylor polynomial approximation of functions. We use the Taylor polynomial of order 2,
𝑃2 (π‘₯), as a specific example. By definition and Taylor’s Remainder Theorem, we find
𝑃2 (π‘₯) = π‘₯ with remainder 𝑅2 (π‘₯) =
𝑓(3) (𝑐)
(𝑛+1)!
π‘₯ 𝑛+1 , for tan−1 π‘₯ = 𝑃2 (π‘₯) + 𝑅2 (π‘₯), where 𝑐
is a number between 0 and π‘₯. Thus, at π‘₯ = 1 we can approximate πœ‹ by 4𝑃2 (1) = 4 with
an error of 𝐸2 = |πœ‹ − 4𝑃2 (1)| ≤ |4𝑅2 (1)| = 4
|𝑓(3) (𝑐)|
3!
. Because 𝑓 (3) (𝑐 ) =
6𝑐 2 −2
(1+𝑐 2 )3
is
bounded by its maximum |𝑓 (3) (0)| = 2 by the method of finding extremes of onevariable function from Calculus I (see also Fig.1), the error is bounded by 𝐸2 ≤ 4/3. This
is the same estimate as obtained by applying the converging rate of alternating series to
1
1
3
5
1
Gregory’s series since πœ‹ = 4 (1 − + − +
7
1
1
1
4
3
5
7
3
β‹― ) and|πœ‹ − 4| = 4 ( − + − β‹― ) ≤ . In other
words, using Taylor polynomial estimate does not
offer a more accurate estimate than Gregory’s formula
nor simplify the error estimate with a more
complicated remainder term 𝑅𝑛 (π‘₯).
Fig.1: The graph of |𝐟 (πŸ‘) (𝐱)|
In general, by the alternating series’ error
estimate for Gregory’s series, the error by the 𝑛th partial sum is 𝐸𝑛 = |πœ‹ −
1
4 ∑π‘›π‘˜=1(−1)π‘˜−1
need to have
|≤
2π‘˜−1
4
2𝑛+1
≤ 10
4
2𝑛+1
−𝑑−2
. Thus, to get an accuracy of 𝑑 many decimal places, we
, or 𝑛 ≥ 2(10𝑑+2 ). In other words, each decimal place
improvement in accuracy requires 10 times more terms. For example, to have an
accuracy of 100 digits after the decimal we need 2(10102 ) many terms, a number greater
than the total number of all atoms in the universe.
We now introduce the alternative method of this project. The idea is based on the
observation that if we can find two positive numbers π‘₯, 𝑦 so that
πœ‹
4
= tan−1 π‘₯ + tan−1 𝑦
(1)
then we know they must be in the interval (0,1) since
πœ‹
4
= tan−1 1, and by the
convergence of the arctangent’s power series we have:
πœ‹ = 4 (∑∞π‘˜=1
(−1)π‘˜−1 π‘₯ 2π‘˜−1
2π‘˜−1
+ ∑∞π‘˜=1
(−1)π‘˜−1 𝑦 2π‘˜−1
2π‘˜−1
) = 4 ∑∞π‘˜=1(−1)π‘˜−1
π‘₯ 2π‘˜−1 +𝑦 2π‘˜−1
2π‘˜−1
.
(2)
By the alternating series’ error estimate again, we have instead
𝐸𝑛 = |πœ‹ − 4 ∑π‘›π‘˜=1(−1)π‘˜−1
π‘₯ 2π‘˜−1 +𝑦 2π‘˜−1
2π‘˜−1
|≤
4(π‘₯ 2𝑛+1 +𝑦 2𝑛+1 )
2𝑛+1
≤
8
2𝑛+1
π‘Ÿ 2𝑛+1 ,
a geometrically converging rate, where π‘Ÿ = max{π‘₯, 𝑦} < 1. Thus, for an accuracy to the
𝑑th decimal place, we only need to have 𝐸𝑛 ≤
1
𝑑+2
2
1
π‘™π‘œπ‘”
π‘Ÿ
3 or 𝑛 ≥ (
8
2𝑛+1
π‘Ÿ 2𝑛+1 ≤ π‘Ÿ 2𝑛+1 ≤ 10−𝑑−2 for 𝑛 ≥
3
1
𝑑+2
7
2
π‘™π‘œπ‘”
− 1). For example, if π‘Ÿ = , then 𝑛 = 𝑑 + 2 ≥ (
1
π‘Ÿ
− 1). That is,
we need about the same number of terms to approximate πœ‹ to the same number of
decimal places, an astronomical improvement in both accuracy and efficiency over
Gregory’s scheme. We now demonstrate below this is indeed the case.
The Eq. (1) for π‘₯, 𝑦 can be translated into
1=
π‘₯+𝑦
1−π‘₯𝑦
,
(3)
using this trigonometric identity tan(π‘Ž + 𝑏) =
tan π‘Ž+ tan 𝑏
1−tan π‘Ž tan 𝑏
. The graph of the equation is shown
in Fig.2. To find the smallest possible π‘₯, 𝑦, we
consider the distance squared of points from the
curve to the origin, 𝐷 2 = π‘₯ 2 + 𝑦 2 , and minimize it.
We can express the squared distance as a function
of π‘₯ upon substituting 𝑦 =
1−π‘₯
1+π‘₯
Fig.2: The graph of 𝟏 =
𝒙+π’š
𝟏−π’™π’š
which is solved from Eq.(3) as a constraint for the point
(π‘₯, 𝑦), and minimize the resulting one variable function 𝐷 2 = π‘₯ 2 + (
1−π‘₯ 2
1+π‘₯
) = 𝑓 (π‘₯ ) .
Denoting the solution as π‘₯Μ… . Similarly, we can express 𝐷 2 = 𝑔(𝑦) as a function of 𝑦 and
minimize it to get 𝑦̅. Because of the symmetry of Eq.(1) in both variables, both onevariable functions must have exactly the same form 𝑔(π‘₯) = 𝑓 (π‘₯), and as a result the
minima in the both variables must be the same, π‘₯Μ… = 𝑦̅. Hence, the minimizer can be
solved from the pair of equations: π‘₯ = 𝑦, 1 =
π‘₯+𝑦
1−π‘₯𝑦
, and they are π‘₯Μ… = 𝑦̅ = √2 − 1 =
2
.41421356 … . As an approximation to the irrational solution, we can use π‘₯ = = .4~π‘₯Μ…
5
and solve from Eq.(3) the exact corresponding 𝑦 value as 𝑦 = 3/7=.425… ~𝑦̅. That is, the
analysis of the previous paragraph indeed holds.
Conclusion
To give a perspective as to how much improvement our method is over Gregory’s
scheme, we assume hypothetically that there is a program that takes 1 microsecond to
compute a term and add it to the previous one. To find π accurate to the 100th decimal
place using Gregory’s series, the program would have to run for roughly 10102
microseconds which is about to 1086 years, 1072 times longer than the age of the
universe. It is a practical impossibility. However, using our new series it would only take
the program 10−4 seconds. Similarly, to approximate it to the 10,000th decimal place, our
method would take about 10−2 seconds, or less than one tenth of a second. Clearly, our
method is much more efficient beyond comparison.
Download