Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateMaxProbabilities ¶
func CalculateMaxProbabilities(params probabilities.DiceRollParameters) (probabilities.Probabilities, error)
CalculateMaxProbabilities returns probabilities of max for dice rolls.
For example for 2d6 rolls probability of 1 (1+1) is 1/36, probability of 2 (1+2, 2+1, 2+2) is 3/36, etc.
For rolls of n m-sided dices consider n-dimensional cube with side of m. That cube consists of smaller m^n cubes with side of 1. Each small cube defines one specific roll.
Subcube with side of 1 contains all small cubes for max of 1. Subcube with side of 2 without previous subcube contains all small cubes for max of 2. Etc.
func CalculateMinProbabilities ¶
func CalculateMinProbabilities(params probabilities.DiceRollParameters) (probabilities.Probabilities, error)
CalculateMinProbabilities returns probabilities of min for dice rolls.
For example for 2d6 rolls probability of 6 (6+6) is 1/36, probability of 5 (5+6, 6+5, 5+5) is 3/36, etc.
For rolls of n m-sided dices consider n-dimensional cube with side of m. That cube consists of smaller m^n cubes with side of 1. Each small cube defines one specific roll.
The idea with subcube is the same with that of "max" case except that subcubes grow from the other side of big cube.
Types ¶
This section is empty.