# Conditional probability for joint density functions

I have the joint density function $$f(y_1,y_2) = 3y_1, 0 \leq y_2 \leq y_1 \leq 1.$$ And $$0$$ elsewhere.

The conditional density for $$f(y_1|y_2)$$ is defined over $$y_2 \leq y_1 \leq 1$$, provided that $$y_2 \leq 0$$ .

The question is about Y1, the proportion of items stocked and Y2, proportions of items sold.

I have to find the probability that more than 1/2 is sold given that 3/4 is stocked.

My atempt is to define $$f(y_1|y_2)$$:

$$f(y_1|y_2)= \frac{f(y_1,y_2}{f_2(y_2)} = \frac{1/2}{3/4 y_2} = \frac{2}{3y_2}$$

Then calculate $$P(y_1 > 1/2 \; | \; 3/4)$$ With the integral $$\int_{\frac{1}{2}}^{1} \frac{2}{3y_2} dy = \frac{1}{6}$$.

But the result should be 1/3 according to my textbook, so I'm doing something wrong somewhere. Hope someone can help me with figuring out where I'm going wrong.

• The approach is the right one but you confused $y_1$ and $y_2$ (and you didn't compute correctly the marginal density).
– Papi
Nov 8, 2021 at 11:07

Hope someone can help me with figuring out where I'm going wrong.

As you wrote, your question is about $$P(Y_2|Y_1=y_1)$$ thus the conditional density you found is not useful...and even wrong

Just to simplify the notation, let's set

$$X=$$ stocked goods

$$Y=$$ sold goods

First calculate

$$f_{Y|X}=\frac{f_{XY}}{f_X}=\frac{3x}{3x\int_0^x dy}=\frac{1}{x}$$

thus $$(Y|X=x)\sim U(0;x)$$

given that $$x=0.75$$ you have that

$$f_{Y|X=0.75}(y)=\frac{4}{3}\cdot\mathbb{1}_{(0;0.75]}(y)$$

And concluding,

$$\mathbb{P}[Y>0.5|x=0.75]=\left[\frac{3}{4}-\frac{1}{2}\right]\times\frac{4}{3}=\frac{1}{3}$$