Geometric probability demo

Numbers 1 to N (i.e. N objects). Select with replacement until a 1 (i.e. a particular object), counting.

N:
Number of trials:

Trials' results: (#drawings until 1 occurred for each trial)

Mean 1:
SD 1:

#drawings until All N objects occurred for each trial

Mean All:
SD All:


classic geometric distribution (number of trials until the first success, where “success” = drawing/selecting the particular object, and p = 1/N).
When counting the number of drawings until and including the first success (most common version):
Expected value (mean) = 1/p = N
Standard deviation ≈ N
The expected number of selections (with replacement) needed to collect all N distinct objects — the classic coupon collector problem — is exactly:
N × Hₙ
where Hₙ is the nth harmonic number:
Hₙ = 1 + 1/2 + 1/3 + … + 1/N ≈ ln N + γ ≈ ln N + 0.57721…
mean is on the order of N ln N ≈ N ln N + 0.577 N
So, for just a little bit more work (factor of ln N), you get all the objects.

standard deviation is roughly N × π / √6 ≈ 1.28 N (much smaller than the mean when N is large).


coin. mean number of flips until Head. N=2
  same as Discrete probability
1 2 3 4 5 6 7 8 9 10 ...
.5 .25 .125 .0625 .03125 .015625 0.0078125 0.00390625 0.001953125 0.0009765625 ...
SD ~1.38 ?
ALL (H and T): ~3   SD ~1.38 ?


die. mean number of throws until a 1.  N=6
SD ~6
ALL (1-6): 14.8   SD ~6.5    ln 6 ≈ 2

deck cards. mean number of draws (w/replacement) until a specific card, eg. QH   N=52
100 trials: ALL mean 235  SD 52   ln 52 ≈ 4


Selecting without replacement until you select a particular object. discrete uniform distro. Your object could be anywhere in the random shuffle of objects. Mean: (N+1)/2 half N SD: √((N² − 1)/12) ≈ N/√12 ≈ 0.289 N