←back to thread

76 points Fraterkes | 2 comments | | HN request time: 0s | source
Show context
jojobas ◴[] No.46186404[source]
Sounds like a bit more complicated odds-and-evens. Rather than mess with pi and circles, you could just cast 0-9 fingers and get mod 6 + 1.
replies(1): >>46195591 #
1. gowld ◴[] No.46195591[source]
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)
replies(1): >>46201478 #
2. jojobas ◴[] No.46201478[source]
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]