ddice: Exact probabilities for sum of n dice

View source: R/ddice.r

ddiceR Documentation

Exact probabilities for sum of n dice

Description

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)
pdice(13, 5, 6)

pbreheny/breheny documentation built on March 30, 2024, 7:37 p.m.