←back to thread

76 points Fraterkes | 2 comments | | HN request time: 0.384s | source
Show context
AlotOfReading ◴[] No.46186005[source]
Another procedure based on a similar problem I worked on with a friend: you both pick positive integers a and b, then add them together to create c. Either sqrt(c) or sqrt(c+1) is irrational and the fractional digits provide your random numbers. If you need a new sequence, you take some digits from the current expansion and sqrt() them again.

Might not be unbiased, but good luck proving it.

replies(4): >>46186421 #>>46186596 #>>46186711 #>>46195627 #
pama ◴[] No.46186711[source]
Even without a formal proof you could test it empirically if you generate a large number of samples and run regular tests for pseudorandom number generators. [Edit: a quick test on a million samples and relatively simple RNG tests suggests that this is indeed good enough; maybe worth working out a proof if this hasn't been done already. Edit2: I guess the main problem you'd hit in practice with short sequences of digits would be to avoid accidental recurrences with too short a period, but it should be possible to make it statistically unlikely in practice with enough compute/digits.]
replies(1): >>46187657 #
1. AlotOfReading ◴[] No.46187657[source]
Passes dieharder and PractRand, so it's pretty dang good.
replies(1): >>46187884 #
2. pama ◴[] No.46187884[source]
Yeah I like the simplicity and power of it. You might want to tackle the math and write it up.