# Homework Help: Continuous Variable pdf from a cdf

1. Nov 29, 2012

### Aria1

1. The problem statement, all variables and given/known data
f X,Y(x,y) = (8 +xy^3)/64, if -1<x<1, -2<y<2
0, otherwise
Find the probability density function of W = 2X+Y.

2. Relevant equations
F(w) = Pr{W≤w}=∫∫f(x,y)dxdy
f(w) = d/dw F(w)

3. The attempt at a solution
I found the support of W to be -4<w<4
I think the region should be broken up into: F(w) = 0, w<-4
A, -4≤w<0
B, 0≤w<4
1, 4≤w<∞
For expression B, I took the double integral: ∫-2 to 2 ∫ -1 to (w-y)/2 [(8+xy^3)/64]dxdy and got (w+5)/10.

The x-bound (w-y)/2 comes from the given 2X+Y=W, isolating X

For expression A, I tried the double integral ∫-2 to (w+2)∫-1 to (w-y)/2 [(8+xy^3)/64]dxdy, but am finding myself unsure of this setup (the result is a very lengthy integral). The y-bound of w+2 comes from the top intersection point of the line 2X+Y=W and x=-1.

Is there some flaw in my logic here? Any input on any part of this is much appreciated...I'm not positive about any of it, so if you see a flaw somewhere, please let me know. Also, just to clarify, what I am doing is trying to find the cdf which I can then differentiate to get the pdf. There may be other ways, but this is the only method we have covered thus far in class, so if we can stick to that, it would be great! Thanks!

2. Nov 29, 2012

### Ray Vickson

Your basic method is OK, but you are missing a region. Besides the "trivial" regions {w < -4} (where F(w) = 0) and {w > 4} (where F(w) = 1) you should have three regions:
(1) region A, bounded on the right by the line L1 (2x+y = w passing through the corner (-1,2) );
(2) region B bounded on the left by line L1 and on the right by line L2 (the line 2x+y=w passing through the corner (1,-2)); and
(3) region C, bounded on the left by line L2.

In regions A and C it does not matter much whether you first integrate over x and then over y, or vice-versa. However, in region B it matters a lot: you should draw a diagram to see which approach is the easiest.

RGV

3. Nov 29, 2012

### Aria1

I don't quite understand the difference between your L1 and L2. Isn't the line 2x+y=w that passes through (-1,2) and the line 2x+y=w that passes through (1,-2) the same line? The diagram I have is of a rectangle with bounds -1<x<1, -2<y<2, with the line 2x+y=w passing through the rectangle at any point. The line passing through (-1,2) and (1,-2) also passes through the origin. With this diagram, I am not seeing the three regions, so perhaps my diagram is incorrect in some way? Thank you for your help.

4. Nov 29, 2012

### Ray Vickson

You are right, of course; I had a brain meltdown, and temporarily thought of the rectangle as 4x2 instead of 2x4. I should not post late at night.

5. Nov 29, 2012

### Aria1

That's completely fine...I'm just glad I wasn't completely misunderstanding things :) With that clarification, my method looks correct to you then?

6. Nov 29, 2012

### Ray Vickson

Yes.

7. Nov 29, 2012

### Aria1

Thanks so much!

8. Nov 30, 2012

### Aria1

I ended up with F(w) = 0, w<-4
(1/512)((w^6)/60 - w^4 - (16/3)(w^3) + (512/5)w + (904/3)), -4≤w<0
(w+5)/10 , 0≤ w< 4
1, 4≤w
From there, f(w) = (1/512)((w^5)/10 - 4w^3 - 16w^2 + (512/5)), -4<w<0
1/10, 0<w<4
0, otherwise
When I integrate f(w) from -4 to 4, however, I get 0.9 not 1. Any insights as to what might be going wrong?

9. Nov 30, 2012

### Aria1

The (904/3) should be 248, but that does not alter the pdf

10. Nov 30, 2012

### Ray Vickson

I get:
$$F(w) = \int_{y=-2}^{2+w} \int_{x=-1}^{(w-y)/2} f(x,y) \, dx \, dy \\ = \frac{1}{2} + \frac{1}{5} w -\frac{1}{96} w^3- \frac{1}{512} y^4 + \frac{1}{30720}y^6$$
for -4 < w < 0
and
$$F(w) = 1 - \int_{y=w-2}^2 \int_{x=(w-y)/2}^1 f(x,y) \,dx \, dy \\ = \frac{1}{2} + \frac{1}{5} w -\frac{1}{96} w^3+ \frac{1}{512} y^4 - \frac{1}{30720}y^6$$
for 0 < w < 4. This gives F(4) = 1, as it should, since F(w) is the cdf.

I did all computations using Maple.

Last edited: Nov 30, 2012