<s>[INST] Conditional probability for bivariate random variables question: $$ f_{(X,Y)(x,y)}=
\begin{cases} 8xy, &0\le y\le x \le 1\\0.&\text{elsewhere} \end{cases} $$
Find $ P\left( X\le \frac{1}{2}|Y\ge \frac{1}{4}\right) $
What is wrong with my solution:
$$
\frac{\int_{\frac{1}{4}}^{\frac{1}{2}}\int_{\frac{1}{4}}^x8xydydx}{\int_{\frac{1}{4}}^{1}4y-4y^3dy}
$$
seeing that $ 4y-4y^3 $is the marginal pdf of Y
 [/INST] We note that the probability density function is:
$$ f_{X,Y}(x,y) = \begin{cases} 8xy & 0 \leq y \leq x \leq 1 \\ 0 & \text{else} \end{cases} $$
We can visualize the three regions of interest for this problem,


*

*$\color{darkblue}{\text{The support of the distribution, the set }  S  \text{ of points } (x,y) \text{ such that } 0 \leq y \leq x \leq 1}$

*$\color{goldenrod}{\text{The set }  R_1  \text{ of points } (x,y) \text{ such that } x \leq \frac{1}{2}}$

*$\color{green}{\text{The set }  R_2  \text{ of points } (x,y) \text{ such that } y \geq \frac{1}{4}}$


as follows:

The conditional probability can be expressed as:
$$ \mathbb{P} \left[X \leq \frac{1}{2} \,\,\bigg\rvert\,\, Y \geq \frac{1}{4} \right] = \frac{\mathbb{P} \left[X \leq \frac{1}{2} , Y \geq \frac{1}{4} \right]}{\mathbb{P} \left[Y \geq \frac{1}{4} \right]} $$
The numerator probability is calculated by integrating the probability density function over the area where the event is true, which is $R_1 \cap R_2$ (and, since we don't care about zero probability mass, this region's intersection with the support $S$). We use the colored diagram to see what this region is and what the limits of integration are. We see that:
\begin{align*}
\mathbb{P} \left[X \leq \frac{1}{2} , Y \geq \frac{1}{4} \right] &= \iint_{R_1 \cap R_2} f_{X,Y}(x,y) \, dA \\
&= \iint_{R_1 \cap R_2 \cap S} f_{X,Y}(x,y) \, dA \\
&= \int_\frac{1}{4}^\frac{1}{2} \int_\frac{1}{4}^x 8xy \, dy \, dx \\
&= \int_\frac{1}{4}^\frac{1}{2} \left[ 4xy^2 \right]_{y = \frac{1}{4}}^{y=x} \, dx \\
&= \int_\frac{1}{4}^\frac{1}{2} \left(4x^3 - \frac{1}{4}x \right) \, dx \\
&= \left[x^4 - \frac{x^2}{8} \right]_\frac{1}{4}^\frac{1}{2} \\
&= \frac{1}{16} - \frac{1}{32} -\frac{1}{256} + \frac{1}{16\cdot8} \\
&= \frac{16-8-1+2}{256} \\
&= \frac{9}{256} \\
\end{align*}
The denominator probability is calculated similarly on $R_2$ (and its intersection with the support $S$, since its where the probability mass is). We use the colored diagram to see what this region is and what the limits of integration are. We see that:
\begin{align*}
\mathbb{P} \left[Y \geq \frac{1}{4} \right] &= \iint_{R_2} f_{X,Y}(x,y) \, dA \\
&= \iint_{R_2 \cap S} f_{X,Y}(x,y) \, dA \\
&= \int_\frac{1}{4}^1 \int_\frac{1}{4}^x 8xy \, dy \, dx \\
&= \int_\frac{1}{4}^1 \left(4x^3 - \frac{1}{4}x \right) \, dx \\
&= \left[x^4 - \frac{x^2}{8} \right]_\frac{1}{4}^1 \\
&= 1 - \frac{1}{8} - \frac{1}{256} + \frac{2}{256} \\
&= \frac{7}{8} + \frac{1}{256} \\
&= \frac{225}{256}
\end{align*}
Putting the results together, we see that the conditional probability we are looking for is:
$$ \mathbb{P} \left[X \leq \frac{1}{2} \,\,\bigg\rvert\,\, Y \geq \frac{1}{4} \right] = \frac{9}{225} $$
</s>