Page 1 of 2

BGA_rand is not very random

Posted: 07 February 2023, 08:06
by abcde
bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color

Re: BGA_rand is not very random

Posted: 07 February 2023, 09:25
by Tisaac
abcde wrote: 07 February 2023, 08:06 bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Can you please provide stats ? Data analysis ? Or anything more serious than just "i Can see that, it's evident, everyone knows that"

Re: BGA_rand is not very random

Posted: 07 February 2023, 16:54
by Fletcheese
abcde wrote: 07 February 2023, 08:06 This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Have you considered that there could be other reasons for this? In most games there tends to be a color (or two) that players are not picking because it doesn't align with their strategies. The result is that this color accumulates.

Also the colors for energy in Gizmos is determined by an ID ranging from 1 to 52 mod 4. Are you suggesting that the random function is specifically skewed toward producing the same value mod 4 in repetition? Sounds rather unlikely :)

Re: BGA_rand is not very random

Posted: 09 February 2023, 00:03
by abcde
Fletcheese wrote: 07 February 2023, 16:54
abcde wrote: 07 February 2023, 08:06 This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Have you considered that there could be other reasons for this? In most games there tends to be a color (or two) that players are not picking because it doesn't align with their strategies. The result is that this color accumulates.

Also the colors for energy in Gizmos is determined by an ID ranging from 1 to 52 mod 4. Are you suggesting that the random function is specifically skewed toward producing the same value mod 4 in repetition? Sounds rather unlikely :)
I love your implementaion of Gizmo, Fletcheese

Thank you for bringing it to BGA
Through testing my games , i have found BGA rand often favors a certain number and disfavor another. For example, a player will always roll alot of 6s, but not alot of another number.

My apologies for using Gizmo as an example. you have done an awesome job!
I cannot help often seeing color biases that is beyond your control

Re: BGA_rand is not very random

Posted: 09 February 2023, 00:56
by Strode
You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.

Re: BGA_rand is not very random

Posted: 09 February 2023, 01:01
by ufm
Strode wrote: 09 February 2023, 00:56 You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.
Confirmation bias, in other words.

Re: BGA_rand is not very random

Posted: 09 February 2023, 01:08
by Strode
ufm wrote: 09 February 2023, 01:01
Strode wrote: 09 February 2023, 00:56 You need evidence to support this. Randomness doesn't mean that of every dozen d6 rolls, you'll get two of each number. Or even that each number will come up at all. People notice it (and sometimes post about it) when the low percentage stuff comes up, and don't make note when the distribution is normal looking. So this leads them to wrongly believe that something is amiss.
Confirmation bias, in other words.
Yes, that plus a failure to appreciate how many iterations it takes for things to even out.

Re: BGA_rand is not very random

Posted: 09 February 2023, 11:48
by tchobello
I often answer to this with the Birthday Problem...

you only need 23 students in a classroom to have 50% chances of two of them having their birthday on the same day.

it seems really counterintuitive but that's a fact !

Re: BGA_rand is not very random

Posted: 09 February 2023, 21:54
by abcde
Tisaac wrote: 07 February 2023, 09:25
abcde wrote: 07 February 2023, 08:06 bga_rans often gets stuck on certain numbers.

I see that in my testing and in the games I play

This is quite evident in Gizmo, where you can have a bunch of one color coming out all the time and none of another color
Can you please provide stats ? Data analysis ? Or anything more serious than just "i Can see that, it's evident, everyone knows that"
Thanks for your reply
From my many testings with games that use 6 sided dice, often, I found that a player will continuouly roll disportionately more of a certain number . To fix this, I would use another player to roll the dice and this always fixes the problem.

This fix should not work if BGA rand was truly random

Re: BGA_rand is not very random

Posted: 10 February 2023, 09:54
by byte5115
Randomness is a pretty huge topic on its own, it might be by chance you are hitting the same numbers for now and one of definition of randomness is how frequent the repeats are (see table 1 of https://acadpubl.eu/hub/2018-118-22/articles/22a/48.pdf) . In that paper alone, it's already expected that pseudo random generator will create repeats.

Also another point is you need a huge sample size to see if it is actually screwed to one side . Fun fact you can check out https://alexromanov.github.io/2021/12/1 ... andomness/ to see how different php random differ than random.org , I think from there you can see how bias or 'not enough' randomness exist in the php version.

But on that subject, I would be more than happy to help implement a newer PRNG into BGA as i recent read and implemented the following algo into my excel macros : https://www.researchgate.net/publicatio ... om_Numbers