# Thread: method of transformation question

1. ## method of transformation question

I'm wondering if someone can check me work to see if I in fact have the correct solution.

$f(y_1,y_2) = \left\{ \begin{array}{rcl}
1 & \mbox{for} & 0\leq y_1 \leq 2, \ 0\leq y_2 \leq 1, \ 2y_2 \leq y_1 \\ 0 & \mbox{otherwise}
\end{array}\right.$

U=Y_1-Y_2

$1-\int^2_u \int^{y_1-u}_0 1 \ dy_2 \ dy_1$

$1-\int^2_u y_2 \bigg{|}^{y_1-u}_0 \ dy_1$

$1-\int^2_u y_1-u \ dy_1$

$1-\left( \frac{{y_1}^2}{2} -uy_1\right) \bigg{|}^2_u$

$1-\left( 2-2u+\frac{u^2}{2} \right)$

$-1+2u-\frac{u^2}{2}$

$F_U(u) = \left\{ \begin{array}{rcl}
0 & \mbox{for} & u < 2-\sqrt{2}\\
-1+2u-\frac{u^2}{2} & \mbox{for} & 2-\sqrt{2} \leq u \geq 2+\sqrt{2} \\
1 & \mbox{for} & u > 2+\sqrt{2}
\end{array}\right.$

2. A remark: the density $f$ is positive on a neighbourhood of $(0,0)$, so that $Y_1$ and $Y_2$ can both be close to zero. So that the probability density function of $U=Y_1-Y_2$ must be positive near zero. This does not hold with your solution. In addition, it seems you forgot the condition $2y_2\leq y_1$, didn't you?

You integral is in fact: if $0\leq u\leq 2$, $P(Y_1-Y_2>u)=\int_u^2 \int_0^{\min(y_1-u, \frac{y_1}{2})}1 dy_2\,dy_1$, I think.

3. I was going more along the lines of the example in the book, which solves a problem like that in a similar fashion to what I have done.
I was thinking that I can just remove the bottom red triangle which goes from u to 2 on the $y_1$ line and 0 to $y_1-u$ leaving me only in the area in blue, which would be easier for me to solve, since I've never seen an integral that has a bound of min.

4. Originally Posted by lllll
I'm wondering if someone can check me work to see if I in fact have the correct solution.

$f(y_1,y_2) = \left\{ \begin{array}{rcl}
1 & \mbox{for} & 0\leq y_1 \leq 2, \ 0\leq y_2 \leq 1, \ 2y_2 \leq y_1 \\ 0 & \mbox{otherwise}
\end{array}\right.$

U=Y_1-Y_2

$1-\int^2_u \int^{y_1-u}_0 1 \ dy_2 \ dy_1$

$1-\int^2_u y_2 \bigg{|}^{y_1-u}_0 \ dy_1$

$1-\int^2_u y_1-u \ dy_1$

$1-\left( \frac{{y_1}^2}{2} -uy_1\right) \bigg{|}^2_u$

$1-\left( 2-2u+\frac{u^2}{2} \right)$

$-1+2u-\frac{u^2}{2}$

$F_U(u) = \left\{ \begin{array}{rcl}
0 & \mbox{for} & u < 2-\sqrt{2}\\
-1+2u-\frac{u^2}{2} & \mbox{for} & 2-\sqrt{2} \leq u \geq 2+\sqrt{2} \\
1 & \mbox{for} & u > 2+\sqrt{2}
\end{array}\right.$
Take $y_1$ as the vertical axis and $y_2$ as the horizontal axis. Draw the lines $y_1 = 2y_2$ and $y_1 = y_2 + u$ over $0 \leq y_1 \leq 2$ and $0 \leq y_2 \leq 1$ . The lines intersect at (u, 2u).

To get $F(u) = \Pr(U < u) = \Pr(Y_1 - Y_2 < u) = \Pr(Y_1 < Y_2 + u)$ you need to integrate the given joint pdf over the region bounded by the $Y_1$ axis and the lines $y_1 = 2y_2$ and $y_1 = y_2 + u$:

$F(u) = \int_{y_2 = 0}^{y_2 = u} \int_{y_1 = 2y_2}^{y_1 = y_2 + u} 1 \, dy_1 \, dy_2$ for $0 \leq u \leq 1$ and zero elsewhere.

5. Because $Y_1$ can be close to 2 and $Y_2$ close to 0 simultaneously, we must expect that the density of $U$ is positive near 2 (from below).

If $1\leq u\leq 2$, the lines intersect differently: the line $y_1=y_2+u$ meets $y_1=2$ at $y_2=2-u$, so that (look at the graph): $P(Y_1\leq Y_2+u)=\int_0^{2-u}\int_{2y_2}^{y_1+u}dy_1\,dy_2+\int_{2-u}^1\int_{2y_2}^2 dy_1\,dy_2$.

And $P(U\leq u)=1$ if $u>2$, $P(U\leq u)=0$ if $u\leq 0$.

6. Originally Posted by Laurent
Because $Y_1$ can be close to 2 and $Y_2$ close to 0 simultaneously, we must expect that the density of $U$ is positive near 2 (from below).

If $1\leq u\leq 2$, the lines intersect differently: the line $y_1=y_2+u$ meets $y_1=2$ at $y_2=2-u$, so that (look at the graph): $P(Y_1\leq Y_2+u)=\int_0^{2-u}\int_{2y_2}^{y_1+u}dy_1\,dy_2+\int_{2-u}^1\int_{2y_2}^2 dy_1\,dy_2$.

And $P(U\leq u)=1$ if $u>2$, $P(U\leq u)=0$ if $u\leq 0$.
It occured to me that I overlooked about 1 < u < 2. I was happy to see you'd done the work for me when I came back to rectify my oversight