A coin is tossed 1000 times and the result is stored as a string. Let x be the expected number of times the pattern TT occurs in the string. find x. A fair coin is tossed 1000 times and the result is stored as a string. Let x be the expected number of times the pattern TT occurs in the string. Find x.
i thought to first find total possible cases which equals 2^1000 . after that i thought to merge two TT together and place it at any of 999 places and remaining 998 can be placed in 2^998 ways. but it does not work. kindly looking for help to tackle such problem.
 A: You can try with a smaller sample of coin tosses: i.e. $n=4$ and realize that you have 12 possible TT patterns on 16 total elementary 4-tuples.
Using @dhrab hint you have that your expectation is
$$\frac{1}{4}\times 3=\frac{12}{16}$$
Thus in your example you fine
$$\frac{1}{4}\times 999=\frac{999}{4}$$
A: We throw $k$ tails first, for $k-1$ TT's (typically $k-1=0$).
After that, we throw a 'super-coin', which throws $a>0$ heads and then $b>0$ tails, contributing $b-1$ TT's.
This coin is thrown until $k+A+B\ge1000$.
The expected number of heads thrown by the supercoin is $\sum_\limits{i=1}^\infty \frac{n}{2^n}=2$, and the same for tails.
Therefore the supercoin typically throws HHTT, (and then starts with H again), which is $1$ TT per throw (which is the same as throwing $4$ single coins).
Therefore we throw the supercoin $250$ times and get $250$ TT's, which is $\frac14$.
A: Draw a line between any adjacent letters that are equal. In each of the $999$ space between letters the probability of line being drawn is $\frac{1}{2}$. Therefore the expected number of lines is $\frac{999}{2}$. Because of symmetry, the expected number of lines between $TT$ is half of this; $\frac{999}{4}$
