| ▲ | gowld 2 days ago | |
I think you need 0-5 to avoid bias. (If you are good at generating random 0-9, then you are biasing 0-4 over 5-6, in the mod-6 regime, and I can preserve that bias by preferring to choose small or large numbers depending on whether I want a small or large result) | ||
| ▲ | jojobas a day ago | parent [-] | |
You must be somewhat right, however only 4 gets biased up: In [18]: n = 10000000 In [19]: tally = [0,0,0,0,0,0] In [20]: for i in range(n): ...: tally[(random.randint(0,9)+ random.randint(0,9))%6]+=1 ...: In [21]: tally Out[21]: [1600008, 1600460, 1699599, 1799697, 1699604, 1600632] | ||