# 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.

$\displaystyle 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

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

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

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

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

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

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

$\displaystyle 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 $\displaystyle f$ is positive on a neighbourhood of $\displaystyle (0,0)$, so that $\displaystyle Y_1$ and $\displaystyle Y_2$ can both be close to zero. So that the probability density function of $\displaystyle 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 $\displaystyle 2y_2\leq y_1$, didn't you?

You integral is in fact: if $\displaystyle 0\leq u\leq 2$, $\displaystyle 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 $\displaystyle y_1$ line and 0 to $\displaystyle 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.

$\displaystyle 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

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

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

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

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

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

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

$\displaystyle 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 $\displaystyle y_1$ as the vertical axis and $\displaystyle y_2$ as the horizontal axis. Draw the lines $\displaystyle y_1 = 2y_2$ and $\displaystyle y_1 = y_2 + u$ over $\displaystyle 0 \leq y_1 \leq 2$ and $\displaystyle 0 \leq y_2 \leq 1$ . The lines intersect at (u, 2u).

To get $\displaystyle 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 $\displaystyle Y_1$ axis and the lines $\displaystyle y_1 = 2y_2$ and $\displaystyle y_1 = y_2 + u$:

$\displaystyle 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 $\displaystyle 0 \leq u \leq 1$ and zero elsewhere.

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

If $\displaystyle 1\leq u\leq 2$, the lines intersect differently: the line $\displaystyle y_1=y_2+u$ meets $\displaystyle y_1=2$ at $\displaystyle y_2=2-u$, so that (look at the graph): $\displaystyle 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 $\displaystyle P(U\leq u)=1$ if $\displaystyle u>2$, $\displaystyle P(U\leq u)=0$ if $\displaystyle u\leq 0$.

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

If $\displaystyle 1\leq u\leq 2$, the lines intersect differently: the line $\displaystyle y_1=y_2+u$ meets $\displaystyle y_1=2$ at $\displaystyle y_2=2-u$, so that (look at the graph): $\displaystyle 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 $\displaystyle P(U\leq u)=1$ if $\displaystyle u>2$, $\displaystyle P(U\leq u)=0$ if $\displaystyle 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