I am having some issues to solve the following question...
Given the continuous random variables X and Y, the joint PDF
$$f(x,y)=\begin{cases}2 & \text{in }S\\0 & \text{otherwise}\end{cases}$$
and $S=\left\{(x,y)|x\geq 0;y\leq 1;0\leq x+y \leq 1 \right\}$, find the PDF $f(y|x)$ of $Y$ given $x=X$.
What I did so far was identifying the region S graphically, which already presents a problem: the region appears to be infinite! (all $(x,y)$ pairs between the the functions $y=-x$ and $y=-x+1$ for $x$ positive satisfy)
1) In case the region is really infinite, is this problem solvable? How?
2) If not, let us consider that a missing constraint would limit the region to an isosceles triangle with vertices $(0,0)$, $(1,0)$ and $(0,1)$. Would my method below be the correct one to solve it?
Here is my attempt:
I know that the conditional probability could be obtained by
$$f(y|x)=\frac{f(x,y)}{f(x)}$$
and in order to follow, I would need to marginalize
$$f(x)=\int f(x,y)dy$$.
Inside the triangular region, I would have that $f(x,y)=2$ and $0 \leq y \leq 1-x$, so:
$$f(x)=2\int_{0}^{1-x}dy=2(1-x)$$.
then,
$$f(y|x)=\frac{2}{2(1-x)}=\frac{1}{1-x}$$
and finally:
$$f(y|x=X)=\frac{1}{1-X}$$
Is this correct? What would be the domains of $f(x)$ and $f(y|x)$?
Question 1
No, the problem is not solvable as given because this joint PDF has a fixed height of $2$ over the infinite region of $S$, so $\int_{-\infty}^\infty\int_{-\infty}^\infty f(x,y)dxdy=\infty$. According to the rules of probability distributions, $\int_{-\infty}^\infty\int_{-\infty}^\infty f(x,y)dxdy$ should be $1$, so this joint PDF does not follow the rules of probability.
Question 2
You probably just forgot about this, but I think you need to make $f(x)$ a piecewise function, like so:
$$f(x)=\begin{cases}2(1-x) & 0 \leq x \leq 1 \\ 0 & \text{otherwise}\end{cases}$$
Obviously, the domain of this function is just $\Bbb{R}$.
Similarly, $f(y|x)$ needs to be piecewise because outside of $0 \leq y \leq 1-x$, $f(x,y)=0$, so $f(y|x)=0$:
$$f(y|x)=\begin{cases}\frac{1}{1-x} & 0 \leq y \leq 1-x \\ 0 & \text{otherwise}\end{cases}$$
The domain of this function is $f(x) > 0$, or $0 \leq x < 1, y \in \Bbb{R}$. This is because if $f(x)=0$, then since $f(y|x)=\frac{f(x,y)}{f(x)}$, we get a division by 0 error, which means $f(x)=0$ is not in the domain of $f(y|x)$.