Skip to contents

Sums 1 p + 2 (1-p) p + 3 (1-p)^2 p + ... directly and by the book's rearrangement into geometric series, both equal to 1/p.

Usage

GeomExp(p, terms = 2000)

Arguments

p

Success probability, 0 < p <= 1.

terms

Number of series terms.

Value

list(mean, series, row_sums).

References

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

Examples

GeomExp(0.25)$series
#> [1] 4