# calculate probability with bernoulli trials

I have independent bernoulli trials with probability of success $p=\dfrac{1}{4}$. I want to calculate the probability the second and the third time that i will have success to be at 8 and 9 trial. How can i write the probability that i want to find? $X_i= 1$ or $0$ ($1$ for success $0$ for failure) $X_1,X_2,X_3,X_4,X_5,X_6,X_7,X_8=1,X_9=1.$ $N_1=X_1, N_2=X_1+X_2,N_3=X_1+X_2+X_3$ So $N_8=2,N_9=3,$ $T_1=?$ $T_2=8,T_3=9,$ $T_i:$ means the time that the I had the i-success

• So you want to have exactly one success within the first seven trial, then two successes. – Zubzub Apr 7 '17 at 8:52

Be $N_k$ your succes count, i.e. the number of successes at $k$th trial. You want to find $P(N_7=1,N_8=2,N_9=3)$ because you want exactely one success between trial $1$ and $7$. $$P(N_7=1,N_8=2,N_9=3)=P(N_7=1)P(N_8=2|N_7=1)P(N_9=3|N_8=2,N_7=1)$$ but $P(N_8=2|N_7=1)$ is equal to $P(X_8=1)=p$ and $P(N_9=3|N_8=2,N_7=1)$ is equal to $P(X_9=1)=p$, because you know that you already had successes and you just want one more.
Finally just mix everything and use the binomial distribution for $P(N_7=1)$. $$P(N_7=1,N_8=2,N_9=3)=\binom{7}{1}p(1-p)^6 \cdot p \cdot p=\binom{7}{1}p^3(1-p)^6=0.0195=19.5\%$$
As I said in the comment, you first want to have exactly one success among the $7$ first trials. This gives a binomial distribution probability : $$A = Pr[\text{1 success within the first 7}] = \binom{7}{1} p^{1}(1-p)^6$$ Then two consecutive success : $$B = Pr[\text{two consecutive successes}] = p^2$$ Finally you have $A\cdot B$