Distribution Difference of Two Independent Random Variables

In summary: Then ?In summary, the student is trying to find the PDF of Z, which is given by the equation X ~ U(0,1) and Y ~ U(0,1). Using my result from above, the pdf of Z is given by: X ~ U(0,1) and Y ~ U(0,1). The pdf of fx(x) and fY(y) are both 1 on (0,1) and 0 otherwise. z goes from -1 to 1 because of X - Y right? For 0 ≤ z ≤ 1 I wouldn't need to change the limits here, just from 0 to 1. So then the pdf of X - Y
  • #1
izelkay
115
3

Homework Statement


Z = X - Y and I'm trying to find the PDF of Z.

Homework Equations


Convolution

The Attempt at a Solution



Started by finding the CDF:
Fz(z) = P(Z ≤ z)

P(X - Y ≤ z)

So I drew a picture

jXF8OPD.png

So then should Fz(z) be:
L3ergX2.png

since, from my graph, it looks as though Y can go from negative infinity to positive infinity, and X can go from negative infinity on the left but is bounded by z+y on the right

then should the pdf be:
Edit: sorry I forgot to include the fact that, because fx and fy are independent, f(x,y) = fxfy in the following derivation
lTE7FtX.png

?
 
Last edited:
Physics news on Phys.org
  • #2
izelkay said:

Homework Statement


Z = X - Y and I'm trying to find the PDF of Z.

Homework Equations


Convolution

The Attempt at a Solution



Started by finding the CDF:
Fz(z) = P(Z ≤ z)

P(X - Y ≤ z)

So I drew a picture

jXF8OPD.png

So then should Fz(z) be:
L3ergX2.png

since, from my graph, it looks as though Y can go from negative infinity to positive infinity, and X can go from negative infinity on the left but is bounded by z+y on the right

then should the pdf be:
Edit: sorry I forgot to include the fact that, because fx and fy are independent, f(x,y) = fxfy in the following derivation
lTE7FtX.png

?

What is your question?
 
  • #3
Your approach looks reasonable. Is there something you are particularly worried about?
 
  • #4
Oh yes, sorry I was wondering if what I arrived at for the PDF of the difference of two independent random variables was correct.
proxy.php?image=http%3A%2F%2Fi.imgur.com%2FlTE7FtX.png

I tried Googling but all I could find was the pdf of the sum of two RVs, which I know how to do already.
 
  • #5
Yes, it looks ok. You should note that if you know the pdf of the sum and the pdf of the negative of a distribution (i.e., if you know how the the distribution of ##Y##, what is the distribution of ##-Y##), then you can use these two to obtain the distribution of ##X-Y##.
 
  • Like
Likes izelkay
  • #6
Orodruin said:
Yes, it looks ok. You should note that if you know the pdf of the sum and the pdf of the negative of a distribution (i.e., if you know how the the distribution of ##Y##, what is the distribution of ##-Y##), then you can use these two to obtain the distribution of ##X-Y##.
I'm going to modify the problem a little bit, can you tell me if I do it right/wrong?

X and Y are two independent random variables, each of which are uniform on (0,1). Find the pdf of Z = X - Y

Using my result from above, the pdf of Z is given by:
s%3A%2F%2Fwww.physicsforums.com%2Fproxy.php%3Fimage%3Dhttp%253A%252F%252Fi.imgur.com%252FlTE7FtX.png

X ~ U(0,1) and Y ~ U(0,1)

The pdf of fx(x) and fY(y) are both 1 on (0,1) and 0 otherwise.

z goes from -1 to 1 because of X - Y right?

For -1 ≤ z ≤ 0
fy is uniform only on (0,1) so my integral limits should be z+1 to z

For 0 ≤ z ≤ 1 I wouldn't need to change the limits here, just from 0 to 1

So then the pdf of X - Y is:

R2EM2LA.png

Is this correct?
 
  • #7
izelkay said:
I'm going to modify the problem a little bit, can you tell me if I do it right/wrong?

X and Y are two independent random variables, each of which are uniform on (0,1). Find the pdf of Z = X - Y

Using my result from above, the pdf of Z is given by:
s%3A%2F%2Fwww.physicsforums.com%2Fproxy.php%3Fimage%3Dhttp%253A%252F%252Fi.imgur.com%252FlTE7FtX.png

X ~ U(0,1) and Y ~ U(0,1)

The pdf of fx(x) and fY(y) are both 1 on (0,1) and 0 otherwise.

z goes from -1 to 1 because of X - Y right?

For -1 ≤ z ≤ 0
fy is uniform only on (0,1) so my integral limits should be z+1 to z

For 0 ≤ z ≤ 1 I wouldn't need to change the limits here, just from 0 to 1

So then the pdf of X - Y is:

R2EM2LA.png

Is this correct?

No, it cannot possibly be correct, because you would have f(z) = -1 for -1 < z < 0 and f(z) = 1 for 0 < z < 1. That kind of f cannot be a probability density function.

You need to go back and evaluate the limits more carefully; in cases like this, drawing an x,y diagram of the integration region would be helpful.
 
  • Like
Likes izelkay
  • #8
Ray Vickson said:
No, it cannot possibly be correct, because you would have f(z) = -1 for -1 < z < 0 and f(z) = 1 for 0 < z < 1. That kind of f cannot be a probability density function.

You need to go back and evaluate the limits more carefully; in cases like this, drawing an x,y diagram of the integration region would be helpful.
I don't have much practice drawing integration regions of density functions and I wouldn't know where to start with this one besides drawing the box with vertices (0,0), (0,1), (1,0), (1,1).

I think I found another way to look at it though:

If -1 ≤ z ≤ 0,

If I want fx(z+y) to be 1, I need to shift the bounds by +1, and then I'll need z+y+1 ≥ 0 , or y ≥ -1-z

So
JuURESd.png


Then on 0 ≤ z ≤ 1,

I need z+y ≤ 1, or y ≤ 1 - z

So
do0sH.png


Then all together this is:

1 + z , -1 ≤ z ≤ 0
1 - z , 0 ≤ z ≤ 1

I got the same answer as here: http://www.math.wm.edu/~leemis/chart/UDR/PDFs/StandarduniformStandardtriangular.pdf
but I'm not sure my process is correct because my bounds are a little different than theirs, and I don't know how they computed the cdf
 
  • #9
izelkay said:
I don't have much practice drawing integration regions of density functions and I wouldn't know where to start with this one besides drawing the box with vertices (0,0), (0,1), (1,0), (1,1).

I think I found another way to look at it though:

If -1 ≤ z ≤ 0,

If I want fx(z+y) to be 1, I need to shift the bounds by +1, and then I'll need z+y+1 ≥ 0 , or y ≥ -1-z

So
JuURESd.png


Then on 0 ≤ z ≤ 1,

I need z+y ≤ 1, or y ≤ 1 - z

So
do0sH.png


Then all together this is:

1 + z , -1 ≤ z ≤ 0
1 - z , 0 ≤ z ≤ 1

I got the same answer as here: http://www.math.wm.edu/~leemis/chart/UDR/PDFs/StandarduniformStandardtriangular.pdf
but I'm not sure my process is correct because my bounds are a little different than theirs, and I don't know how they computed the cdf

You already drew part of the diagram in Post #1. You just need to add the boundary lines x = 0, x = 1, y = 0, y = 1 and you are done---that's your drawing!

You say you "don't know how they computed the cdf". Well, you claimed before that you know how to compute the cdf of a SUM, and that is all you need to do.

If ##Z = X-Y## then ##S = Z+1## has the form ##S = X + (1-Y) = X + Y'##, where ##X## and ##Y' = 1-Y## are independent and ##\rm{U}(0,1)## random variables. Thus, ##S## is the sum of two uniforms, and has a well-known, widely-documented triangular density:
[tex] f_S(s) = \begin{cases} s, & 0 < s < 1\\ 2-s, & 1 < s < 2\\
0 & \rm{elsewhere}
\end{cases} [/tex]
Now just shift the graph of ##f_S(s)## one unit to the left, and that would be your density of ##Z##: ##f_Z(z) = f_S(1+z), \; -1 < z < 1##.
 
Last edited:
  • Like
Likes izelkay

1. What is the distribution difference between two independent random variables?

The distribution difference between two independent random variables refers to the difference in the probability distributions of the two variables. This can be calculated by finding the difference between the mean or median values of the two distributions, or by comparing the shape of the distributions.

2. How is the distribution difference of two independent random variables calculated?

The distribution difference of two independent random variables can be calculated by finding the difference between the mean, median, or other measures of central tendency of the two distributions. It can also be calculated by comparing the shape of the distributions using methods such as a visual inspection or statistical tests.

3. What is the significance of understanding the distribution difference of two independent random variables?

Understanding the distribution difference of two independent random variables is important in many scientific fields, such as statistics, economics, and biology. It can help us determine if there are significant differences between two groups or populations, and can provide insights into the relationship between variables.

4. How does the sample size affect the distribution difference of two independent random variables?

The sample size can have a significant impact on the distribution difference of two independent random variables. A larger sample size can provide more accurate estimates of the distribution difference, while a smaller sample size may result in less reliable estimates. Therefore, it is important to consider the sample size when analyzing the distribution difference between two variables.

5. What are some common methods for visualizing the distribution difference of two independent random variables?

Some common methods for visualizing the distribution difference of two independent random variables include creating histograms or box plots for each variable and comparing them, overlaying the two distributions on the same graph, or using statistical software to generate visualizations such as probability density functions or scatter plots.

Similar threads

  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
3
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
10
Views
1K
  • Calculus and Beyond Homework Help
Replies
5
Views
888
  • Calculus and Beyond Homework Help
Replies
6
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
733
  • Calculus and Beyond Homework Help
Replies
4
Views
2K
Back
Top