ulif/diceware

Distribution of RealDiceRandomSource.choice() not equal

Closed this issue · 0 comments

ulif commented

The disitribution of values picked from a sequence in diceware.RealDiceRandomSource.choice() is not equal, if the sequence length is not a power of the number of dice_sides.

For instance for a sequemce [1, 2, 3] and four-sided dice, the distribution will be:
(6/16, 5/16, 5/16), i.e. the first item has a higher probabilty to be picked than the other elements.

This is because we do a modulo, where instead we might should discard rolls.