0

In the original coupon collector's problem, the expected time until all $n$ coupons are collected when uniformly drawn is:

$$n\sum_{k=1}^n\frac1k$$

What is the expected time until all tuples of size $x$ are seen when each element of the tuple is uniformly drawn and the cardinality of each element of $x$ is $n$?

For example, when $x = 3$ and $n = 9$, I want to obtain each of these tuples at least once:

(0, 0, 0)
(0, 0, 1)
(0, 0, 2)
(0, 0, 3)
(0, 0, 4)
(0, 0, 5)
(0, 0, 6)
(0, 0, 7)
(0, 0, 8)
(0, 1, 0)
(0, 1, 1)
...

(8, 8, 7) (8, 8, 8)

The order of elements matter.

Note that this is the original coupon collector's problem when $x = 1$.

In pseudocode for $x = 3$ and $n = 9$:

function sample:
    remaining_coupons = {(1, 1, 1), (1, 1, 2), ..., (9, 9, 9)}
time = 0
while remaining_coupons not empty:
    x1 = random integer between 1 and 9 inclusive
    x2 = random integer between 1 and 9 inclusive
    x3 = random integer between 1 and 9 inclusive

    drawn_coupon = (x1, x2, x3)
    remove drawn_coupon from remaining_coupons

    time++

return time

do sample() 1,000,000 times and return avg(time)

where I want $Expected(time)$ as a function of $x$ and $n$

Try it online!

Above is the simulation code. The coupon collector's problem conssitently gets around 1.00 (which is expected), but my extension gets closer to 1.30 (that is, the expected time is higher than what we would expect from using $n^x$.

1 Answers1

0

This is the same as the coupon collector's problem over a universe of size $n^x$, so just apply the formula you already know with $n^x$ instead of $n$ and you're good to go.

D.W.
  • 5,958
  • I do not think this is correct. I have updated my post with the simulation code. The coupon collector's problem conssitently gets around 1.00 (which is expected), but my extension gets closer to 1.30 (that is, the expected time is higher than what we would expect from using $n^x$) – hioqobipb May 06 '24 at 16:37
  • @hioqobipb, I'd guess there is something wrong with your simulation. Why don't you try to work it out for $n=2,x=2$ and see what you can come up with? I have no idea what 1.00 vs 1.30 means. – D.W. May 06 '24 at 16:44
  • Suppose $n = 2^3 = 8$ in the original coupon collector's problem and $n =2, x = 3$ in my extension. There are 8 coupons in my extension: {(1, 1, 1), (1, 1, 2), (1, 2, 1), ..., (2, 2, 2)}. Fixing the first two terms to be 1 has a 25% probability ((1, 1, x)). In the original problem, it has 100% certainty ($1/8$ for each tuple). This explains why my extension has a higher expected time (greater than 1.00 in my simulation). – hioqobipb May 06 '24 at 18:23
  • @hioqobipb, I don't understand what you are saying. I don't understand what you mean by 100% certainty in the original formulation; that seems like a misunderstanding or erroneous statement on your part. The probability that you pick a token of the form (1,1,z) out of the set {(1,1,1),...,(2,2,2)} is 0.25, not 1.00, as 2 out of the 8 possibilities have that form, and 2/8=0.25. Also I suggest that you pick $x=2$ instead of $x=3$ to simplify discussion and thinking about things. – D.W. May 06 '24 at 18:52