# Joint density with continuous and binary random variable

Assume $X\in\mathbb{R}$, $Y\in\{0,1\}$ are two random variables. What allows us to claim that $$f_{X}(x) = f_{XY}(x,1) + f_{XY}(x,0)$$ where $f_X(x)$ and $f_{XY}(x,y)$ are densities.

-
The definition, perhaps? – Did Mar 3 '13 at 16:11
What is $f_{XY}$ and how does it differ from plain vanilla $f$ which you say is a density? – Dilip Sarwate Mar 3 '13 at 16:11
My initially posted answer missed something, but I've edited to take that into account, and the answer is still just as simple. – Michael Hardy Mar 3 '13 at 18:38
@ Michael Hardy. Thank you. I upwoted your answer originally, but someone downvoted it after that. – arkadiy Mar 3 '13 at 18:50

Hi Hardy... He says $X\in \mathbb{R}$, so I thought he was referring to a mixture of discrete and cont. distributions. In that case, $P(X=x,Y=1)$ would become zero. – Bravo Mar 3 '13 at 17:01
Done. ${{{{{}}}}}$ – Michael Hardy Mar 3 '13 at 18:37
$$P(X\le x)=P(X\le x\mid Y=1)P(Y=1)+P(X\le x\mid Y=0)P(Y=0)\\ =P(X\le x, Y=1)+P(X\le x,Y=0)\\ f_X(x)=\frac{dP(X\le x)}{dx}=f_{XY}(x,1)+f_{XY}(x,0)$$