See https://math.stackexchange.com/questions/2290090/probability-that-the-sum-of-k-dice-is-n for derivation
Usage
ddice(x, n, s)
pdice(x, n, s, lower.tail = TRUE)
Arguments
- x
Target sum
- n
Number of dice to be rolled
- s
Number of sides per die
- lower.tail
logical: if TRUE (default), probabilities are P(X <= x); otherwise P(X >= x)
Examples
ddice(13, 5, 6)
#> 420/7776 (5.4%)
pdice(13, 5, 6)
#> 1182/7776 (15.2%)