I have a specific task in programming but I am curious about how long it will take to complete.

I have an array "A" with 1000 unique numbers inside.

For each iteration I am copying 30 randomly picked numbers from array "A" to array "B".

Duplicate numbers(which already exists in array "B") are not copied

Question is: how many iterations do I need to claim with a certain probability, that all numbers are copied from "A" to "B"

Thanks

• do you pick 30 numbers randomly? Aug 12, 2015 at 18:37
• yes, sorry I will add it to the question Aug 12, 2015 at 18:37
• is this a home work? you better show what you've done so far to solve the problem. it's an easy quiz type of question. Aug 12, 2015 at 18:39
• No it's not a homework, that is why I have no idea of where to start to solve it. I have only conditions :) Aug 12, 2015 at 18:41
• I simplified the conditions, in reality each iteration takes about 2 minutes for now. I want to know how long it will take or how much I should decrease iteration duration Aug 12, 2015 at 18:43

One way to answer your question is to answer a similar question: what is the probability that any given number in A was not picked after $N$ iterations?
The answer to this question is: $P=(1-\frac{30}{1000})^N$
Then the answer to your original question is $\frac{\ln (1-p)}{\ln(1-\frac{30}{1000})}$, where $p=1-P$ is your certain probability.