Expected value, problems understanding answer to question The probability $p$ of being able to log on to a computer from a remote terminal at any given time is $0.7$. Let $X$ denote the number of attempts that must be made to gain access to the computer.
Find $E[X]$.
Answer is supposed to be $\frac{1}{0.7}$ or $\frac{10}{7}$ but I don't understand how they get there. Usually when I'm solving these kind of problems there's a finite amount of times that something happens (like if it was stated that we tried to connect 5 times for example).
I'm new to probability thinking so I would really appreciate some clarity to the understanding.
Thanks!
 A: You're right to consider all of the possibilities for logging in. (There's an infinite number of cases!)
The expected value will be
$$E(x) = \sum_{y=1}^{\infty}yP(y),$$
where $P(y)$ is the probability of getting in on the $y$th time.
If the probability of getting in on any attempt is $p$ then the probability of not getting in is $1-p$. So $P(y) = p(1-p)^{y-1}.$ (In words, you fail to log in $y-1$ times, and log in the last time.)
So we have
$$E(x) = \sum_{y=1}^{\infty}yp(1-p)^{y-1} = \frac{1}{p}.$$
That's where the formula comes from. For your specific problem, $p=0.7$.
A: Here's an intuitive version that doesn't use infinite series. Imagine repeatedly trying to log-in, and recording each attempt, giving a sequence like FFSFSSSFS... where F is failure and S is success. Count the number of tries to each successive S (i.e. 3,2,1,1,2,...in the example). The average of these numbers is what you are looking for (since each one represents a value of the RV $X$). 
Now imagine, say, you do 10,000 tries, in which case you would expect 7000 S's among those tries, meaning that you have obtained 7000 values of $X$ whose sum is (essentially, ignoring some end-point trivia) 10000. So the average value of the lengths is 10000/7000 = 10/7. 
