Closed ackwell closed 10 years ago
... the randomness comes from random.randint(1, 6)
. If you start skewing (or weighing) Poisson distributed randomness, you start to miss the whole point of it.
elif self.TYPE == self.SINGLE:
# Just give the total (not actually very accurate)
total = random.randint(die * self.F_LOWER_LIMIT, sides * die)
Doesn't look like random.randint(1, 6)
to me. Unless my concept of probability is completely wrong, the code above is not entirely accurate.
The problem is that it pretends it is throwing one very large die, as opposed to lots of smaller die, hence the inaccuracy. Manually 'rolling' each 'die' individually is far too slow on large roll requests.
... are we talking about statistical or theoretical probability? If we are referring to the statistical aspects of rolling dice, you're correct -- it isn't completely accurate. However, if we assume Poisson distribution of dice rolls, that is correct.
The former. Given the example of 2d6
, it should be much more likely that a diceroll of 7
(6 possible throws) occur than that of 2
or 12
(1 possible throw).
Bloody email didn't use markup.
Ok ... how would you like to weigh it? Halve, then skew toward 0 (using %
) and then add them again? What is a safe way of skewing numbers?
I have no idea, hence why this is an issue as opposed to already being fixed.
From my understanding, you'd have to raise to a power and modulo it. I'm looking into it now.
EDIT: Nope. We'll just normal distribution it.
Doesn't take into account probability. Someone slightly less asleep than I should modify it to weight the random numbers correctly.