What is the expected number of coin flips until you get two heads in a row? A coin that comes up heads with probability p is continually flipped until the pattern T T H appears. Let X denote the number of flips needed until the pattern is observed.  What is the expected value of X  i.e. E [X]?