How to find the joint density function of two dependent random variables? I'm trying to find $f_{X,Y}(x,y)$ for two dependent random variables, where random variable $X$ is Gaussian with mean zero and variance $1$, and random variable $Y$ is: 
$$
Y = \left\lbrace
\begin{aligned}
& 0 &&\text{if}\quad X<0 \\
& 1 &&\text{if}\quad X\geq 0 
\end{aligned}\right.
$$
Any tips are much appreciated,
Thanks.
 A: The real random variable variable $X$ has distribution $\mathcal{N}(0,1)$. The variable $Y$ is discrete and is a function of $X$, defined by $Y = \mathbf{1}_{X\geq 0}$. Its conditional mass function is given by
$$
\mathbb{P}(Y=0|X=x) = \left\lbrace
\begin{aligned}
&1 &&\text{if}\quad x<0 \\
&0 &&\text{if}\quad x\geq 0
\end{aligned}
\right.
$$
$$
\mathbb{P}(Y=1|X=x) = \left\lbrace
\begin{aligned}
&0 &&\text{if}\quad x<0 \\
&1 &&\text{if}\quad x\geq 0
\end{aligned}
\right.
$$
i.e.
$$
\mathbb{P}(Y=y|X=x) = \left\lbrace
\begin{aligned}
&1-y &&\text{if}\quad x<0 \\
&y &&\text{if}\quad x\geq 0
\end{aligned}
\right.
$$
The mixed joint density $f_{X,Y}$ of $X$ and $Y$ is
\begin{aligned}
f_{X,Y}(x,y) &= \mathbb{P}(Y=y|X=x)\, f_X(x) \\
&= \left\lbrace
\begin{array}{ll}
\displaystyle\frac{1-y}{\sqrt{2\pi}}\exp\left(-\frac{x^2}{2}\right) &\text{if}\quad x<0 \\
\displaystyle\frac{y}{\sqrt{2\pi}}\exp\left(-\frac{x^2}{2}\right) &\text{if}\quad x\geq 0
\end{array}\right.
\end{aligned}
Note that this post is related.
