Favorite sequence in 10 flip tosses I have the following question. Somebody likes to flip coins. In particular, this person is delighted to get a sequence HTTH. Assuming the person flipped coins 10 times, what is the probability that she got exactly this sequence in her trials? 
I want to sanity check my reasoning. Sample space is 2^10. Now, HTTH can occur at any of the positions 1,...,7 in the 10 trial sequence.
The remaining 6 positions can be occupied by any outcome, so I posit that the favourable outcome is calculated by 7*2^6. It means, the probability I want to get is 7*2^6 / 2^10 = 7/16
Is there a flaw in this reasoning? 
 A: Unfortunately, yes, there is a flaw in your reasoning, because overlapping sequences are not independent.  Consider the sequence of heads and tails at positions 4-7; assume this sequence is not HTTH.  One reason it might not be HTTH is because the coin at position 7 might be a T, in which case it is also not possible for the sequence of flips from 7-10 to be HTTH.
The link that @Ertxiem provides shows how to solve a related problem for infinite sequences, but not for finite sequences.  It seems likely to me that you won't be able to beat exhaustive search, which can be done easily in R using the intToBits function (of which I was not previously aware) as follows.  If we define "H" as $0$ and "T" as $1$, the sequence HTTH corresponds to the binary number $0110$, or 6.   So all we need to do is check all the 10-digit binary sequences from $0$ to $2^{10}-1$ for the presence of the sequence $0110$ (note that each sequence is equally probable, so the probability that there is a sequence HTTH embedded in it is just the count of the number of such sequences divided by the total number of sequences.)
nseq <- 0
for (i in 0:1023) {
   bits <- as.integer(intToBits(i)[1:10])
   j <- 1
   has_seq <- FALSE
   while (j <= 7 & !has_seq) {
      has_seq <- bits[j] == 0 && bits[j+1] == 1 && bits[j+2] == 1 && bits[j+3] == 0
      j <- j + 1
   }
   if (has_seq) nseq <- nseq + 1
}

resulting in:
> nseq / 1024
[1] 0.3837891
> 7/16
[1] 0.4375

