Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yep - This really is just a random number problem.. it is only interesting in the sense that Pi is something that has been captivating in public math perception. Any random number would have the same characteristics..

It is however something fun to do in a homelab outside of the normal learning and playing around, and that has merit for me. Hobbies are hobbies in part because of the interest, joy and appreciation they drive.



In one sense you're right. The set of normal numbers has measure 1 so if you choose a real number randomly it will be normal and have the same properties.

In another sense you're very wrong. The set of uncomputable numbers also has measure 1. So while there are lots of normal numbers Pi belongs to a pretty exclusive club of numbers we can actually look at.

It's not a particularly deep result but the fact that the set of computable numbers is countable will never not make me existential. Every number that we can actually express, that we will ever know, is no bigger than the whole numbers.


How do you generate a random irrational number?


Generate a random Cauchy sequence. One trivial way to do this is to output a random string of digits. It's not perfect, but it works. Approximately 0% of random Cauchy sequences will be computable, so long as your random number generator doesn't have self-correlations.


Would this not require generating an infinite number of random numbers which you can not do? Or can you actually generate a random Cauchy sequence from a finite set of random numbers?


"which you can not do" is an interesting assertion. In some sense it's trivially true, of course. Generating infinite random numbers would take infinite time. In fact, I'm quite happy to say that approximately 0% of real numbers can exist, for that reason.

But in contrast to that, I'm also happy to grant the existence of constructions with countably infinite length when discussing theories outside of computability. So in that context, is it possible to generate an infinite string of random numbers? Well, it is so long as you believe you can generate any amount random numbers at all. Just repeat the process, whatever it is.

Is that a reasonable thing to believe? That's probably a philosophical question at this point. I'm certainly not equipped to answer it. But assuming it is possible allows for some interesting math, which I support for its own sake.

This is all sort of reminiscent of a mathematician friend's stance on the axiom of choice. If you were to tell them a vehicle is only guaranteed to not explode by the axiom of choice, they wouldn't use it. On the other hand, assuming the axiom of choice is true leads to some useful math, even if it's sort of sketchy ontologically. It's a lot like programming. Sometimes you can't fix the bugs in the underlying system and you just code around them to get your stuff working.


We were talking about somewhat different things, you meant doing it mathematically, sure, no problem, pick an infinite random sequence, I understood the question to mean how to do it in practice.

Actually I had something even stronger in mind, being able to pass the generated number around. For pi I can have a program that I can pass around and that will give everyone access to all the digits of pi, in base 16 we can even have random access to all the digits.

For generating a random Cauchy sequence things are not that easy. Locally I can just use a true random number generator - in case such a thing exists - and generate all the digits I am interested in on demand, storing them in case I have to look at a previously generated digit again. But I can not easily pass that number around, only the digits I have already generated. We would need a shared database where everyone can share all the generated digits.

Or I could try to replace the true random number generator with a pseudo random number generator, then I could just pass the seed around. Everyone would have to either agree how the sequence of random numbers is mapped to the sequence of digits or we would have to use a seekable random number generator. But this raises the question whether using a [specific] pseudo random number generator would still yield a normal number.


I think the answer is yes and no.

Let's say we knew we had a normal number, say we could prove pi is normal. Then the set of sequences defined by the decimal expansion of pi starting at the nth place for all n in the natural numbers would be uniformly random over all decimal expansions. I'm going this route because it in theory allows us to define each sequence by virtue of a single number rather than an infinite sequence of randint(0, 9). This I think would be our best case if it were possible. But you would have to select a number uniformly in the range [0, inf) which... you can't.


We actual know some normal numbers [1] but they seem to all be synthetic. I would guess they have a lot of local correlation because of the way they are constructed and the comment I responded to explicitly mentioned no self-correlations - not sure what exactly that means - but it probably indicates that being a normal number is not a strong enough condition for using its digits as a sequence of random digits.

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




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

Search: