簡単すぎたのか。じゃーこういうのわかる?

Suppose we have a coin that when tossed results in heads with probability p, and
tails with probability 1-p. Let X be the number of times that we need to toss
the coin until r heads are obtained.

(a) What is P(X = n)?
(b) Compute E[X].
(c) Compute Var(X).
(d) What is P(X = n│1st head occurs on the 5th toss)?