Consider a following problem:
Suppose, a random bit generator of type $p$ was brought to a random bit generator repair station. Before starting repairing it, the workers from the repair station were completely unsure, whether it is really broken, decided to check that it is really broken by launching it several times. They know, that random bit generators of type $p$ output $1$ with probability $p$ and $0$ otherwise, independently every time they are launched. However, when such random bit generators are broken, they always output $1$. After launching the generator $t$ times and receiving only $1$ the workers concluded that it is most likely broken (with probability of it functioning correctly being less than $\epsilon$). What is the least possible value of $t$?
Suppose the prior probability of the generator being broken is $q$. Then it was launched and returned $1$. The conditional probability of that outcome was $1$ if the generator was indeed broken, and the total probability of this output was $q + (1-q)p = p + (1-p)q$. Then the posterior probability of it being broken is $\frac{q}{p + (1-p)q} = \frac{1}{1-p}(1 - \frac{p}{p + (1-p)q}$).
Now, as initially the workers were completely unsure, with prior probability being uniform, the posterior probability of it being broken $q_n$ after $n$ trials will satisfy the recurrent relation:
$$q_0 = \frac{1}{2}$$ $$q_{n+1} = \frac{1}{1-p}(1 - \frac{p}{p + (1-p)q_n})$$
Now all that remained is to find the minimal $n$ for which $q_n > 1 - \epsilon$.
The alternative task can be further "prettified" by rewriting it in terms of $y_n = (1-p)p_n$:
Suppose the sequence $y_n$ is defined by a recurrence: $$y_0 = \frac{1-p}{2}$$ $$y_{n+1} = 1 - \frac{p}{p + y_n}$$ Find $\min\{t|y_t \geq (1-p)(1-\epsilon)\}$.
All that remains now is to find the closed form of $y_n$ and derive $t$ from it. But, unfortunately, I do not know how.
Sketch for the solution: you can linearize the recursion noticing that $$ q_{n+1}=\frac{q_n}{p+(1-p)q_n}=\frac1{\frac{p}{q_n}+1-p}\\ \therefore\quad \frac1{q_{n+1}}=\frac{p}{q_n}+1-p\implies r_{n+1}=r_np+(1-p)p $$ for $r_n:=p/q_n$.
P.S.: sorry I'm too lazy to write a full answer :)