This commit is contained in:
Miloslav Ciz 2024-08-27 17:09:58 +02:00
parent 2c518b91ca
commit 3816e78230
19 changed files with 1805 additions and 1802 deletions

10
pi.md
View file

@ -1,6 +1,6 @@
# Pi
Pi (normally written with a Greek alphabet symbol with [Unicode](unicode.md) value U+03C0) is one of the most important and famous [numbers](number.md), equal to approximately 3.14, most popularly defined as the ratio of a circle's circumference to its diameter (but also definable in other ways). It is one of the most fundamental mathematical constants of our universe and appears extremely commonly in [mathematics](math.md), nature and, of course, [programming](programming.md). When written down in traditional decimal system, its digits go on and on without end and show no repetition or simple pattern, appearing "random" and [chaotic](chaos.md) -- as of 2021 pi has been evaluated by [computers](computer.md) to 62831853071796 digits, although approximate values have been known from very early times (e.g. the value (16/9)^2 ~= 3.16 has been known as early as around 1800 BC). In significance and properties pi is similar to another famous number: [e](e.md). Pi day is celebrated on March 14.
Pi (normally written with a Greek alphabet symbol with [Unicode](unicode.md) value U+03C0) is one of the most important and famous [numbers](number.md), equal to approximately 3.14, most popularly defined as the ratio of a [circle](circle.md)'s circumference to its diameter (but also definable in other ways). It is one of the most fundamental mathematical constants of our [universe](universe.md) and appears extremely commonly in [mathematics](math.md), nature and, of course, [programming](programming.md). When written down in traditional decimal system, its digits go on and on without end and show no repetition or simple pattern, appearing "[random](randomness.md)" and [chaotic](chaos.md) -- as of 2021 pi has been evaluated by [computers](computer.md) to 62831853071796 digits, although approximate values have been known from very early times (e.g. the value (16/9)^2 ~= 3.16 has been known as early as around 1800 BC). In significance and properties pi is similar to another famous number: [e](e.md). Pi day is celebrated on March 14.
{ Very nice site about pi: http://www.pi314.net. ~drummyfish }
@ -16,9 +16,9 @@ Pi to 100 binary fractional digits is:
Among the first 50 billion digits the most common one is 8, then 4, 2, 7, 0, 5, 9, 1, 6 and 3.
Some people memorize digits of pi for [fun](fun.md) and competition, the official world record as of 2022 is 70030 memorized digits, however Akira Haraguchi allegedly holds an unofficial record of 100000 digits (made in 2006). Some people make [mnemonics](mnemonic.md) for remembering the digits of pi (this is known as *PiPhilology*), for example *"Now I fuck a pussy screaming in orgasm"* is a sentence that helps remember the first 8 digits (number of letters in each word encodes the digit).
Some people memorize digits of pi for [fun](fun.md) and competition, the official [world](earth.md) record as of 2022 is 70030 memorized digits, however Akira Haraguchi allegedly holds an unofficial record of 100000 digits (made in 2006). Some people make [mnemonics](mnemonic.md) for remembering the digits of pi (this is known as *PiPhilology*), for example *"Now I fuck a pussy screaming in orgasm"* is a sentence that helps remember the first 8 digits (number of letters in each word encodes the digit).
**PI IS NOT INFINITE**. [Soyence](soyence.md) popularizators and nubs often say shit like "OH LOOK pi is so special because it infiniiiiiite". Pi is completely finite with an exact value that's not even greater than 4, what's infinite is just its expansion in [decimal](decimal.md) (or similar) numeral system, however this is nothing special, even numbers such as 1/3 have infinite decimal expansion -- yes, pi is more interesting because its decimal digits are non-repeating and appear [chaotic](chaos.md), but that's nothing special either, there are infinitely many numbers with the same properties and mysteries in this sense (most famously the number [e](e.md) but besides it an infinity of other no-name numbers). The fact we get an infinitely many digits in expansion of pi is given by the fact that we're simply using a system of writing numbers that is made to handle integers and simple fractions -- once we try to write an unusual number with our system, our [algorithm](algorithm.md) simply ends up stuck in an [infinite loop](infinite_loop.md). We can create systems of writing numbers in which pi has a finite expansion (e.g. base pi), in fact we can already write pi with a single symbol: *pi*. So yes, pi digits are interesting, but they are NOT what makes pi special among other numbers.
**PI IS NOT [INFINITE](infinity.md)**. [Soyence](soyence.md) popularizators and nubs often say shit like "OH LOOK pi is so special because it infiniiiiiite". Pi is completely finite with an exact value that's not even greater than 4, what's infinite is just its expansion in [decimal](decimal.md) (or similar) numeral system, however this is nothing special, even numbers such as 1/3 have infinite decimal expansion -- yes, pi is more interesting because its decimal digits are non-repeating and appear [chaotic](chaos.md), but that's nothing special either, there are infinitely many numbers with the same properties and mysteries in this sense (most famously the number [e](e.md) but besides it an infinity of other no-name numbers). The fact we get an infinitely many digits in expansion of pi is given by the fact that we're simply using a system of writing numbers that is made to handle integers and simple fractions -- once we try to write an unusual number with our system, our [algorithm](algorithm.md) simply ends up stuck in an [infinite loop](infinite_loop.md). We can create systems of writing numbers in which pi has a finite expansion (e.g. base pi), in fact we can already write pi with a single symbol: *pi*. So yes, pi digits are interesting, but they are NOT what makes pi special among other numbers.
Additionally contrary to what's sometimes claimed **it is also unproven (though believed to be true), whether pi in its digits contains all possible finite strings** -- note that the fact that the series of digits is infinite doesn't alone guarantee this (as e.g. the infinite series 010011000111... doesn't contain any possible combinations of 1s and 0s either). This would hold if pi was [normal](normal_number.md) -- then pi's digits would contain e.g. every book that will ever be written (see also [Library Of Babel](library_of_babel.md)). But again, there are many other such numbers.
@ -28,9 +28,9 @@ What makes pi special then? Well, mostly its significance as one of the most fun
Evaluating many digits of pi is mathematically [interesting](interesting.md), programs for computing pi are sometimes used as [CPU](cpu.md) [benchmarks](benchmark.md). There are programs that can search for a position of arbitrary string encoded in pi's digits. However in practical computations we can easily get away with pi approximated to just a few decimal digits, **you will NEVER need more than 20 decimal digits**, not even for space flights (NASA said they use 15 places).
One way to judge the quality of pi approximation can be to take the number of pi digits it accurately represents versus how many digits there are in the approximation formula -- this says kind of the approximation's [compression](compression.md) ratio. But other factors may be important too, e.g. simplicity of evaluation, functions used etc.
One way to judge the quality of pi approximation can be to take the number of pi digits it accurately represents versus how many digits there are in the approximation formula -- this says kind of the approximation's [compression](compression.md) ratio. But other factors may be important too, e.g. simplicity of evaluation, [functions](function.md) used etc.
Also remember, **you can measure pi in real life** by many methods: you can draw a big circle, measure its radius and circumference and then make the division, you can also manually perform the Monte Carlo algorithm (see below) by drawing a circle and then throwing objects around, counting how many fall inside and outside (just watch out to do it correctly, for example you must have the fall spot probability as random as possible, not biased in any way), or you can similarly make a square from wood, then cut out its inscribed circle, weight both parts and compute pi (with the same formula as for Monte Carlo).
Also remember, **you can measure pi [in real life](irl.md)** by many methods: you can draw a big circle, measure its radius and circumference and then make the division, you can also manually perform the Monte Carlo algorithm (see below) by drawing a circle and then throwing objects around, counting how many fall inside and outside (just watch out to do it correctly, for example you must have the fall spot probability as random as possible, not biased in any way), or you can similarly make a square from wood, then cut out its inscribed circle, weight both parts and compute pi (with the same formula as for [Monte Carlo](monte_carlo.md)).
{ I tried this -- I took a pizza box, cut out four squares, then used a pencil on string to draw quarter circles on each, cut them and weighted both groups. All the circle parts weighted 61 grams, the rest weighted 16 grams, this gives me a nice estimate value of pi of about 3.16. ~drummyfish }