TITLE: joint distribution, discrete and continuous random variables
QUESTION [19 upvotes]: This may be trivial, but if X is a random variable uniformly distributed over $[0,1]$ and Y is a discrete random variable such that $\mathbb{P} (Y=y_1) = \lambda \in (0,1]$ and $\mathbb{P} (Y=y_2) = 1 - \lambda$. Now I am seeking to compute the expectation of (a linear function) of the random variable X conditional on Y. Is this possible? Can we think of a "joint distribution" of two random variables where one random variable has a continuous density function and the other is discrete?
Thank you

REPLY [4 votes]: You already got a good answer to your specific question, but I would like to add a general remark. Yes, you can consider the joint distribution of a continuous r.v. $X$ and a discrete r.v. $Y$. One way to do it is to consider the joint CDF:
$$
F_{XY}(x,y)=P(X\leq x,Y\leq y).
$$
This is well defined for any two r.v. and you can compute marginal and conditional probabilites and densities from it.