expectation of number of exactly 3 heads flip in a row

60 Views Asked by At

lets say I have 400 coin tosses and a probability P for head.

$\{ x_n \}$ the tosses,then X is a random variable which X = {number of times which there where exactly 3 heads}

how can I calculate E[x] and Var[x]?

I tried to get to the solution through recursion by choose where the first 3 exactly heads will be but with no luck.
k=400 ,
P(X=n) = F(n,k) = F(n-1,k-4)+F(n-1,k-5)+F(n-1,k-6)+F(n-1,k-7)