TITLE: Expected value of a ratio. To exist or not to exist, that is the question.
QUESTION [5 upvotes]: I am given the question.
Suppose X and Y are iid uniform random variables on the interval (-2,2). Let $Z=\frac{Y}{X}$.
Does the expectation of Z exist? If it exists, calculate $\mathbb{E}[Z]$. If it does not exist, explain why.
I have 2 different interpretations of this questions and I don't know which one or if any is correct.
1 way I see this is once we calculate the pdf of Z. We can use it to calculate the expected value as,
$$\mathbb{E}[Z]=\int zf_{Z}(z)dz$$
But, if we look at as,
$$\mathbb{E}[Z]=\mathbb{E}\left[\frac{Y}{X}\right]$$
Since X and Y are independent,
$$\mathbb{E}\left[\frac{Y}{X}\right]=E[Y]\cdot\mathbb{E}\left[\frac{1}{X}\right]$$
But, the expected value of 1/X is
$$\mathbb{E}\left[\frac{1}{X}\right]=\int_{-2}^2 \frac{1}{x}f_{X}(x)dx$$
This is a divergent integral and thus the expected value is not possible to calculate.
I don't know which interpretation if either is correct.

REPLY [4 votes]: Both methods are valid. The second one is faster (and suggested). If you calculate $f_Z(z)$ you will realize that $Z$ does not have expectation as the corresponding integral diverges.

The calculation of Z distribution, even not necessary to answer your question,  can be an useful exercise.
$$f_Z(z)=\frac{1}{4}\cdot \mathbb{1}_{|z|<1}+\frac{1}{4z^2}\cdot \mathbb{1}_{|z|\ge 1}  $$

REPLY [3 votes]: Both of the statements you have written are correct. If you compute $f_z$, you will find out that the integral
$$E[Z]=\int_{-\infty}^\infty zf_{z}(z)dz $$
diverges.
Your second approach using the fact that $X$ and $Y$ are independent is a much quicker way of proving that if that's all you're interested in.