Path: csiph.com!news.swapon.de!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.lang.c++
Subject: Re: Repeating decimals are irrational
Date: Thu, 25 Apr 2024 16:33:50 -0700
Organization: A noiseless patient Spider
Lines: 88
Message-ID: <86y191uie9.fsf@linuxsc.com>
References: <5b363d215e2c4dab1d496efee2655409dcecf655.camel@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Date: Fri, 26 Apr 2024 01:33:53 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="f2bed875c7d47d71c2ee481e5ebd514b"; logging-data="3445735"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/L5iGDYd35qb5yS5axAak7ilwon1Q0XRw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:s28fYMjdt3W/jqLHdhb44Pz1Auo= sha1:zmFATVtFA31Boz1j4+DsKtXYvno=
Xref: csiph.com comp.lang.c++:118891
Paavo Helde writes:
> 27.03.2024 04:42 Chris M. Thomasson kirjutas:
>
>> On 3/26/2024 2:51 PM, Paavo Helde wrote:
>>
>>> 26.03.2024 22:13 Chris M. Thomasson kirjutas:
>>>
>>>> On 3/26/2024 7:51 AM, wij wrote:
>>>> [...]
>>>>
>>>> Repeating decimals are rational, say
>>>>
>>>> 0.142857 142857 142857
>>>>
>>>> That is just 1 / 7 represented in base 10.
>>>>
>>>> Now, think of using a TRNG to create each digit...
>>>>
>>>> That would be, irrational... ;^)
>>>
>>> Any number represented by stored digits on Earth has finite number
>>> of digits (because Earth is finite) and therefore is rational,
>>> regardless of how the digits are generated.
>>
>> Even with a TRNG?
>
> TRNG is defined as a device having access to a "physical entropy
> source". For producing an irrational number it ought to produce an
> infinite never-repeating sequence of digits.
>
> It's not clear if any physical mechanism would in principle produce a
> non-repeating infinite sequence of digits, the fact that the world is
> quantized might rather speak against it.
The world being quantized is irrelevant. Flipping a coin has two
"quantized" outcomes - either heads or tails. However, if the two
outcomes are completely unpredictable then the coin can serve as a
True random number generator. All that is known about quantum
mechanics has found (as I understand it) that it is statistical
only and completely unpredictable. And that property suffices
to be a TRNG.
> Even if it did, the lifetime
> of a physical device is finite, so it can only produce a finite
> sequence of digits. Even if the lifetime of the hypothetical device
> would be infinite, we do not possess the infinite space and time to
> store the result. Such infinities are strictly the territory of
> mathematics, in real world we can have only finite sequence of digits.
None of that matters. All that does matter is that if we know any
finite number of outputs we still don't know anything about what the
next output will be. There is no way to prove, in a mathematical
sense, that a proposed TRNG is in fact a mathematically perfect
TRNG. But we can make TRNGs in the sense that they have resisted
all efforts to successfully predict their behavior (in a way that
is statistically significant).
>>> If you want to represent irrational numbers you need to use some
>>> other encoding schema, e.g. "sqrt(2)" (8 bytes, voila!).
>>
>> pi? ;^D
>
> In mathematics, a notion like pi actually defines an irrational number
> by fixing its properties. For some such irrational numbers it is
> possible to give an infinite algorithm which produces the sequence of
> its digits. The funny thing is that after fixing the number there is
> no randomness any more, so e.g. a machine computing subsequent digits
> of pi would make a pretty poor RNG ;-)
What you're saying about pi is true of any deterministic random
number generator. Yet there are lots of deterministic RNG's that do
a fine job of generating random numbers. I know of no mathematical
result that says consecutive digits of pi would fail any of the many
statistical tests for RNG's that have been devised. As long as the
starting point is not known, AFAIAA there is no reason to think
consecutive digits of pi would be any worse as a random number
generator than any other deterministic random number generator.
(Note: what I am calling deterministic random number generators
are sometimes referred to as PRNGs, for "pseudo random number
generators".)
Incidentally, pi is not just irrational but transcendental. The
property of being irrational is not by itself guarantee that a
number would be a good source of random digits. Probably that
statement is true for (arbitrary) transcendental numbers also.
But pi is not just any transcendental number. :)