Consider a sequence of independent Bernoulli trials with success probability p. Let X denote the number of failures until the first success to occur. Then, the probability mass function of X is given by
P (X = k|p) = P (Observing k failures) × P (Observing a success at the (k + 1)st trial) = (1− p)kp, k = 0, 1, 2, . . . .