First we will solve it using Recursion.
Let’s say E[n] = Expected number of HH in n consecutive tosses.
Say X[i] = Output ( H/T ) on the ith toss.
If first toss returns T, then expected number of HH in 10 tosses is same as expected number of HH inthe next 9 tosses.
E[10 | X[1...