I had randomly remembered about a part of the random number generation process where if the number chosen isn’t random enough you choose it again
Is this a thing and how is the “non random” part evaluated
There is not repicking mechanism in any pRNG that I have looked at. It is impossible to look at one number and decide that it 'isn’t random enough'.Quote: heatmapSo I don’t know why I think this is a thing - I’m pretty sure it’s part of some laws that I’ve read into but
I had randomly remembered about a part of the random number generation process where if the number chosen isn’t random enough you choose it again
Is this a thing and how is the “non random” part evaluated
link to original post
One can look at the statistical properties of a large set of random numbers and decide that it does not exhibit the lack of correlation that a random sequence should possess. If you have one new random number, there is nothing to correlate against. If you look at the new number and the previous one and try to make sure they are different, then you are guaranteeing that the stream of numbers is not random.
Quote: heatmapSo I don’t know why I think this is a thing - I’m pretty sure it’s part of some laws that I’ve read into but
I had randomly remembered about a part of the random number generation process where if the number chosen isn’t random enough you choose it again
Is this a thing and how is the “non random” part evaluated
link to original post
I have never heard of such a thing.
Quote: charliepatrickThe only thing I can think of is that an RNG uses a binary number, say 32-bits or so. Suppose youy were playing roulette and needed to generate the numbers 0, 1, 2, ... , 35, 36 (single zero for arguments sake), but the local rules said the probabilities had to be equal. Then you would find that you couldn't equally break up the set of 32-bit numbers into 37 equal sections. In fact you're left with 7 unused numbers. Hence if you got FFFFFFF9-FFFFFFFF then you might have to pick again.
link to original post
A much easier approach is to just take the modulus of the selected number.
For example if the number picked is 12345 just take it modulus 38 which will convert it to a number between 0 and 37.
12345 mod 38 = 33
There are better ways but that is probably the simplest example.
Quote: DRichQuote: charliepatrickThe only thing I can think of is that an RNG uses a binary number, say 32-bits or so. Suppose youy were playing roulette and needed to generate the numbers 0, 1, 2, ... , 35, 36 (single zero for arguments sake), but the local rules said the probabilities had to be equal. Then you would find that you couldn't equally break up the set of 32-bit numbers into 37 equal sections. In fact you're left with 7 unused numbers. Hence if you got FFFFFFF9-FFFFFFFF then you might have to pick again.
link to original post
A much easier approach is to just take the modulus of the selected number.
For example if the number picked is 12345 just take it modulus 38 which will convert it to a number between 0 and 37.
12345 mod 38 = 33
There are better ways but that is probably the simplest example.
link to original post
That appears to be almost fair, but not quite fair.
(Lower numbers are slightly more probable than higher numbers for a 32 bit RNG modulo 38.)
(I suspect most places don't care or it's accepted practice to ignore this.)
Quote: DieterQuote: DRichQuote: charliepatrickThe only thing I can think of is that an RNG uses a binary number, say 32-bits or so. Suppose youy were playing roulette and needed to generate the numbers 0, 1, 2, ... , 35, 36 (single zero for arguments sake), but the local rules said the probabilities had to be equal. Then you would find that you couldn't equally break up the set of 32-bit numbers into 37 equal sections. In fact you're left with 7 unused numbers. Hence if you got FFFFFFF9-FFFFFFFF then you might have to pick again.
link to original post
A much easier approach is to just take the modulus of the selected number.
For example if the number picked is 12345 just take it modulus 38 which will convert it to a number between 0 and 37.
12345 mod 38 = 33
There are better ways but that is probably the simplest example.
link to original post
That appears to be almost fair, but not quite fair.
(Lower numbers are slightly more probable than higher numbers for a 32 bit RNG modulo 38.)
link to original post
Agreed. That is why I said it is not the best way.