getWaitingTime2: Waiting Time Calculation via Integral

Description Usage Arguments Value References Examples

Description

The value of this function answers the question:

"How long do I have to wait (on average) until every value of a discrete distribution (with a finite set of values) appears at least once?"

Uses the solution of Flajolet, Gardy and Thimonier (1992)

Usage

1

Arguments

p

[numeric]
Probabilities for which to calculate the mean waiting time.

Value

[numeric(1)] Mean waiting time.

References

Flajolet, Philippe, Daniele Gardy und Loys Thimonier. "Birthday Paradox, Coupon Collectors, Caching Algorithms and Self-Organizing Search". Discrete Applied Mathematics 39(3) (1992), 207–229. DOI:10.1016/0166-218X(92)90177-C.

Examples

1
2
# How long until every side of a fair 40-sided dice appears at least once (on average)?
getWaitingTime2(rep(1/40, 40))

aschersleben/NBCD documentation built on May 12, 2019, 4:32 a.m.