# Transformation of Random Variables (Z = X-Y)

## Homework Statement

Suppose we have a function, f(x,y) = e^-x * e^-y , 0<=x< ∞, 0<=y<∞,
where X and Y are exponential random variables with mean = 1. (For those who may not know, all this means is ∫(x*e^(-x) dx) from 0 to ∞ = 1, and the same for y)

Suppose we want to transform f(x,y) into f(z), where the transformation is Z = X-Y. Find f(z)

## Homework Equations

f(x,y) = e^-x * e^-y , 0<=x< ∞, 0<=y<∞
Z = X-Y

## The Attempt at a Solution

So I decided to transform -Y into W. So we have -Y<=W, which implies Y>=-W
∫e^-y dy from -w to ∞...
-e^-y from -w to ∞
0 + e^-(-w)
e^w

Differentiate wrt w

f(w) = e^w -∞ < w <= 0

So now we have Z = X+W
Z-W = X
We'll just let W stay as is for this problem.

The jacobian of this transformation is 1.

So we have f(z) = ∫e^-(z-w)*e^w dw from -∞ to z,

This becomes ∫e^-z*e^2w dw from -∞ to z
This becomes e^-z * (e^2w)/2 from -∞ to z
This becomes e^-z * ((e^2z)-0)/2
Which becomes (e^z)/2

The domain of z is -∞ to ∞, however, this integral does not evaluate to 1. As a matter of fact, it does not even converge.

Any help would be greatly appreciated!!

Ray Vickson
Homework Helper
Dearly Missed

## Homework Statement

Suppose we have a function, f(x,y) = e^-x * e^-y , 0<=x< ∞, 0<=y<∞,
where X and Y are exponential random variables with mean = 1. (For those who may not know, all this means is ∫(x*e^(-x) dx) from 0 to ∞ = 1, and the same for y)

Suppose we want to transform f(x,y) into f(z), where the transformation is Z = X-Y. Find f(z)

## Homework Equations

f(x,y) = e^-x * e^-y , 0<=x< ∞, 0<=y<∞
Z = X-Y

## The Attempt at a Solution

So I decided to transform -Y into W. So we have -Y<=W, which implies Y>=-W
∫e^-y dy from -w to ∞...
-e^-y from -w to ∞
0 + e^-(-w)
e^w

Differentiate wrt w

f(w) = e^w -∞ < w <= 0

So now we have Z = X+W
Z-W = X
We'll just let W stay as is for this problem.

The jacobian of this transformation is 1.

So we have f(z) = ∫e^-(z-w)*e^w dw from -∞ to z,

This becomes ∫e^-z*e^2w dw from -∞ to z
This becomes e^-z * (e^2w)/2 from -∞ to z
This becomes e^-z * ((e^2z)-0)/2
Which becomes (e^z)/2

The domain of z is -∞ to ∞, however, this integral does not evaluate to 1. As a matter of fact, it does not even converge.

Any help would be greatly appreciated!!

Let f be the marginal density of X or Y. P{Z <= z} = int_{y=0..infinity} f(y)*P{X-Y <= z|Y=y} dy, and P{X-Y <= z|Y=y} = P{X <= y+z|Y=y} = P{X <= y+z} because X and Y are independent. You can get P{X <= y+z} and so do the integral. The final result is perfectly fine for all z in R and does, indeed, integrate to 1. However, you need to be careful about integration limits, since f(y) = exp(-y)*u(y) and F(y+z) = [1-exp(-y-z)]*u(y+z), where u(.) is the unit step function [u(t) = 0 for t < 0 and u(t) = 1 for t > 0]. BTW: please either use brackets (so write e^(2z)) or the "[ S U P ]" button (so write e2z) or else write "exp", as I have done. That way there is no chance of misreading what you type. Alternatively, you could use LaTeX.

RGV

So sorry, I saw your solution a while ago and it really helped me. I just remembered that I never thanked you/gave you credit for your solution. How do I give you credit for helping me?