@benleis Ooh looks fun!
Let's say the expectation is `x` and look at the first 3 flips. We get:
- T _ _ 50% of the time, which we'd expect to take 1+x flips in total because the counter resets after the T,
- H T _ 25% of the time, which takes 2+x flips
- H H T 12.5% of the time, which takes 3+x flips, and
- H H H the remaining 12.5% which takes exactly 3 flips
So x = (1+x)/2 + (2+x)/4 + (3+x)/8 + 3/8,
which after some manipulation comes out to x = 14 flips