# Product of a Discrete Variable and a Continuous Variable

How would I go about obtaining the probability density function of a random variable that results in a product of a discrete variable and a continuous variable? I know that if $$X$$ and $$Y$$ are both continuous, then the probability density function of $$Z=XY$$ is given by: $$f_Z(z)=\int_{-\infty}^{\infty}f_X(x)f_Y\left(\frac{z}{x}\right)\frac{1}{|x|}dx$$ but what is the method of obtaining $$f_Z(z)$$ if $$X$$ is a discrete variable and $$Y$$ is continuous?

More specific to my case, I have $$X$$ following a Rademacher distribution, that is \begin{align*} P(X=x) = \begin{cases} \frac{1}{2} & x = -1\\ \frac{1}{2} & x = 1\\ 0 & otherwise \end{cases} \end{align*} and $$Y$$ following a Rayleigh distribution. What would be the product of these two random variables?

• Use $f_X(x)=\sum_k P(X=k)\delta (x-k)$ (see en.wikipedia.org/wiki/Dirac_delta_function). – J.G. Dec 25 '18 at 13:13
• @J.G. but does that $f_Z(z)$ formula still apply to this case? Is $f_X(x)$ considered continuous? – rea Dec 25 '18 at 13:35
• Yes, it applies. – J.G. Dec 25 '18 at 14:26

We can try from the definition: $$\begin{split} F_Z(z) &= \mathbb{P}[Z \le z] \\ &= \mathbb{P}[XY \le z] \\ &= \sum_{k=1}^\infty \mathbb{P}[XY \le z, X = k] \\ &= \sum_{k=1}^\infty \mathbb{P}[Y \le z/k] \mathbb{P}[X = k] \\ &= \sum_{k=1}^\infty F_Y(z/k) f_X(k). \end{split}$$
Note I did not handle the case where $$k \le 0$$...
One can alternatively condtion on $$Y$$ similarly and end up with an integral instead of a sum: $$\begin{split} F_Z(z) &= \mathbb{P}[Z \le z] \\ &= \mathbb{P}[XY \le z] \\ &= \int_\mathbb{R} \lim_{\epsilon \to 0} \mathbb{P}[XY \le z, |Y-y| < \epsilon] dy \\ &= \int_\mathbb{R} F_X(z/y) f_Y(y) dy. \end{split}$$
For the special case of Rademacher $$X$$, $$P(Z\le z)=P(X=1)P(Y\le z)+P(X=-1)P(Y\ge -z)=\frac{F_Y(z)+1-F_Y(-z)}{2}.$$with $$F_Y$$ the cdf of $$Y$$.