Learn

Learning preferences

Make learning more comfortable. Changes apply immediately.

Enlarges page content, including diagrams and their labels. You can also use your browser’s zoom.

Choose the colours that are easiest for you to distinguish. Applies to lesson diagrams and lab plots. Labels, shapes, hatching and line patterns also distinguish meanings. Source photographs and raw image brightness stay unchanged; mask-only views are available for image overlays.

ExampleComparisonSample link

Saved in this browser on this device. Preferences are separate from progress backups.

Lesson 2 of 2

Collect coupons by decomposing waiting stages

Derive expected collection time and deadline bounds while tracking the assumptions behind uniform sampling.

Loading your saved responses…

Try the optional starting-point checks and targeted refreshers. You can continue directly into this lesson.

Try

A synthetic packet contains exactly one of four labels, A, B, C or D. Each packet is independent, and each label has probability 1/4 on every draw. Open packets until you have all four labels. Repeats count toward the number opened. The sequence A, C, A, C, B, B, D finishes in seven draws, but another sequence might take much longer.

Mark the draws that increase the number of distinct labels: draws 1, 2, 5 and 7. The waiting stages have lengths 1, 1, 3 and 2. They add to the total seven. A stage ends at its successful new label; its waiting time includes that successful draw.

Progress counts distinct labels, not packetsStates zero, one, two, three, four labels are joined from left to right. The probability the next draw advances is respectively one, three quarters, one half and one quarter. Otherwise the state remains unchanged.012341 →3/4 →1/2 →1/4 →Number of distinct labels already collected
At k=0,1,2,3 distinct labels, advance probabilities are 1, 3/4, 1/2, 1/4. A repeated label leaves the count unchanged. State 4 is complete; no further draw is required.

Predict

Which stage should take longest on average? With three labels already collected, only one label can finish the collection. Its chance on each new draw is 1/4. At the first stage every label is new, so success is certain. Treating all four stages as having probability 1/4 would overestimate the early waits.

Predict whether the expected time should be four packets, sixteen packets, or something between. We will obtain 1+4/3+2+4=25/3, approximately 8.333 packets. An average need not be an integer, even though every actual completion time is an integer. Nor does this average promise completion by draw 9.

Experiment

Write a sequence of labels, underline each first appearance and divide the sequence into stages. For the supplied sequence A, C, A, C, B, B, D, verify the four stage lengths before changing the sequence to A, A, B, C, C, C, D. The new lengths are 1, 2, 1 and 3: the same total can be distributed differently across stages.

Next do a complete small enumeration rather than inventing random data. With two equally likely labels, list all eight strings of length three. Only AAA and BBB fail to contain both labels. Therefore completion by draw 3 has probability 6/8=3/4. The expected completion time will also equal 3, yet a quarter of trials are still incomplete at that deadline. An expectation and a completion probability answer different questions.

Use the distribution explorer with Number of labels N = 2 and Number of draws t = 3. Predict complete collection probability 3/4 from your enumeration, then reveal it. Change t to 2 and explain why completion probability falls to 1/2. Finally set N=1 and t=0, then t=1: completion changes from impossible to certain. These calculations use a deterministic recurrence, not newly sampled trials. The collision outputs answer a separate question and need not equal the collection probability.

One drawing process, two different questions

Each draw independently chooses one of N equally likely labels, with replacement. Predict the chance of any repeated label and the chance of seeing all N labels after t draws. Can one be large while the other is zero?

No probabilities revealed. Predict before revealing.

Try N = 3 with t = 2, 3 and 4. Explain why complete collection is impossible at two draws, why its probability at three draws is 2/9, and why a collision is certain by four draws. This temporary experiment does not award mastery.

Labels already seen kUnseen labelsSuccess probabilityExpected additional draws in this stage
0411
133/44/3
221/22
311/44

Understand

First justify the waiting-time formula. Let G be the number of independent trials through the first success, with constant success probability p satisfying 0<p≤1. For a positive integer M, the number min(G,M) equals the sum of the indicators of G>0, G>1, …, G>M−1. If G=3, exactly the first three of these indicators are one, provided M≥3. Taking expectations and increasing M gives the tail-sum formula E[G]=Σ from t=0 to infinity P(G>t). The limiting step is justified by monotone convergence of nonnegative quantities, not by rearranging terms with mixed signs.

The event G>t means the first t trials all fail. Independence gives probability (1−p)^t, so its geometric series sums to E[G]=1/p. The t=0 term is one because no trials have occurred. When p=1, G=1 deterministically and every later tail term is zero.

Now take a positive integer N of equally likely labels. Let Wₖ count draws from the moment k distinct labels have appeared through the next new label, for k=0,…,N−1. Conditional on any history reaching that stage, the unseen set has N−k members and future draws remain iid uniform. Until the stage succeeds that set is unchanged. Thus Wₖ has success probability (N−k)/N and mean N/(N−k). This reasoning is about future draws after the actual history, not merely the initial draw.

Path by path, the completion time T equals W₀+…+W_(N−1). Therefore linearity of expectation gives

E[T] = N(1/N + 1/(N−1) + … + 1) = N H_N.

Linearity does not require a proof that the stage durations are independent. Independent sampling was used to establish the geometric waits; it should not be confused with an extra independence requirement for adding their means. Each stage with positive success probability ends almost surely, so the finitely many stages and their finite expectations are well defined.

For a deadline, let Aᵢ be the event that label i is absent after t draws, where t is a nonnegative integer. Collection has failed exactly when at least one Aᵢ occurs. Each has probability (1−1/N)^t. The union bound gives

P(T>t) ≤ N(1−1/N)^t ≤ N exp(−t/N).

The last inequality follows from 1−u≤exp(−u). Missing-label events need not be independent for the union bound. For N=1, handle the empty-draw boundary directly: T=1, so survival probability is one at t=0 and zero for integer t≥1. In the product formula the zero-draw probability always means one, without asking a calculator to interpret 0⁰. A bound above one can simply be replaced by one.

For deeper finite checking, define qₜ(k) as the probability of k distinct labels after t draws. Initially q₀(0)=1. For 0≤k≤N,

q_(t+1)(k) = (k/N)qₜ(k) + ((N−k+1)/N)qₜ(k−1),

with entries outside 0,…,N set to zero. The first contribution repeats an already seen label; the second arrives from k−1 by a new label. The complete state remains complete. Thus qₜ(N)=P(T≤t), giving an exact finite recurrence for a small case. This is optional distributional depth, not an assumption needed for the expectation proof.

Apply

For four labels, use the exponential bound to guarantee failure probability at most 0.05. Solve 4exp(−t/4)≤0.05, obtaining t≥4ln80, approximately 17.5281. Thus t=18 is sufficient. It is not claimed to be the smallest qualifying deadline: the union bound and exponential replacement can both lose precision. Check that the expected time 25/3 is a different number for a different reason.

Now change the sampling mechanism. For two labels with probabilities 1/3 and 2/3, the first draw takes one packet. If it is the first label, the remaining mean wait is 3/2; if it is the second, the remaining mean wait is 3. Conditioning gives E[T]=1+(1/3)(3/2)+(2/3)3=7/2. Merely knowing “one label collected” no longer specifies the success probability; its identity matters.

If every label has positive probability, a general missing-label bound is Σᵢ(1−pᵢ)^t, which is at most N exp(−p_min t), with p_min the smallest label probability. It tends to zero and has a summable geometric tail, proving almost-sure completion and finite expectation. If a required label has probability zero, completion is impossible almost surely. Changing the sampling assumptions requires changing the calculation, not just substituting a new N.

Continue

Use the written tasks to derive a remaining-stage expectation, compute a small completion distribution and distinguish conservative deadline certificates from actual minima. Return to geometric trial mechanisms for the waiting-time convention, or to harmonic sum bounds to estimate N H_N for large N. Neither an average nor a successful finite experiment supplies a guaranteed deadline; state the probability and the assumptions alongside any operational recommendation.

Apply · explain · revise

Practice and reasoning

Drafts save locally as you type. Reveal worked solutions when useful; the site remembers that exposure. Automatic matches check the requested answer, while written arguments require review against the rubric.

Each independent draw is uniform on six labels, with replacement. Starting empty, derive the expected total draws to collect all six. If exactly four distinct labels have already been seen, derive the expected additional draws, conditional on the entire observed history. Explain why adding stage means does not require an independence proof for the stage waiting times.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For independent trials with success probability 0<p≤1, let G count trials through the first success. Prove E[G]=Σ from t=0 to infinity P(G>t)=1/p. Explain the finite indicator identity behind the tail-sum formula and handle p=1. Then identify the error in assigning success probability 1/N at every coupon-collection stage.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Let qₜ(k) be the probability that exactly k distinct labels have appeared after t iid uniform draws from three labels. Derive the one-step recurrence and initial/boundary values. Use it or an independently justified inclusion-exclusion count to calculate P(T≤4) and P(T≤5). Does E[T]=11/2 mean completion by draw6 is certain?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For five iid uniform labels, derive an upper bound on P(T>t) using missing-label events. Find a sufficient integer t for failure probability at most0.1 using (i) 5(4/5)^t and (ii) 5exp(−t/5). Use ln50≈3.912023 and ln(5/4)≈0.223144. Explain why neither certificate determines the actual least such deadline, and what a bound above1 means.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Two labels A and B are drawn independently with probabilities1/4 and3/4. Derive E[T] by conditioning on the first label and compare it with the uniform two-label value. Explain why knowing only the number of seen labels no longer determines the next-stage success probability. What happens if one required label has probability0?

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

For N=1, specify T, E[T] and P(T>t) for every integer t≥0 without relying on an ambiguous 0^0 expression. For general finite N with iid label probabilities pᵢ>0 summing to1, prove P(T>t)≤Σᵢ(1−pᵢ)^t≤Nexp(−p_min t), where p_min=minᵢpᵢ. Prove completion occurs almost surely and has finite expectation; do not use the uniform formula NH_N.

Structure your argument and preserve revisions

These optional planning fields save locally. Recording your response saves an immutable copy of the argument and these fields. Older records may contain only first/latest responses; missing intermediate revisions are not reconstructed.

Each field allows 2,000 characters. Keep a specific claim, state where it applies, cite the facts you use, and explain what still needs checking. Blank fields are allowed and are not evidence of mastery.

Reflect and continue

Before marking this lesson complete, explain one key idea without the worked solution and identify a condition that matters. Marking complete records participation, not independent mastery.