Let the random variable X represent the number of times a fair coin needs to be tossed till two consecutive heads appear for the first time. The expectation of X is.
1st solution and This is the Official answer.
sample space
1.HH
2.THH
3.TTHH
4.TTTHH
5.TTTTHH
.............
$$ E[x]=\left(2*\frac{1}{4}\right)+\left(3*\frac{1}{8}\right)+\left(4*\frac{1}{16}\right)+\left(5*\frac{1}{32}\right)...........=1.5 $$
But I have confusion related to sample Space.
when we 4 times toss then the probability of 2 consecutive heads coming is $\left(\frac{2}{16}\right)$, not$\left(\frac{1}{16}\right)$.and so on in the next round toss. but in the official answer, they consider only $\left(\frac{1}{16}\right)$.
1.HH
2.THH
3.TTHH,HTHH
4.TTTHH,THTHH,HTTHH
5.TTTTHH,TTHTHH,THTTHH,HTTTHH,HTHTHH
...........................................
so, where I am thinking wrong?

The official answer is wrong. You are right.
We can solve the problem with conditional expectation.
(P.S. $X_1$ satisfies the geometric distribution.)