Suppose a coin is flipped 10 times and the outcomes are recorded. Find the probability that any tails occur only in consecutive pairs. For example, with 4 flips, TTHH and HHHH are both valid, but HTHH and TTTH are not valid. I know that I'm supposed to use inclusion-exclusion principle, but I'm not sure how to go about it.
-
See this article for an introduction to Inclusion-Exclusion. Then, see this answer for an explanation of and justification for the Inclusion-Exclusion formula. – user2661923 Sep 30 '23 at 23:57
-
Can you clarify whether $TTTT$ is valid? In other words, as long as there are an even number of tails can they be consecutive? – M W Oct 01 '23 at 08:50
-
The posted solutions look complete, but as another approach: Note that a good string, other than $T^{2k}$, must begin with one of $H, T^2H, T^4H, \cdots$ and then be followed by a shorter good string. In this way you can get a recursion for number of good strings of a given length. – lulu Jul 29 '24 at 12:45
3 Answers
Why not just add up sequences of "doubles" and "singles",
eg (in order doubles-singles), $5-0,4-2,\,...\,0-10$, thus
$$\dfrac{\frac{5!}{5!0!} + \frac{6!}{4!2!} + \frac{7!}{3!4!} + \frac{8!}{2!6!}+\frac{9!}{1!8!} + \frac{10!}{0!10!}}{2^{10}} = \frac{89}{1024}$$
- 48,250
-
-
Small typo, it should be $6!$. Answer is $\frac{89}{1024}$ – Léo Aparisi de Lannoy Nov 04 '23 at 22:22
-
Let $a_n$ denote the number of strings of length $n$ in $\{H,T\}$ with the desired property. Any such string must either begin with $H$ or with $TT$ and then be followed by a good string of lower length. It follows that $a_n$ follows the Fibonacci recursion, $$a_n=a_{n-1}+a_{n-2}$$
The initial conditions, $a_1=1,a_2=2$ are also the same as for Fibonacci, and we quickly conclude that $a_{10}=89$.
- 76,951
Markov Chain Solution:
- Define $A$ the event: "The current sequence has an even (including 0) number of T".
- $B$ is the event: "The current sequence has an ood number of T"
We have:
$$ P_k(A) = \frac{1}{2}(P_{k-1}(B)+P_{k-1}(A)) \\ P_{k}(B) = \frac{1}{2} P_{k-1}(A) $$ Stacking the probabilities in a vector $A_k=(P_k(A),P_k(B))$, we have:
$$ A_k= \frac{1}{2} \begin{bmatrix} 1 & 1 \\ 0 & 1 \\ \end{bmatrix} A_{k-1} $$ We have $A_1=(.5,0.5)$ and using the recursion: $$ A_k= \frac{1}{2^9} \begin{bmatrix} 1 & 1 \\ 0 & 1 \\ \end{bmatrix}^9 A_{0} $$ We find $P_{10}(A) = \frac{89}{2^{10}}$