As part of a simulation that I'm working on, I have a probability distribution over $n$ elements, from which I have to sample a set $S$ of size $m$. That is, each element $e \in S$ must be unique .
Conceptually I have the following piece of code:
while(S.size < m) getNextSampleFromDistribution();
If an element already exists in the set $S$, I just fetch another sample. That is, I keep repeatedly sampling from the distribution, until the set is populated with $m$ elements.
In expectation, how many times is
getNextSampleFromDistribution() called? How can I compute that?
Someone suggested that the arrival of the next valid sample, can be modeled as a Poisson process with the wait times between them being exponential and thus this can be categorized as an exponential distribution where $E[calls \space to \space getNext...] = 1/\lambda$. If true, then what is $\lambda$ in this case? If not, then how best to come up with a strong theoretical expectation value explaining this?
For a simulation that I ran for generating a set of 500 elements from a probability distribution over 1000 number, the while loop ran close to $20,000$ times in some instances!
 - this is redundant if I say 'set' but still making it clear if someone overlooks that :)