2

We are doing a Bernoulli trial unlimited number of times with probability of success $p=0.4$. What is the probability we get $3$ consecutive successes before we get $3$ consecutive failures?

I've used Conditional probability:

  • Let $W$ be the event: "we got $3$ consecutive success before $3$ consecutive failures"
  • Let $S$ be the event: "we succeed in the first trial".
  • Let $F$ be the event: "we failed in the first trial".

Then $$P(W) = P(W\mid S) \cdot P(S)+P(W\mid F) \cdot P(F)=P(W\mid S) \cdot \frac25+P(W\mid F)\cdot\frac35$$ To calculate $P(W\mid S)$, let $E$ be the event: $$=\text{ "at the 2nd and 3rd trials we succeed"}$$Then $$P(W\mid S)= P(W\mid SE) \times P(E\mid S)+P(W\mid SE^{c}) \times P(E^{c}|S)= 1 \times 0.16 + P(W\mid F) \times 0.36$$

Now, we calculate $P(W\mid F)$= $$P(W\mid FE) \cdot P(E\mid F)+P(W\mid FE^c) \cdot P(E^c\mid F)$$

what is $P(W\mid FE)=?$

Talor T
  • 245
  • "trail" is "trial" ? – leonbloy Mar 29 '16 at 11:13
  • yeah. fixed @leonbloy – Talor T Mar 29 '16 at 11:16
  • I doubt that this approach can work (you are concentrating on the first three trials only). See here http://math.stackexchange.com/a/1617703/312 – leonbloy Mar 29 '16 at 11:21
  • Do you know Markov Chains? – Jimmy R. Mar 29 '16 at 11:24
  • @JimmyR. not yet – Talor T Mar 29 '16 at 11:25
  • This really looks like a Markov Chain problem...trying to write down all the (infinitely many) possible paths seems difficult and error prone. Maybe you haven't used that particular term...have you done problems with States instead? That language might be easier. – lulu Mar 29 '16 at 11:31
  • @JimmyR. it similar to this http://math.stackexchange.com/questions/716640/we-doing-bernoulli-experiment-unlimited-times?rq=1 – Talor T Mar 29 '16 at 11:36
  • Yes, also @leonbloy link works for you nicely – Jimmy R. Mar 29 '16 at 11:42
  • @TalorT In your link the successes and failures must not be in a row. Therefore the problem is different from yours. – callculus42 Mar 29 '16 at 11:43
  • @TalorT It really isn't similar to that problem. In that problem you just needed $2$ wins before $2$ fails. Here you are requiring that the strings are consecutive. In particular, the earlier problem has to end in at most $3$ tries. Your game can go on as long as you like. – lulu Mar 29 '16 at 11:43

2 Answers2

0

Let $\phi$ be the answer you seek.

Just for notation we'll imagine that this game is a weighted coin toss, with $H$ denoting success. And, as is standard, we'll denote $q=1-p$. Of course $q=.6$ here, but we'll work in general.

At any point in the game, the only thing that matters is the running string. That is, if you have followed the path $HHTHTTHTT$ then the only thing that matters is that you have two Tails in a row (so can end the game if you get $T$ on the next toss). Thus, other than Start and End, there are $4$ states of the game. $H,T,HH,TT$. If $S$ is a state let $\phi_S$ denote the probability of winning given that we are in state $S$.

Consider the first toss. It moves us from Start to either $H$ or $T$. Accordingly we see that $$\phi= p\phi_H+q\phi_T$$

Similarly we get $$\phi_H=p\phi_{HH}+q\phi_T$$

$$\phi_T=p\phi_{H}+q\phi_{TT}$$

$$\phi_{HH}=p*1+q\phi_T=p+q\phi_T$$

$$\phi_{TT}=p\phi_{H}+q*0=p\phi_H$$

Thus we have $5$ equations in $5$ variables. It is tedious but not difficult to see that this eventually gives us $$\phi=\frac {p^3+p^2(p+qp)}{1-pq(p+qp)-q(p+qp)}$$

For $p=.4$ this gives $\phi\sim.27128$

Sanity Check: for $p=.5$ this gives $\phi=.5$ as it should. Also it gives $1$ if $p=1$ and $0$ if $p=0$. Of course, the above calculation is at risk for algebraic error and should be checked.

lulu
  • 70,402
  • I get 104/289 and not 392/1445 – Talor T Mar 29 '16 at 13:50
  • @TalorT Can you post your solution (either as part of your question or as another posted answer)? The method you sketched in the question does not make sense or, at least, I could not follow it. – lulu Mar 29 '16 at 13:53
  • @TalorT I note that my solution gives the same value as the solution of leonbloy. That isn't proof that we are right, of course, but it is evidence. – lulu Mar 29 '16 at 13:55
  • I just edited me question @lulu – Talor T Mar 29 '16 at 14:06
  • I don't understand the edit. You seem to be focussed on the first few trials. That makes sense for the question you linked to, but it doesn't make sense for this one. The game in the linked question can (at worst) go on for $3$ moves. The game you describe can go on for dozens, hundreds, thousands, etc. of moves. Infinitely many paths. Now, maybe you can describe those in such a way as to let you sum up the infinite series. But A. I'm not sure about that. B. It sounds like a ton of very error prone work and C. it really isn't necessary. – lulu Mar 29 '16 at 14:11
  • unlimited number of times is not a issue. We just need to calculate the probability we get 3 consecutive successes before we get 3 consecutive failures @lulu – Talor T Mar 29 '16 at 14:15
  • Yes, I know that. But your method only looks at the first few moves. How do you plan to cope with a path like $HTTHTHHTHHTTHHTHTHTTT$ – lulu Mar 29 '16 at 14:24
0

Let G be the event "a single failure has just happened". Let $E$ be the desired event. Now, there are three possible scenarios, which we label with $S$: $S=0 \implies$ we fail in the first try (two consecutive failures happen next); $S=1 \implies$ we succeed in the first try; $S=2\implies $ we get less that three fails and less than three successes, so we restart over.

$$P(E\mid G) = \\ P(E \mid G,S=0) P(S=0\mid G)+\\ P(E \mid G,S=1) P(S=1\mid G)+P(E \mid G,S=2) P(S=2\mid G)=\\ 0\times q^2+1\times p^3(1+q)+P(E \mid G)(1-q^2-p^3(1+q))$$

Plugging $q=1-p$, this gives

$$P(E\mid G)=\frac{\left( p-2\right) {{p}^{3}}}{{{p}^{4}}-2 {{p}^{3}}-{{p}^{2}}+2 p-1}$$

Now: $$P(E)=p^3+(1-p^3)P(E\mid G)=-\frac{{{p}^{3}} \left( {{p}^{2}}-3 p+3\right) }{{{p}^{4}}-2{{p}^{3}}-{{p}^{2}}+2 p-1}$$

An alternative way (it gives the same result) is here

leonbloy
  • 63,430