Official solution
Number of ways 3 consecutive heads can appers
(1) HHHT\_
(2) \_THHH
(3) THHHT
\[ \therefore \] Probablity of getting 3 consecutive heads
= \[{2 \over {32}}\] + \[{2 \over {32}}\] + \[{1 \over {32}}\] = \[{5 \over {32}}\]
Number of ways 4 consecutive heads can appers
(1) HHHHT
(2) THHHH
\[ \therefore \] Probablity of getting 4 consecutive heads
= \[{1 \over {32}}\] + \[{1 \over {32}}\] = \[{2 \over {32}}\]
Number of ways 5 consecutive heads can appers
(1) HHHHH
\[ \therefore \] Probablity of getting 5 consecutive heads
= \[{1 \over {32}}\]
Now Probablity of getting 0, 1, and 2 consecutive heads
= 1 - \[\left( {{5 \over {32}} + {2 \over {32}} + {1 \over {32}}} \right)\] = \[{{{24} \over {32}}}\]
Now, Expectation
= (-1) \[ \times \] \[{{{24} \over {32}}}\] + 3 \[ \times \] \[{{{5} \over {32}}}\] + 4 \[ \times \] \[{{{2} \over {32}}}\] + 5 \[ \times \] \[{{{1} \over {32}}}\]
= \[{1 \over 8}\]