views:

164

answers:

1

Isn't it easily possible to construct a PRNG in such a fashion? Why is it not done?

That is, as far as I know we could simply have a PRNG that takes a seed n. When you ask for a random bit, it takes the nth digit of the binary expansion of the computable normal number, and increments n.

My first thought was that perhaps we hadn't found a computable normal number, but we have. The remaining thought is that there is a good reason not to-- either there's some property of PRNGs that I'm not familiar with that such a method would not have, or it would be impractical somehow, or is otherwise outstripped by other methods.

+3  A: 

That would make predicting the output really simple.

Say, for example, you generate the integer 0x54a30b7f. If you have 4GiB of pi (or random noise or an actual normal number), chances are there's only going to be one (or maybe a handful) occurrence of that particular integer and I can predict with reasonably high probability all future numbers. This is a serious problem in the case of cryptographically strong PRNGs. If instead of simple sequential scan you use some function, I just have to follow the function which if it is difficult enough to follow it turns into a PRNG in it's own right.

If you are not concerned about the cryptographic strength of your generator, then there are much more compact ways of generating random numbers. Mersenne Twister, for example, has a much larger period without requiring a 4GiB lookup table.

Aaron Maenpaa
First of all, pi (along with most other such constants, such as sqrt(2) and e) has not been proven to be normal. Second of all, it's computable, and more importantly, one can compute the nth digit of pi without computing n-1, making a lookup table unnecessary. Will say more in new comment.
Devin Jeanpierre
Sorry, post size limit. Second of all, the thing with a normal number is that any number will occur an infinite number of times in the expansion. Furthermore, it will be just as probable as any other number. So given the full or arbitrarily large range of a normal number, it's not possible to guess.
Devin Jeanpierre
... But then your seed would have to be larger than 32 bits (otherwise you're only using the first 4GiB any way) and the generation of the seed would have to be sufficiently secure that I can't simply attack that.
Aaron Maenpaa
Good point. Accepted.
Devin Jeanpierre