How should I approach this problem?
The joint density for $(X,Y)$, where $X$ is the arrival time of the first vehicle from the north-south direction and $Y$ is the arrival time of the first vehicle from the east-west direction at an intersection, is given by
$$f(x)=\frac{1}{x}$$ $$0<y<x<1$$
Find $E[X]$.
Before this I've only encountered expected value-problems where I've either been given a table to find direct values.
Following the formula for expected values via joint density:
$$\int _{-\infty }^{\infty }\:\int _{-\infty }^{\infty }\:xf_{XY}\left(x,y\right)dxdy$$
I try something like this but I don't get the right answer, it's supposed to be $\frac{1}{2}$.
$$\int _0^x\:\int _y^1\:x\frac{1}{x}dxdy$$
I might be far off with this but I have no idea. Any help would be very appreciated!
\begin{eqnarray} \mathbb{E}[X] &=& \int_{-\infty}^{+\infty}{\rm d}x\int_{-\infty}^{+\infty}{\rm d}y ~ xf_{XY}(x,y) = \int_0^1{\rm d}x\int_0^x{\rm d}y ~ x\frac{1}{x} \\ &=& \int_0^1{\rm d}x ~ x = \left.\frac{1}{2}x^2\right|_0^1 \\ &=& \frac{1}{2} \end{eqnarray}