Update
This commit is contained in:
parent
bb467bc532
commit
76e9db8a4c
29 changed files with 2094 additions and 2015 deletions
14
pi.md
14
pi.md
|
@ -36,21 +36,25 @@ Also remember, **you can measure pi [in real life](irl.md)** by many methods: yo
|
|||
|
||||
An ugly engineering [approximation](approximation.md) that's actually usable sometimes (e.g. for fast rough estimates with integer-only hardware) is just (something like this was infamously almost made the legal value of pi by the so called Indiana bill in 1897)
|
||||
|
||||
pi ~= 3
|
||||
*pi ~= 3*
|
||||
|
||||
In very old times pi was estimated by Brahmagupta to be
|
||||
|
||||
*pi ~= sqrt(10) = 3.16227766...*
|
||||
|
||||
A simple fractional approximation (correct to 6 decimal fractional digits, by Tsu Chung Chih) is
|
||||
|
||||
pi ~= 355/113
|
||||
*pi ~= 355/113 = 3.14159292...*
|
||||
|
||||
Such a fraction can again be used even without [floating point](float.md) -- let's say we want to multiply number 123 by pi, then we can use the above fraction and compute 355/113 * 123 = (355 * 123) / 113.
|
||||
|
||||
Srinivasa Ramanujan made a great number of pi approximations, e.g. an improvement of the previous to (14 correct digits):
|
||||
|
||||
pi ~= 355/113 * (1 - 0.0003/3533)
|
||||
*pi ~= 355/113 * (1 - 0.0003/3533)*
|
||||
|
||||
Similarly Plouffe, e.g. (30 correct digits):
|
||||
|
||||
pi ~= ln(262537412640768744)/sqrt(163)
|
||||
*pi ~= ln(262537412640768744)/sqrt(163)*
|
||||
|
||||
Leibnitz formula for pi is an infinite series that converges to the value of pi, however it converges very slowly { Quickly checked, after adding million terms it was accurate to 5 decimal fractional places. ~drummyfish }. It goes as
|
||||
|
||||
|
@ -58,7 +62,7 @@ pi = 4 - 4/3 + 4/5 - 4/7 + 4/9 - 4/11 + ...
|
|||
|
||||
Nilakantha series converges much more quickly { After adding only 1000 terms the result was correct to 9 decimal fractional places for me. ~drummyfish }. It goes as
|
||||
|
||||
pi = 3 + 4/(2 * 3 * 4) + 4/(4 * 5 * 6) + 4/(6 * 7 * 8) + ...
|
||||
*pi = 3 + 4/(2 * 3 * 4) + 4/(4 * 5 * 6) + 4/(6 * 7 * 8) + ...*
|
||||
|
||||
A simple **[algorithm](algorithm.md)** for computing approximate pi value can be based on approach used in further [history](history.md): approximating a circle with many-sided regular [polygon](polygon.md) and then computing the ratio of its circumference to diameter -- as a diameter here we can take the average of the "big" and "small" diameter of the polygon. For example if we use a simple square as the polygon, we get pi ~= 3.31 -- this is not very accurate but we'll get a much higher accuracy as we increase the number of sides of the polygon. In 15th century pi was computed to 16 decimal digits with this method. Using inscribed and circumscribed polygons we can use this to get lower and upper bounds on the value of pi.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue