What is the expected number of coin tosses needed to obtain a head? Due to my recent misunderstandings regarding the 'expected value' concept I decided to post this question. Although I have easily found the answer on the internet I haven't managed to fully understand it.
I understood that the formula for the expected value is:
$$E(x) = x_1p_1 +x_2*p_2 +...+x_np_n$$
The x's are the possible value that the random variable can take and the p's are the probabilites that this certain value is taken.
So, if I get a head on the first try, then  $ p_1 = \frac{1}{2} , x_1 = 1 $
If I get a head on the second try, then $ p_2 = \frac{1}{4} , x_2 = 2 $
And then, I woudl have that:
$$E(x) = \frac{1}{2}1+ \frac{1}{4}2 +...$$
So my reasoning led me to an inifnite sum which I don't think I can't evaluate it that easy. In the 'standard' solution of this problem, the expected value is found in a reccurisve manner. So the case in which the head doesn't appear in the first toss is treated reccursively. I haven't understood that step.
My questions are: is my judgement correct? How about that reccursion step? Could somebody explain it to me?

Your approach is perfectly fine. The probability of getting the first head in the $n$th trial is $\frac{1}{2^n}$, so we have
$$
\mathbb{E}(x) = \sum_{ n \geq 1} \frac{n}{2^n}.
$$
This infinite sum can be calculated in the following way: first note that
$
\frac{1}{1-x} = \sum_{n \geq 0} x^n
$
for $|x|<1$. Differentiating both sides yields
$$
\frac{1}{(1-x)^2} = \sum_{n \geq 0} n x^{n-1} = \sum_{n \geq 1} n x^{n-1} = \frac1x \sum_{n \geq 1} n x^n.
$$
Pluggin in $x = \frac12$ yields $4 = 2 \sum_{n \geq 1} \frac{n}{2^n} = 2 \mathbb{E}(x)$, or $\mathbb{E}(x) = 2$.
The recursive solution goes, I think, as follows: let $\mathbb{E}(x)$ be the expected number of trials needed. Then the expected number of trials needed after the first trial, given that it was not heads, is also $\mathbb{E}(x)$. In other words, the expected (total) number of trials is $\mathbb{E}(x)+1$ in that case. This gives the equation
$$ \mathbb{E}(x) = \frac12 + \frac12(\mathbb{E}(x)+1)$$ 
which gives the same answer $\mathbb{E}(x) = 2$.
