Consider $n$ objects each with an associated probability $p_i$, $i\in\{1,\dots,n\}$. If I sample objects $k$ times independently with replacement according to the probability distribution defined by the $p_i$, how does one compute the expected number of times you sample an object you have sampled before?
We can assume that $n > k$.
Let $X_i = 1$ if the $i$th number sampled has already been sampled before, and $X_i = 0$ otherwise. Then we are looking for $E(X_1 + \cdots + X_k) = E(X_1) + \cdots E(X_k)$. Now, $E(X_1) = 0$, since $X_1 \equiv 0$. If $i > 0$, $$ P(X_i = 0) = \sum_{j = 1}^n\underset{\substack{\text{not choosing item $j$}\\\text{on the first $i-1$ times}}}{\underbrace{(1 - p_j)^{i-1}}}\underset{\substack{\text{choosing item $j$}\\\text{on the $i$th time}}}{\underbrace{p_j}}. $$ Therefore $E(X_i) = 1 - \sum_{j = 1}^n(1 - p_j)^{i-1}p_j$.
Summing up, we find that $$ \begin{align} E(X_1) + \cdots + E(X_k) &= E(X_2) + \cdots + E(X_k) \\ &= k - 1 - \sum_{i = 2}^k \sum_{j = 1}^n (1-p_j)^{i-1}p_j \\ &= k - \sum_{i = 1}^k \sum_{j = 1}^n (1-p_j)^{i-1}p_j \\ &= k - \sum_{j = 1}^n p_j \sum_{i = 0}^{k-1} (1-p_j)^i \\ &= k - \sum_{j = 1}^n p_j \frac{1 - (1-p_j)^k}{1-(1-p_j)} \\ &= k - n + \sum_{j = 1}^n (1-p_j)^k \end{align} $$