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$
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, 1, 1), (1, 1, 2), (1, 2, 1), ..., (2, 2, 2)}. Fixing the first two terms to be1has 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 than1.00in my simulation). – hioqobipb May 06 '24 at 18:23