heatmap
heatmap
  • Threads: 272
  • Posts: 2348
Joined: Feb 12, 2018
June 28th, 2023 at 4:41:43 AM permalink
So 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
OnceDear
OnceDear
  • Threads: 64
  • Posts: 7532
Joined: Jun 1, 2014
Thanked by
Dieter
June 28th, 2023 at 6:48:05 AM permalink
That would seem to be a bodge of a badly designed rng and shouldn't be a thing.
Psalm 25:16 Turn to me and be gracious to me, for I am lonely and afflicted. Proverbs 18:2 A fool finds no satisfaction in trying to understand, for he would rather express his own opinion.
Mental
Mental
  • Threads: 16
  • Posts: 1549
Joined: Dec 10, 2018
June 28th, 2023 at 7:47:32 AM permalink
Quote: heatmap

So 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

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'.

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.
Gambling is a math contest where the score is tracked in dollars. Try not to get a negative score.
DRich
DRich
  • Threads: 89
  • Posts: 12630
Joined: Jul 6, 2012
Thanked by
heatmapCrystalMath
June 28th, 2023 at 9:22:39 AM permalink
Quote: heatmap

So 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.
At my age, a "Life In Prison" sentence is not much of a deterrent.
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3011
Joined: Jun 17, 2011
June 28th, 2023 at 1:14:50 PM permalink
The 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.
DRich
DRich
  • Threads: 89
  • Posts: 12630
Joined: Jul 6, 2012
June 28th, 2023 at 1:24:33 PM permalink
Quote: charliepatrick

The 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.
At my age, a "Life In Prison" sentence is not much of a deterrent.
Dieter
Administrator
Dieter
  • Threads: 16
  • Posts: 6003
Joined: Jul 23, 2014
June 28th, 2023 at 2:38:41 PM permalink
Quote: DRich

Quote: charliepatrick

The 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.)
May the cards fall in your favor.
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 3011
Joined: Jun 17, 2011
Thanked by
Dieter
June 28th, 2023 at 2:43:15 PM permalink
^ In some juristrictions it is possible that the law states that the probability of each outcome [on a roulette wheel] must be equal. Thus using x mod(37) doesn't quite work. This is because 4294967289 is 0 mod 37 and 4294967295 (232-1) is 6 mod 37; so the numbers 0 thru 6 have a slightly higher chance of being selected than 7 thru 36. Thus if you got these high-end numbers you would have to pick again.
(I suspect most places don't care or it's accepted practice to ignore this.)
DRich
DRich
  • Threads: 89
  • Posts: 12630
Joined: Jul 6, 2012
June 29th, 2023 at 6:01:46 AM permalink
Quote: Dieter

Quote: DRich

Quote: charliepatrick

The 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.
At my age, a "Life In Prison" sentence is not much of a deterrent.
  • Jump to: