# Joint Density f(X,Y) integration when there is no Y in the eqn

#### crusoe

##### New Member
Hi I'm having difficulties with integration by parts when the main function of a joint distribution doesn't contain the Y. Here it is:

Let X and Y have a joint density given by f(X,Y)=a(1−X), 0≤X≤1,0≤Y ≤1
and zero elsewhere. Where, k is a constant.

(a) Find the value of a that makes this a probability density function. Use this
value for a in the pdf to work out the remaining questions.
(b) Find the marginal distribution of X and Y, i.e. f(X) and f(Y ).
(c) Find E(X), E(Y ), E(Y |X) and V ar(X|Y ).
(d) Find E[6X −12Y] and Var(2X −3Y)
(e) Find Cov(XY ) and the correlation ρxy
(f) Are X and Y independent? Show this using two alternative ways.

For part (a) I'm getting a value of a=-2 but I don't think that it's correct. I haven't moved any further in the question as all the others are dependent on this answer. Any help would be great!

#### Dason

It seems to me you must have switched a negative somewhere. Notice that if a = -2 then for any (x,y) in the support of the distribution you have your joint density has a negative value. This can't happen.

#### crusoe

##### New Member
How would I go about integrating it? I always seem to end up with a negative number, so something is wrong with my process.

#### Dason

I don't quite get what's causing the problems I guess. Integrate with respect to x and then with respect to y?

$$\int_0^1 \int_0^1 f(x,y) dx dy = \int_0^1 \int_0^1 a(1-x) dx dy$$$$= a \int_0^1 \int_0^1 (1-x) dx dy = a \int_0^1 1/2 dy = a/2$$

#### crusoe

##### New Member
Thank you. The step that you short cut through is the one I'm making the mistake on. Is it possible that you show all steps?

#### Dason

The step where I integrate with respect to x?

$$\int_0^1 (1-x) dx = \left. x - (1/2)x^2 \right|_0^1 = (1 - 1/2) - (0 - 0) = 1/2$$

#### crusoe

##### New Member
Wow, apparently I thought 1-1/2 = -1/2 weird. Big thanks. Another thing: In the case where I'm doing part a. Do I interpret the question as prove:
1. f(xy)>=0
2. \int_0^1 \int_0^1 f(xy)dxdy = 1

so that in part 2 - the part you explained to me, i would conclude 1 = a/2 Therefore a = 2?

#### Dason

Wow, apparently I thought 1-1/2 = -1/2 weird.
No worries. It happens to the best of us. I once spent an additional hour working on a measure theory question because I couldn't get something to work out because I made the mistake of saying 1 + 1 = 1.

...

Big thanks. Another thing: In the case where I'm doing part a. Do I interpret the question as prove:
1. f(xy)>=0
2. \int_0^1 \int_0^1 f(xy)dxdy = 1

so that in part 2 - the part you explained to me, i would conclude 1 = a/2 Therefore a = 2?
It's not perfectly clear to me that the parts you're referencing are the same as they were in the first post but oh well. Essentially I think what you're saying is what you want to do. You need to show those two facts (always non-negative and integrates to 1) and that the value of a that gives you that is 2. You should be good to move on to the other parts after that.

#### crusoe

##### New Member
For part B of the question. How do I approach finding the marginal distribution f(X) and f(Y) when there isn't a Y in the equation?

For the marg distrn f(x) = inty a(1-x)dy I get = a(1-2x) as the marg distrbn. And I get a(1/2) as the marg distrbn of f(y)

Last edited:

#### Dason

For part B of the question. How do I approach finding the marginal distribution f(X) and f(Y) when there isn't a Y in the equation?

For the marg distrn f(x) = inty a(1-x)dy I get = a(1-2x) as the marg distrbn. And I get a(1/2) as the marg distrbn of f(y)
Now that you know that a = 2 you should probably just replace any mention of a with 2. I don't quite understand what you're doing here:
nty a(1-x)dy I get = a(1-2x) as the marg distrbn

Remember that you're integrating with respect to y and anything without a y is just a constant. So 2(1-x) is just a constant so if you want you could do this:
$$\int_0^1 2*(1 - x) dy = 2*(1-x) \int_0^1 1 dy = 2*(1-x) * (1-0) = 2*(1-x)$$

#### crusoe

##### New Member
Sorry. I'll try and make this more clear. Currently I'm working on these questions:

(b) Find the marginal distribution of X and Y, i.e. f(X) and f(Y ).
(c) Find E(X), E(Y ), E(Y |X) and V ar(X|Y ).

For (b) I did the following:

$$f(x) = \int_y f(x,y) dy = \int_y a(1-x) dy = a \int_y (1-x) dy = a \left. 1y-x \right|_0^1 = a(1-x-0-x)$$
This simplifies to = a(1-2x) as the marginal distribution of X.

$$f(y) = \int_x f(x,y) dx = \int_x a(1-x) dx = a \int_x (1-x) dx = a \left. 1x-x^2/2 \right|_0^1$$
This simplifies to = a[1-1/2-0-0] = a(1/2) as the marginal distribution of Y.

I'm completely unsure if I can do those operations though. Especially after reading your most recent suggestion.

#### Dason

$$a \int_y (1-x) dy = a \left. 1y-x \right|_0^1 = a(1-x-0-x)$$
Here is your problem. Remember that you're integrating with respect to y. This means x is a constant so
$$2 \int_0^1 (1-x) dy = \left. 2 * (1*y - x*y) \right|_0^1$$

#### crusoe

##### New Member
Ok that makes sense for the marginal distribution of X, but what about Y? I get the following for Y

$$f(y) = \int_x a(1-x) dx = 2 \int_0^1 (1-x) dx = 2(\left. 1x-x^2/2) \right|_0^1 = 2(1-1/2-0-0) =1$$

So my question regarding the marginal distribution of Y is: Is it ok for it to just take the value 1? I thought it should be something with a variable in it.

#### Dason

Well if you really want to be technical you do have a variable in there. It's really 1 times the indicator function that y is between 0 and 1. Y has a uniform distribution on [0,1] is all that that says.

#### crusoe

##### New Member
Ah ok, thank you! I'm on to part

(c) Find E(X), E(Y ), E(Y |X) and V ar(X|Y ).

I get the following for E(X) which I think is correct:
$$E(x)=\int_x xf(x) dx = \int_0^1 xa(1-x) dx = a \int_0^1 1x-x^2 dx = a \left. (1x^2/2 - x^3/3) \right|_0^1 = 1/3$$

But when I do it for E(y) I run into a problem on the 6th step:
$$E(y)=\int_y yf(y) dy = \int_0^1 ya(1-x) dy = a\int_0^1 y(1-x) dy = a\int_0^1 (y-xy) dy$$
$$= a \left.(y^2/2-xy^2/2) \right|_0^1 = a(1/2 - x1/2 - 0 - 0)$$

I don't know what to do with the X in a(1/2 - x1/2 - 0 - 0). I need to solve for a single number for E(y) but the x is giving me problems.

#### BGM

##### TS Contributor
You still have not get the correct marginal pdf for $$Y$$.

Note

$$f_Y(y) = \int_{-\infty}^{+\infty} f_{X, Y}(x, y) dx = \int_0^1 a(1 - x)dx, 0 < y < 1$$

is independent of x, as you have already integrate the dummy variable $$x$$ out.

Actually, from the given joint density, without doing the integration you
can immediately tell $$Y \sim \mathrm{Uniform}(0, 1)$$
and is independent from $$X$$.

#### crusoe

##### New Member
Hmm. How do I have the X value already out? Im not really following.

#### BGM

##### TS Contributor
Do you know the uniform distribution?

Or more directly, can you get the result

$$f_Y(y) = 1, 0 < y < 1$$

#### crusoe

##### New Member
Ok, firstly, can $$f(x,y) = a(1-x), 0=<X=<1, 0=<Y=<1$$ be seen to be uniform before any work is completed?

Which leads to my next question, how can I deduce that

Actually, from the given joint density, without doing the integration you
can immediately tell $$Y \sim \mathrm{Uniform}(0, 1)$$
and is independent from $$X$$.
What is the process to come to that result?

Lastly, would the marginal distribution of Y then simply be
$$f(y) = a(1-x)$$