Finding the expected value of a negative binomial distribution with two success indications

58 Views Asked by At

Flip a coin until a head appears or until the fourth trial. Let $X$ be the number of coin tosses. What is $E(X)$?

   H   TH TTH TTTH TTTT
s= 1   1  1   1    1
f= 0   1  2   3    4 

let $f =$ number of failures
$X = f+s$

what i did is $E(f+s) = E(x) = \frac {s(1-p)}p$ where $p$ is the probability of getting heads.
It seemed to be wrong, is the last term TTTT the reason?