Re: Pi


[Prev][Next][Index][Thread]

Re: Pi



Can you suggest a faster technique?

RWW Taylor wrote in message <01IUQ9ARHGY8G0V40T@ritvax.isc.rit.edu>...
>Colin Guillas writes:
>
>> Anyway, using a loop, this is PI:
>>
>>  PI=4(1-1/3+1/5-1/7+1/9-1/11...)
>>
>> If you represent the fractions as 1/a and keep adding two to a, you can
>> keep a running total.
>> There are workarounds on 386 and 486 processors using QuickBasic that
>> allow you to calculate to 127 (or so) decimal places.  If you run the
>> program and leave the computer for the appropriate numbers of
>> minutes/hours, you'll comeback to the right value, if you double check
>> it.
>
>This is certainly an expression for pi. It was one of the earliest
expressions
>based on an infinite process to be discovered.  I believe (without looking
>it up) it is generally attributed to Gregory, about 1600.
>
>This expression also has the rather dubious distinction of being about the
>_slowest_ known process for calculating pi!  Because it is an alternating
>series
>with decreasing terms, the error at each step is roughly comparable to the
>size of the term being evaluated, which only gets very slightly smaller at
>each successive step.  To get six or seven places of accuracy you need to
add
>up some _billions_ of terms.  No matter what processor you chose to use, in
>the lifetime of the universe you could not work out any interesting number
of
>decimal places.
>
>If you _did_ want to investigate convergence of this series, it might make
>sense to calculate every _other_ partial sum, to get either an increasing
or
>a decreasing progression.  Thus
>
>        pi = 4(1-1/3) + 4(1/5-1/7) + ...  = 8/3 + 8/35 + ...
>or
>        pi = 4 - 4(1/3-1/5) - 4(1/7-1/9) - ... = 4 - 8/15 - 8/63 - ...
>
>In general, planning and forethought are a far better investment of time
than
>letting your calculator/computer run overnight when it comes to arriving at
>difficult-to-compute values. As I have mentioned a few times here, running
the
>right sort of programs on even a TI-82 can quickly get you hundreds of
places
>of pi.  Next step -- what do you do with them?  :-)}
>
>RWW Taylor
>National Technical Institute for the Deaf
>Rochester Institute of Technology
>Rochester NY 14623
>
>>>>> The plural of mongoose begins with p. <<<<


References: