I would appreciate your help in the following scenario. I flip a coin and the following events happened:
3 Wins, 1 loss
3 Wins, 2 losses
5 Wins, 2 losses
1 Win, 1 loss
4 Wins, 2 losses
1 Win, 1 loss
4 Wins, 1 loss
5 wins, 1 loss
4 wins
The wins and losses displayed are consecutive. The wins are 30 and the losses are 11 before I stopped. However what about the chances of the consecutive winnings happening? Now I do understand how to calculate one string of consecutive wins of course but I would really appreciate it if I would have the formula for the odds for winning as a whole.
Thank you thank you
I think you are asking about the distribution of largest number of wins in a row, for $n$ coin tosses. Suppose, we tossed the coin (with the probability of win being $p$) $n$ times and the largest number of consecutive wins is $k$). If $k > n$, then it is not possible. If $k = n$, then, the probability, of that (let's denote it as $P_n^k(p)$) is equal to $p^k$. If $k < n$, then two cases are possible:
1) $n$ consecutive wins were made before the last coin toss. The probability of that is $P_{n - 1}^k(p)$. However, if those tosses where from $n - k$-th to $n - 1$-th, and the last coin toss was also a win, then we get $k + 1$ consecutive vins, and we do not want that now. So, the final probability of this case is $P_{n - 1}^k(p) - p^{k + 1}$
2) The last toss was one of those wins. That means, that there were $n$ last tosses were wins, and the probability of that is $p^k$
However, those cases do intersect. The situations belonging to those cases can be described the following way: $n - k - 1$ first coin tosses had $k$ as the largest number of wins in a row, $(n - k)$-th toss is a loss and all further tosses are wins. The probability of that case is $P_{n - k - 1}^k(p)(1 - p)p^k$.
So, finally, we get a recurrence relation $P_n^k(p) = P_{n - 1}^k(p) + (1 - P_{n - k - 1}^k(p))(1 - p)p^k$.
Thus, the answer is $P_n^k(p) = \begin{cases} 0 & \quad \text{if } k > n\\ p^k & \quad \text{if }k = n \\ P_n^k(p) = P_{n - 1}^k(p) + (1 - P_{n - k - 1}^k(p))(1 - p)p^k & \quad \text{if }k < n \end{cases}$