I was thinking about a problem.
Lets say you have a dice with $N$ faces numbered from $1$ to $N$.
We begin with an empty set $S=\emptyset$
After each roll, we insert the number that turns up into the set $S$.
What is the expected number of rolls so that the size of set becomes $K$.
My Approach:
Let $f(x,y)$ be the expected number of rolls to select $x$ more distinct numbers when we already have selected $y$ distinct numbers.
$f(K,0)$ is the answer.
Its easy to see that $$f(x,y)=\left(\frac{y}{N}(1+f(x,y)\right) + \left(\frac{N-y}{N}(1+f(x-1,y+1)\right)$$
Doubt:
I know my approach will work, but I am having difficulty in finding the solution using Linearity of Expectation here.
I understand that the probability to select the $(n+1)^{th}$ distinct number will be $\frac{N-n}{N}$.
But why will the answer be $\sum_{n=1}^{K}\frac{N}{N-n}$?
If $K=1$, the answer would be just $1$.
If $K=2$, the first attempt would grow the set size to $1$. To get another increment, we need to avoid the same number as the number in the set, which is a geometric distribution with probability $\frac{N-1}{N}$, the expectation is $\frac{N}{N-1}$. Hence, $\sum_{n=\color{red}0}^\color{red}{2-1} \frac{N}{N-n}$.
In general, suppose the existing set already has $k-1$ elements, to get another increment, we need to avoid the same numbers in the set, which is a geometric distribution with probability $\frac{N-K}{N}$, the expectation is $\frac{N}{N-K}$. Including the previous attempt, the total would be $$\sum_{n=0}^{K-1} \frac{N}{N-n}$$