Calculate expectation of a geometric random variable When you download a file from a website, the file gets corrupted with probability 0.8. What is the expected number of downloads to get an uncorrupted file?

I have no idea how to do this. I only know the probability that a file isn't corrupted should be 0.2, but how do I get the expectation? Can anyone help me?
Your question essentially boils down to finding the expected value of a geometric random variable. That is, if $X$ is the number of trials needed to download one non-corrupt file then 
$$X\sim Geo(0.2)$$
In general, if $X\sim Geo(p)$ then $$E(X)=\frac1 p$$
So in your case the expected number of trials to download an uncorrupted file is
$$E(X)=\frac{1}{0.2}=5$$
Addendum: Here is a derivation of the above mentioned result.

First note that $P(X=k)=p(1-p)^{k-1}$. The expected value is thus
$$\begin{align*}E(X)&amp;=\sum_{k=1}^{\infty}kp(1-p)^{k-1} \\
&amp;=p\sum_{k=1}^{\infty}k(1-p)^{k-1} \\
&amp;=p\left(-\frac{d}{dp}\sum_{k=1}^{\infty}(1-p)^k\right) \\
&amp;=p\left(-\frac{d}{dp}\frac{1-p}{p}\right) \\
&amp;=p\left(\frac{d}{dp}\left(1-\frac{1}{p}\right)\right)=p\left(\frac{1}{p^2}\right)=\frac1p\end{align*}$$

Derivative step: (answer to comment)

Simple use of chain rule gives: 
$$ -\frac{d}{dp}\sum_{k=1}^{\infty}(1-p)^k = \sum_{k=1}^{\infty}k(1-p)^{k-1} $$
It is clear that $$ -\frac{d}{dp}\sum_{k=1}^{\infty}(1-p)^k = -\frac{d}{dp}\left( \sum_{k=1}^{\infty}(1-p)^k \right)$$
given that $ 0 &lt;1 - p &lt; 1$ we can use the geometric series formula to obtain:
$$ \left( \sum_{k=1}^{\infty}(1-p)^k \right) = \frac{1 - p}{p} $$
then proof follows accordingly.
Expanding/complementing on what aflous said: your random variable is "number of non-corrupt files downloaded" , which has $p=1-0.8$......and expected number of non-corrupt files after _ trials is $\geq 1$....

EDIT: While it is true that the original question asks for a geometric random variable, one can look at the same problem from a different perspective, and still answer the question correctly. One can focus instead on whether a file is corrupt or not, and then define a new Binomial random variable to be the expect number of non-corrupt files in $n$ trials. Then this new random variable has mean $np$ for $n$ trials. We then want to find $n$ so that $np \geq 1$ , and , since $p=0.2$, we have $np \geq 1$ when $n \geq 5$.