We want to find $E[X]$, where $X$ is the total number of runs in $n=10$ tosses.
A "run" is a sequence of identical outcomes. A new run begins at a position $i$ if the outcome at $i$ is different from the outcome at $i-1$.
- The first toss (at position $i=1$ ) always starts the first run. So, we have 1 run guaranteed.
- For every subsequent toss $i$ (from $2$ to $10$), we can define an indicator variable $I_i$ :
- $I_i=1$ if $\operatorname{Toss}_i \neq \operatorname{Toss}_{i-1}$ (a new run starts at position $i$ )
- $I_i=0$ if Toss $_i=$ Toss $_{i-1}$ (the previous run continues)
The total number of runs $X$ is the first run plus all the new runs that start:
$$
X=1+\sum_{i=2}^{10} I_i
$$
The expected value of the sum is the sum of the expected values:
$$
\begin{gathered}
E[X]=E[1]+E\left[\sum_{i=2}^{10} I_i\right] \\
E[X]=1+\sum_{i=2}^{10} E\left[I_i\right]
\end{gathered}
$$
The expected value of an indicator variable is just the probability of the event it indicates:
$$
E\left[I_i\right]=P\left(I_i=1\right)=P\left(\text { Toss }_i \neq \text { Toss }_{i-1}\right)
$$
Since the coin is fair, there are four equally likely possibilities for the pair of tosses $\left(\right.$ Toss $_{i-1}$, Toss $\left._i\right)$ :
- $(\mathrm{H}, \mathrm{H})$
- $(\mathrm{H}, \mathrm{T}) \leftarrow$ New run
- $(\mathrm{T}, \mathrm{H}) \leftarrow$ New run
- ($\mathrm{T}, \mathrm{T}$ )
The probability of a new run (H, T or T, H) is $\frac{2}{4}=\frac{1}{2}$. Therefore, $E\left[I_i\right]=\frac{1}{2}$ for all $i$ from $2$ to $10$.
\begin{aligned}
&\text { We have } 9 \text { indicator variables (from } I_2 \text { to } I_{10} \text { ), and each has an expected value of } \frac{1}{2} \text {. }\\\\
&\begin{gathered}
E[X]=1+\sum_{i=2}^{10} \frac{1}{2} \\\\
E[X]=1+\left(9 \times \frac{1}{2}\right) \\\\
E[X]=1+4.5 \\\\
E[X]=5.5
\end{gathered}
\end{aligned}