Calculate probability that I have fully sampled a set Let's say I have a set of items out of which I  randomly take 5% . Then perform some action on these items and put them back in the set.
After how many repetitions of this process can I be 95% sure that I have performed this action on all the items.
For illustrative purposes -- Let's say I take 5 ping-pong balls blindly out from a sack where there are originally 100 white balls. I paint/repaint those I have taken red and put them back in the sack. After how many tries can I be 95% sure that all the balls in sack are now red.
What would the general form for the calculation be for other sample sizes and probabilities. (10% of balls and 75% chance etc.)

If you are interested in a numerical result, using simulations in R
n=100
k=5
p=0.95

res=replicate(1e5,{
  x=rep(0,n)
  i=0
  while (TRUE) {
    x[sample(1:n,k,replace=F)]=1
    i=i+1
    if (all(x==1)) {
      break
    }
  }
  i
})

quantile(res,p)

95% 
148 

