$\text{X and Y are a pair of jointly continuous random variables:}$
$f_{X,Y}(x, y) = \begin{cases} \text{c,} &\text{the shaded region}\\ \text{0,} &\text{elsewhere}\\ \end{cases}$
$\text{a- find the value of c.}$
$\text{b- find the marginal pdf of X and Y.}$
$\text{c- find E[X|Y=1/4] and Var[X|Y=1/4]}.$
$\text{d- find the conditional PDF of X knowing that Y=3/4.}$
$\text{what I did:}$
for the first question, we know that the function is constant thus we can simply multiply the shaded surface and c and this value will equal 1. $$c\times S = \frac{c}{2} = 1$$ $$c = 2$$
for the marginal pdf of each variable: the definition domain is: $$\Delta(x,y)=\text{{0⩽x⩽1 and 0⩽y⩽1, and [0.5-x⩽y⩽1-x, or 3/2-x⩽y]}}$$ $$f_X(x) = \int^{1/2-x}_{1-x}cdy + \int^{3/2-x}_{1}cdy$$ $$f_X(x) = 2x$$ $$f_Y(y) = \int^{1-y}_{1/2-y}cdx + \int^{1}_{3/2-y}cdx$$ $$f_Y(y) = 2y$$ however when I tried to compute the expectation I got a negative value: $$E[X|Y] = \int^{1-y}_{1/2-y}x \times \frac{f(x,y)}{f(y)}dx + \int^{1}_{3/2-y}x \times \frac{f(x,y)}{f(y)}dx$$ $$E[X|Y] = \int^{1-y}_{1/2-y}\frac{x}{y}dx + \int^{1}_{3/2-y}\frac{x}{y}dx$$ $$E[X|Y] = \frac{8y - 2 - 4y}{8y}$$ $$E[X|Y=1/4] = -0.5$$
I also computed in the same way the variance and found that it was negative [obviously wrong], thus I would be sincerely grateful to know where I made my mistake.




