Skip to contents

P(exactly n Heads in 2n fair flips) = C(2n, n)/4^n (eq 2.65) against the Stirling form 1/sqrt(pi n) (eq 2.66).

Usage

HalfHeads(n)

Arguments

n

half the number of flips, >= 1.

Value

list(n, approx, exact, relative_error).

References

Morin, D. J. (2016). Probability: For the Enthusiastic Beginner. Createspace. Eqs. (2.65)-(2.66).

Examples

HalfHeads(50)$relative_error
#> [1] 0.002503086