a collection of 20 marbles from infinite pool of 2 color marbles with replacement.. I have an infinite supply of pink  and blue marbles. Probability that any random draw will yield a  pink marble is "p" and prob. of picking blue is 1-p. Let us assume p=0.4 if a numeric value helps.
I have to first keep drawing till I collect a total of 20 marbles. I then have to see if this collection has >= 12 pink marbles. I make a note if this is true or not. I then randomly discard one of 20 marbles in my collection and draw one more fresh marble. I then do my inspection again to see if I have >= 12 pink marbles. I repeat this "inspect, note_result, discard, replenish" cycle a total of 100 times. What is the probability that after 100 cycles I will have encountered at least once a situation that I have >= 12 pink marbles in my side collection? (I can stop once I encounter this condition, or stop after a total of 100 inspections, which ever happens first. What is the probability that I will stop due to having found >= 12 pink marbles?)
I recognize that prob. of finding 12 or more pink marbles give p=0.4 is 0.056526367. I also know that if I discard all 20 marbles and start again, and repeat this 5 times for a total of 100 marbles drawn, prob. that in none of the 5 such tests I will find >=12 pink marbles is (1-0.056526367)**5. However, since I don't discard all the marbles and do replacement one at a time, I believe odds will be higher that I will encounter a condition of having >=12 pink marbles in my side collection. However, I am at a loss as how to compute this value.
 A: If I understand this question correctly and using the stopping condition given as 

(I can stop once I encounter this condition, or stop after a total of 100 inspections, which ever happens first. What is the probability that I will stop due to having found >= 12 pink marbles?)

then, wouldn't this piecewise recurrence yield the solution


*

*when $m < 11$
$$p_{(k,m)} = p_{(k-1,m-1)} \frac{20 - (m-1)}{20}p_{s} + p_{(k-1,m+1)}\frac{m+1}{20}(1-p_{s}) + p_{(k-1,m)}\frac{m}{20}p_{s}
 + p_{(k-1,m)}\frac{20-m}{20}(1-p_{s})
$$

*when $m = 11$
$$p_{(k,m)} = p_{(k-1,m-1)} \frac{20 - (m-1)}{20}p_{s} + p_{(k-1,m)}\frac{m}{20}p_{s}
 + p_{(k-1,m)}\frac{20-m}{20}(1-p_{s})
$$

*when $m = 12$


$$p_{(k,m)} = p_{(k-1,m-1)} \frac{20 - (m-1)}{20}p_{s}$$
where $p_{s}$ is the probability of choosing a pink marble (0.4 as the example in the question), $p_{k,m}$ is the probability that on the $k^{th}$ "cycle" there are $m$ pink marbles present, where $m \leq 12$. The initial conditions are for $k = 0$, where $p_{0,m}$ can be found readily.
Thus, the probability that we have exactly $m$ pink marbles in cycle $k$ requires us to come from having


*

*$m-1$ pink marbles in cycle $k-1$ (probability of this is $p_{(k-1,m-1)}$), then discarding a blue marble (probability $\frac{20 - (m-1)}{20}$), and then drawing a pink marble (probability $p_{s}$); or

*$m+1$ pink marbles in cycle $k-1$, then discarding a pink marble, and then drawing a blue marble (second term); or

*$m$ pink marbles in cycle $k-1$, then discarding a pink marble, and then drawing a pink marble (third term)

*$m$ pink marbles in cycle $k-1$, then discarding a blue marble, and then drawing a blue marble (fourth term)


In the cases where $m < 0$, $p_{k,m} = 0$ since it is not possible to have a negative count of pink marbles.
We are interested in computing $p_{k,12}$ for $1 \leq k \leq 100$.
Thus, and for example, $$p_{(1,12)} = \frac{9}{20}p_{(0,11)}p_{s}$$ since the only way to finish with 12 pink marbles on the first cycle is to have 11 pink marbles on the zeroth cycle, then to discard a blue marble (with probability $\frac{9}{20}$) and to replace it with a pink marble (with probability $p_{s}$).
It wasn't clear if the first cycle was forced regardless of the pink marble count on the zeroth cycle (initial draw of twenty marbles). I assumed it wasn't forced and the stopping condition would kick in.
Then I think the matter of seeing 12 or more pink marbles at least once should be readily answerable --- it ought to be $\sum_{k=1}^{100} p_{k,12}$. The "or more" is superfluous for $k >= 1$ since if we started with 12 or more, we would never proceed to the next cycle. 
