For the same reason that alternately adding and subtracting 8 divided by consecutive odd digits approximates 2π so closely. That is, the 4 is obvious enough; the whole thing comes from a formula which originally calculates arctan(1) = the radians in half of a right turn = a quarter of the radians in a half turn = π/4. The only question is why 1/1 - 1/3 + 1/5 - 1/7 + … should happen to compute arctan(1), which was shown by Cabbage.
But, just to fill in some of the spots left unexplained by Cabbage: the reason 1/(1 - x) = 1 + x + x[sup]2[/sup] + … (modulo questions of convergence) is because (1 - x) (1 + x + x[sup]2[/sup] + …) = (1 + x + x[sup]2[/sup] + …) - (x + x[sup]2[/sup] + x[sup]3[/sup] + …) = 1.
Expanding on the remark of Chronos, the reason the antiderivative of 1/(1 + u[sup]2[/sup]) is arctan(u) is because if y = arctan(u), then u = tan(y) = sin(y)/cos(y); thus, du/dy = 1/(cos(y))[sup]2[/sup], so dy/du = (cos(y))[sup]2[/sup] = (cos(arctan(u)))[sup]2[/sup]. By the Pythagorean theorem, this is equal to 1/(1 + u[sup]2[/sup]), as needed.
Finally, Cabbage mentioned glossing over the constant of integration: what we originally derive is that arctan(u) + C = u - u[sup]3[/sup]/3 + u[sup]5[/sup]/5 - …, for some constant C. But plugging in u = 0 allows us to conclude that C = 0.
One other point: Although the classic 1 - 1/3 + 1/5 - 1/7… series converges far too slowly to be useful in itself, once you have one method for calculating pi, it becomes a lot easier to modify it to come up with better methods. For instance, that series alternates between overestimating pi and underestimating it. So at any given point, taking a point exactly halfway in between our two most recent estimates should give us a better result than either of the estimates separately.
Now, the interesting thing is that if you do that with this particular sequence of approximations, the new sequence of approximations also alternates between being too high and too low. So we can apply the same procedure to this new sequence to produce an even better sequence of approximations, and so on. After only a few such iterations, you end up with a method that’s good enough to calculate dozens of digits of pi using only dozens of terms in your sum.
There are many methods of generating π by physical means. For example, one could drop a point randomly onto a square and see how often the point is at least close to the center of the square as the square’s sides are; that is, how often the point lies within a circle inscribed within the square. The probability that this occurs will, of course, be the ratio of the area of the circle to that of the square, π/4.
Why, even more simply, one could measure the length of the distance around a circle and divide it by the radius. This has been known to produce 2π on occasion.
Of all these methods, if you use them calculate Pi to an arbitrary number of decimal places, do they all give exactly the same result? If not, which one is right?
Actually, it occurs to me there’s a nicer way to see this: the derivative of ln(1 + ix) is i/(1 + ix) = (x + i)/(1 + x[sup]2[/sup]). Taking the imaginary component (in the sense of the coefficient of i) of both sides, we have that 1/(1 + x[sup]2[/sup]) is the derivative of the imaginary component of ln(1 + ix). The imaginary component of ln(z) is the angle in radians of z; accordingly, the imaginary component of ln(1 + ix) is the angle which produces a height-to-base ratio of x to 1, which is to say, the arctangent of x, completing the demonstration.
(Of course, fundamentally, this uses the same underlying idea as the quote, only presented differently. But different presentations can be helpful.)
One thing that most posts seem to ignore is the need to prove that some calculation will result in a valid value for pi. Just because some series or formula gives a value about 3+ doesn’t mean you are really computing pi. 22/7 falls down here, since I know of no theory that says 22/7 is a value of pi; it’s just a convenient number if accuracy isn’t important. 3 is OK, too, if a very rough number will suffice.
Unfortunately, my math & trig skills are too rusty to supply a valid formula, but I believe there are several.
Who in this thread has proposed any calculation (apart from 22/7) without justifying it as coming out to precisely π? I don’t think this point has been ignored; for example, beowulff’s post #3 and Cabbage’s post #14 give two informative examples of computations which converge on π exactly and the reasoning why.
Where in Post #14 does it prove that the calculations will equal pi? I’m talking theoretical reasons here, not just that some number series looks promising. We need proof first.
Compare:
I have a series X that converges on something around 3, but no proof that it is anything but an interesting number.
When series X is expanded, it will be equal to pi because {some logical mathematical proof}
Perhaps you misunderstand what is being done with the calculus in post #14? It demonstrates why arctan(1) = 1 - 1/3 + 1/5 - 1/7 + … . arctan(1) is the number of radians in the (principal) angle which produces a tangent of 1; i.e., the number of radians in half of a quarter of a full revolution. By definition, this is 2π/8 = π/4; thus, 4 * (1 - 1/3 + 1/5 - 1/7 + …) = π. There are some small gaps left unexplained (e.g., for absolute rigor, it would be necessary to establish that arctangent is analytic in order to conclude its equivalence to the derived Taylor series), but post #14 isn’t just some handwaving “Look, it comes to a value a little above 3, so it’s probably π”. It’s very much a logical mathematical proof.
(Well, we’d have to do that or something similar; the point is that we could be called upon to add some extra bit of rigor in some way to fill in the glossing over of issues of convergence. But that’s easy enough: so far as such rigor is desired, we can retrace Cabbage’s proof being more explicit about such details:
1/(1 - x) - x[sup]n[/sup]/(1 - x) = 1 + x + x[sup]2[/sup] + … + x[sup]n-1[/sup]
1/(1 + u[sup]2[/sup]) - (-1)[sup]n[/sup]u[sup]2n[/sup]/(1 + u[sup]2[/sup]) = 1 - u[sup]2[/sup] + u[sup]4[/sup] - … + (-1)[sup]n-1[/sup]u[sup]2(n-1)[/sup]
Integrating both sides from 0 to 1, we obtain that:
arctan(1) - (-1)[sup]n[/sup] times the integral from 0 to 1 of u[sup]2n[/sup]/(1 + u[sup]2[/sup]) = 1 - 1/3 + 1/5 - … + (-1)[sup]n-1[/sup]/(2n - 1)
Thus, as arctan(1) = π/4 (this is immediate from the definitions of π and arctan, using basic symmetries in the relevant geometry), we have that the absolute difference between the sum of the first n many terms of 1/1 - 1/3 + 1/5 - 1/7 + … and π/4 is the integral from 0 to 1 of u[sup]2n[/sup]/(1 + u[sup]2[/sup]). All that remains to show is that this gets arbitrarily close to 0 as n gets arbitrarily large: but this integral is upper-bounded by the integral from 0 to 1 of u[sup]2n[/sup], which is 1/(2n + 1), which of course gets arbitrarily close to 0 as n gets arbitrarily large. This completes the proof.
)
(Whoops, I brainfarted and used “analytic” to mean something a little different from what it actually means. Well, no matter; the above post makes the point moot)
On a (curious) side note, what is the worst way of calculating pi ? In other words, what is the pi-converging series that converges the slowest towards it ?
Well, presumably, for any reasonable notion of “converges slower than”, there’s no slowest series; any series can be made to converge slower. But I suppose one could still ask for examples of naturally arising (aka, non-contrived, non-artificial, etc.) series which happen to converge particularly slowly.
The series 1 - 1/x + 1/x^3 - 1/x^5 + … represents arctan x. If you replace x by 1 you have the series for the arc whose tangent is 1 (pi/4). Multiply it by 4 and you have the series for pi.
When you’re doing advanced math, the number pi falls out of equations all over the place. Most people at this level don’t think of pi as something as crude as the ratio of a circle’s circumference to its diameter; it’s a universal number that you come across constantly, of which one of its uses is in figuring the circumference of a circle.
Another number that falls out of equations is e.
You’ve described what I was going to post. Back in the mid-1980s, I used the simple formula to calculate pi on my trusty HP-41C, and display the results as it went. This is a handheld calculator from around 1980, and isn’t known for its blazing number crunching. Anyway, I noticed that the numbers soon bounced around just above and below pi, so I had the idea to keep a running average of the last two approximations, and average those. That result was much closer, sooner, but it also bounced above and below. Then I had the brainstorm to average those last two averages, and it was even better, but also bounced up and down (but y a much smaller amount). I ended up doing ten or so levels of averaging.
The end result was that my little HP-41C would settle on the value of pi to all ten displayed digits, in under a minute. I thought that was pretty good.
I hadn’t seen that story before. Cute. Indeed, Lazzarini’s experiment (assuming he wasn’t biasing the results by carefully choosing his stopping point) could only be claimed to have established [symbol]p[/symbol] to be 3.14 +/- 0.05.