# Conditional Density and expectation

maybe one of you can help me with the following:

The density function of a 2-dim. stochastical entity (X,Y) is defined via

$$f(x,y) = \begin{cases} \frac{1}{x} &\mbox{if } 0 < x \leq 1, 0 < y \leq x\\ 0 &\mbox{else} \end{cases}$$

Now I have to compute the conditional density of $X \mid Y=y$ and $Y \mid X=x$ and the corresponding conditional expectation $E[X \mid Y=y]$ and $E[Y \mid X=x]$.

Of course, for let's say the conditional density $f(x \mid y)$ I have to use the following formula:

$$f(x \mid y) = \frac{f(x,y)}{f_{Y}(y)}.$$

To get $f_Y (y)$ I want to use the following approach:

$$f_Y(y) = \int_0^1 f(x,y)dx = \int_0^1 \frac{1}{x}dx=\log (x) \mid_0^1=...$$

How should I proceed now? This integral doesn't converge, right?

For the conditional expectation I would have to use the following formula then:

$$E[X \mid Y=y] = \int_{0}^{1} x f(x \mid y) dx$$

For the second one I would get:

$$f_X(x)=\int_0^x f(x,y)dy=\int_0^x \frac{1}{x} dy=\frac{y}{x} \mid_0^x = 1,$$

so we get $f(y \mid x) = f(x,y)$ which results to

$$E[Y \mid X=x] = \int_0^x y f(y\mid x)dy=\int_0^x \frac{y}{x} dy = \frac{y^2}{2x} \mid_0^x=\frac{x}{2}.$$

Can you help me with the first part and confirm me the second?

Thank you in advance!

For the first part, note that $$\int_0^1f(x, y)dx = \int_y^1 \frac{1}{x} = -\ln y.$$ Second part appears fine.
• So my conditional density then will be $f(x \mid y) = -\frac{1}{x \log(y)}$ with $0 < x \leq 1$ and $0 < y \leq x$ and therefore we get $E[X \mid Y=y] = - \int_y^1 \frac{1}{\log(y)} dx = \frac{1}{\log(y)}(y-1)$, right? Oct 7, 2016 at 14:03