Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Maybe powers of π don't have unexpectedly good approximations? (11011110.github.io)
75 points by thomasahle on July 13, 2022 | hide | past | favorite | 36 comments


Pretty cool that you can determine the exact probability distribution for the digits of fraction expansion of a random real number:

lim_{n->inf} Pr[k_n = k] = -log_2(1 - 1/(k+1)^2)

And this was determine already in 1929! I think fraction expansions was all the rage back then. https://en.wikipedia.org/wiki/Gauss%E2%80%93Kuzmin_distribut...


Yes! Not only that, here's something I found mind-blowing: for almost all real numbers, the nth root of the nth convergent's denominator has as limit the same value, and that value is e^(pi^2/12ln2).

Am typing from phone so can't write it down here properly, but some details at an old blog post of mine: https://shreevatsa.wordpress.com/2010/04/30/some-incredibly-...


there's also Khinchin's constant - for almost all real numbers, the geometric mean of the first n continued fraction coefficients approaches a constant K as ngoes to infinity. K is about 2.68 (the geometric mean of the Gauss-Kuzmin distribution).

I like to pair this with a more trivial fact - for almost all real numbers, the arithmetic mean of the first n digits of the decimal expansion, as n goes to infinity, approaches 4.5.


> for almost all real numbers, the arithmetic mean of the first n digits of the decimal expansion, as n goes to infinity, approaches 4.5.

Is this just because Almost All Reals are Normal, and so in every base they have an equal distribution of all digits ?


That’s exactly it.


Here's an even more trivial fact: For almost all real numbers, the geometric mean of the first N digits of the decimal expansion, as N goes to infinity, approaches zero. (Really really fast!)


and a less trivial one: the arithmetic mean of the continued fraction coefficients goes to infinity.


Results like this are a lot of fun, and like many a reasonable number of cool results in number theory, are "surprisingly easy". There's a proof only using two ideas:

1) Birkhoff ergodic theorem, which states for a "nice" dynamical system, the probability that certain events occur can be described explicitly by an invariant distribution (see [1]), and

2) Continued fractions have an associated "nice" dynamical system (the Gauss map) which has an explicit probability distribution that is not too challenging to compute.

Of course, writing this argument out takes a bit of work [2].

In fact, the argument is structured in the exact same way as the fact that uniformly randomly chosen numbers in [0,1] are normal (i.e. the digit frequencies in a base-b expansion are all 1/b).

However, proving such results about _specific_ numbers is notoriously hard [3]. As far as I am aware, there has not been a single irrational algebraic number proven to be normal. Normality of well-known constants like pi and e is also an open problem! I would not be surprised if proving distributional results for continued fraction expansions of pi is also very hard.

[1]: https://en.wikipedia.org/wiki/Ergodic_theory#Ergodic_theorem...

[2]: http://www.geometrie.tugraz.at/karpenkov/cf2011/cf2011s_7.pd...

[3]: https://en.wikipedia.org/wiki/Normal_number#Properties_and_e...


> However, proving such results about _specific_ numbers is notoriously hard [3]. As far as I am aware, there has not been a single irrational algebraic number proven to be normal. Normality of well-known constants like pi and e is also an open problem! I would not be surprised if proving distributional results for continued fraction expansions of pi is also very hard.

Is it known if algebraic numbers can be normal? I'm not a mathematician, but almost all numbers are normal, and almost all numbers are non-algebraic (or even non-computable!). Something akin to "most of the non-algebraics and non-computables are normal, and none of the algebraics are normal" is feasible, right? It contradicts the commonly held idea that e or sqrt(2) or pi are normal, but we don't even have a (non-constructuve) proof that there exist irrational algebraic normals, do we?


You're absolutely correct---countable sets have probability zero (with probability 1 a uniformly random number in [0,1] will irrational), and it would not be contradictory for all algebraic numbers to be non-normal. I am pretty sure it is unknown if there exist irrational algebraic normal numbers, even non-constructively.

One reason for believing that irrational algebraics, or pi, or e are normal, is a crude heuristic which is that "there is nothing special about base b". You can also take a computer and compute digit frequencies up to some very large precision, and see what happens. Generally speaking, it feels like "naturally defined numbers" should be normal unless there is a good reason for them not to be (and this is entirely independent of the fact that uniformly random numbers are normal). Proving this is a very different matter!


I don't know that I follow

> is a crude heuristic which is that "there is nothing special about base b

In this context. Imagine the stronger statement, for all bases b, sqrt(2) is not normal in base b. This is base-independent, and we know one base for which it is true (the irrational base sqrt(2), where it's 10). I assume this has something do with restricting b. This argument sounds reasonable for integer or rational bases, but not for noncomputable bases (where presumably sqrt(2) becomes non-computable, how does that work?)

Obviously if we restrict to integer/rational bases, I follow that argument.


Wouldn't the right question be "do the powers of pi have unusually big terms towards the beginning of their continued fractions?" Because even one such term is enough to have a surprisingly good approximation, but many small terms at the beginning would create an approximation with a larger numerator and denominator, which may seem less remarkable than 355/113.


Pi, or rather pi/6=~0.523, has an odd coincidental relationship with a formula involving phi=(√5+1)/2=~1.618, to three places. And, it is just possible that whoever the hell did the Great Pyramid knew of this coincidence.

There is also a strange relationship involving pi, phi, the cubit used there, and the modern meter (which is canonically taken from 1/40,000,000 of the Earth's circumference). The Egyptian cubit, by some mysterious, hermetical coincidence, exactly matches the French royal cubit. The ratio of that cubit to the modern meter is pi/6, to 3 places.

https://www.willemwitteveen.com/the-royal-cubit/

This might all seem like reaching, but the Egyptians were very keen on numerology. They thought it had legitimately divine implications, and that coincidences were none. There are odd coincidences with the size of Earth, moon, and sun involving these values.

You can go down the rabbit hole; https://www.sacredgeometry.blog/the-royal-cubit/

Demanding only three digits of precision to match makes these coincidences a lot easier, but the ancients were probably satisfied by that precision.


I wonder what happens for powers of e. This should be different than pi, since e has continued fraction coefficients that make a nice pattern [2, 1, 2, 1, 1, 4, 1, 1, ...]. e^2 does as well (https://oeis.org/A001204). (I know this fact but have never understood any of the proofs.)

But e^3 (https://oeis.org/A058282) does not have a "nice pattern", and neither does e^4 (https://oeis.org/A058283)


Often a nice pattern can be found if one uses a generalized continued fraction


/? 3blue1brown e^ipi https://m.youtube.com/results?sp=mAEA&search_query=3blue1bro...

Given:

  e = limit((1 + 1/n)^n, +∞)  # Euler's number
  i = √-1  # orthogonal; i_0^2 = -1
  pi = (666/212 - 22/7)*π  # circle circumference / diameter 
Euler's identity:

  e^iπ + 1 = 0
Euler's formula:

  e^ix = cos(x) + i*sin(x)
Euler's formula: https://en.wikipedia.org/wiki/Euler's_formula

e (Euler's number) https://en.wikipedia.org/wiki/E_(mathematical_constant)


Is there something fundamental here - with e.g. radix base e - about countability and a continuum of reals, and maybe constructive interference?


When EM waves that are in phase combine, the resultant amplitude of the combined waveform is the sum of the amplitudes; constructive interference is addition. And from addition, subtraction & multiplication and exponents and logarithms.

And then this concept of phase and curl ( convergence and divergence ) in non-orthogonal, probably not conditionally-independent fluid fields that combine complexly and nonlinearly. Define distance between (fluid) field moments. A coherent multibody problem hopefully with unitarity and probably nonlocality.

Can emergence of complex adaptive behavior in complex nonlinear systems of fields emerge from such observable phenomena as countability (perhaps just of application-domain-convenient field-combinatorial multiples in space Z)?


The font I'm seeing this in makes the pi look like a lowercase N.


It’s an uppercase pi; The lowercase one is what we’re all familiar with. What’s interesting is that the actual post has the lowercase one. Is it a bug in HN’s capitalization fixer?


Maybe it's changed now, but the "π" in the title is unicode U+03C0 [0], which is a lowercase pi. In the font Verdana (the one that I see in the title, but not this comment as I type it[1]), U+03C0 looks like a small capital pi and looks a bit like "n").[2]

[0] https://www.compart.com/en/unicode/U+03C0

[1] EDIT: once the comment was submitted, the font changed to Verdana.

[2] https://graphicdesign.stackexchange.com/questions/74608/why-...


Ah. You’re right. I didn’t even think to check the actual codepoint. It still looks the same as it did when I commented hours ago, so it must just be my font then.


there are also script-style 'mathematical pi symbol' codepoints π 𝜋 𝛑 𝝅 𝞹 ℼ


You don’t want many terms of the same pi power, of course they will be random eventually. You should use the first few terms continued fractions of millions of pi powers for this


This is stretching my long gone education, but pi is a transcendental number, meaning it us not a root of any integer-coefficient polynomial, and these tend to not have good rational approximations


On the contrary, due to Roth's theorem [0], transcendental numbers are the only ones who have a chance to be atypically well approximable by rational numbers.

[0] https://en.wikipedia.org/wiki/Roth%27s_theorem


Ah so just off by 1 :)

Now I remember, the "canonical" transcendental number is sum of reciprocals of n! Which is almost rational.


Precisely. In fact, that features in many proofs of transcendence: you find too good rational approximations, which contradicts things like Roth's theorem, so your number cannot be algebraic.


IIRC the first number proven to be transcendental was Liouville's number

0.110001000000000000000001...

where the digits after the decimal place are 1 in the n!th place and 0 otherwise. This is explicitly constructed to be very close to the sequence of rational numbers

0.1, 0.11, 0.110001, ...

(I expect there's nothing special about base 10 here; surely the proof works in binary as well.)


So actually the number you're referring to the natural base of logarithm, usually written "e".

It turns out that e has the same irrationality measure as irrational algebraic numbers (2), meaning it can be approximated similarly well as irrational algebraic numbers, and not as well as some other transcendstal numbers like Liouville's constant


Huh? The link says Roth's Theorem is about algebraic numbers, which are the opposite of transcendental numbers.

And I'm pretty sure 100% of integers are approximable by rational numbers, which has got to be at least as good a figure as the transcendentals can claim.


Actually integers are very poorly approximable by rational numbers, even though each integer is very well approximated by a single specific rational number

The definition of "well approximated" is that there are infinitely many good approximations, not just one really good one, and this is what integers, and algebraic numbers in general, fail to have


Every integer has an infinite number of combinations of integers that add up to it.


Indeed!

Mathematics is a lot about defining something and then proving stuff (and sometimes going the other way around). Different combinations giving the same approximation are considered a single approximation, namely the result of the combination


Actually the irrational number that is hardest to approximate is phi (the golden ratio) which is not transcendental.


“the most irrational” irrational:)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: