I am a beginner in statistics and probability. I have a question that says
What is the expected number of failures preceding the first success in an infinite series of independent trials with the constant probability of success equal to $p$?
I have tried of solution of this and is not quite sure of this:
The probability of failure is $1-p$
The probability of $x$ failures in a row is $(1-p)^x$.
Now, expectation of $x$ is
$E(x) =\sum_0^\infty x (1-p)^x\\ =(1-p) + 2(1-p)^2+3(1-p)^3 +\ldots \infty \\ =\frac{1-p}{p^2} $
Thanks in advance.