medium · Coupon collector and occupancy problems
A market-data feed emits ticks. Each tick carries exactly one of distinct symbols, and the symbols are independent across ticks, each equally likely (). Let be the number of ticks until every one of the symbols has appeared at least once.
Show that , where . Set up the decomposition you use carefully.
Using the same decomposition, find in closed form and give its leading asymptotic as . Comment on the ratio of the standard deviation to the mean. Evaluate the mean, variance, and standard deviation for a fair die ().
Suppose that at some moment you have observed exactly distinct symbols (with ). Find the expected number of additional ticks needed to complete the set, and explain why this expectation does not depend on which symbols you already hold. Evaluate it for .
Write , where is the number of ticks needed to go from distinct symbols to distinct symbols. Once you already hold symbols, each new tick is a new symbol with probability
and a repeat otherwise, independently of the past (the ticks are i.i.d. and only the count matters, not which symbols). Hence is geometric on with success probability .
The point a candidate can miss: the segments are mutually independent. After each success the process restarts as a fresh sequence of i.i.d. Bernoulli trials whose length is unaffected by how long the previous segment took (memorylessness of the geometric plus i.i.d. draws). This independence is what makes the variance a plain sum.
A geometric variable has mean , so
Substituting (so runs to ),
For : , so .
By independence, . A geometric variable has variance . With we have and , so
Summing and substituting again,
Thus the closed form is
Since and , the leading term is
So the standard deviation is , of order , while the mean is of order . The ratio : concentrates around , and the tail beyond the mean is dominated by the long wait for the single last symbol (that segment alone contributes variance ).
For : , so
Given that exactly symbols have been seen, the future is again a fresh collector problem: the remaining waits are the independent geometrics with success probabilities . Hence
It depends only on how many symbols remain, , not on their identities: by symmetry every unseen symbol is drawn with the same probability per tick, so relabelling the missing symbols changes nothing. For (two symbols missing):
Closing note. The tempting error is to treat the as merely uncorrelated, or worse to try computing directly — the whole simplification rests on the independence of the segments, which is genuinely true here. As a cross-check on Part 1, one can also use together with the inclusion–exclusion occupancy formula ; summing the geometric series in collapses back to .
medium · The bootstrap: validity and failure modes
Let be i.i.d. from the Uniform distribution, unknown. Write , the maximum likelihood estimator of . Assume throughout that the are almost surely distinct.
1. Show that the exact sampling distribution of the normalized error satisfies
2. Now form the ordinary (full-sample) nonparametric bootstrap: conditionally on the data, draw i.i.d. from the empirical distribution on , let , and let be the bootstrap analogue of . Compute the conditional probability exactly and give its limit. Deduce that the bootstrap law of cannot converge to , and identify the precise obstruction.
3. Consider instead the -out-of- bootstrap: draw i.i.d. from the empirical distribution, with and . With and , show that the offending atom disappears and that the conditional law of recovers in probability.
For , using on and independence, This for every fixed , so . The limit is continuous: . Keep that fact; it is what the bootstrap will violate.
Conditionally on the data, each equals the maximizing observation with probability . The bootstrap maximum equals iff that observation is drawn at least once, so Whenever we have . Hence the bootstrap law of carries a point mass at whose size tends to .
This is the decisive observation. The Kolmogorov distance between the bootstrap CDF and the target satisfies because is continuous with . So the bootstrap is inconsistent: no matter the realization of the data, its law stays a fixed distance from .
The deeper reason (worth seeing). Compute the whole conditional survival function. With , The window has width , so it contains only a bounded number of order statistics; in fact converge jointly to the arrival times of a rate- Poisson process, and , the count of that process on (with once the max is inside). Therefore a random limiting survival function. Consistency (Bickel–Freedman) requires the conditional law to converge to the fixed ; here it converges to a random measure. The atom -mass is just the visible symptom. The general lesson: the bootstrap fails exactly when the statistic depends on the extreme tail of the empirical measure, where resampling cannot manufacture the missing continuum.
Repeat the atom computation with draws: since . The atom vanishes.
For the full law, iff all resampled points fall in . Now the window has width , which is large compared with the spacing since . So the empirical measure of the window is accurate: by Glivenko–Cantelli and , Hence The subsampling ratio is exactly the condition that (i) kills the atom and (ii) makes the relevant window wide enough for the empirical CDF to be trustworthy. With and the -out-of- bootstrap is consistent.
Tempting wrong answer: concluding the bootstrap works because and . Consistency of the point estimate says nothing about consistency of the distribution of the normalized error; the -scale behavior at the boundary is where everything happens, and that scale is precisely what a full-sample resample cannot reproduce.
Two new problems every morning at 8am · every day so far