# What is the distribution of the product of a Bernoulli & a normal random variable?

I am struggling to find a solution on finding the distribution of following random variable:

$$Y = Z \cdot |X|$$

here, $Z$ is a random variable takes 1 or -1 with equal probability, and $X$ is a standard normal variate, and $|\cdot|$ denotes absolute value.

Can somebody help me with some pointer from where I should start?

-
What does ${\rm mod}(X)$ mean in this context? –  Macro Apr 25 '12 at 14:17
it is absolute of "x" –  Saptarshi Apr 25 '12 at 14:37
What is the distribution when $Z = -1$? When $Z = 1$? Then, integrate $Z$ out by averaging over those two situations and you will have a solution - this is related to the law of total probability (a.k.a. smoothing). Is this homework, by the way? –  Macro Apr 25 '12 at 14:42
Are $Z$ and $X$ independent? –  onestop Apr 25 '12 at 14:43
You may also stratify by whether or not $X$ is negative. Then you will have four equally likely combinations involving $X,Z$. Hint: All four of those combinations end up having the same marginal distribution. –  Macro Apr 25 '12 at 14:52

May I suggest you start from first principles? You seek the distribution of $Y$, so you should be asking yourself about the chance that $Y \le t$ for some arbitrary real value $t$. To handle the discreteness of $Z$, consider enumerating its possible values:

$$\Pr[Y \le t] = \Pr[Z\ |X| \le t] = \Pr[|X| \le t \text{ and }Z=1] + \Pr[-|X| \le t \text{ and } Z=-1].$$

Because you are assuming $X$ and $Z$ independent, the joint probabilities (connected by "$\text{and}$") are obtained by multiplication. The rest now is straightforward.

By doing the computations graphically (use a sketch of the PDF of $X$) you will likely note some opportunities for simplification of the answer; it reduces to a very simple expression in terms of the cumulative distribution function of $X$ itself.

-

$-X$ has the same distribution as $X$ since its density is symmetric about the origin, and $Z$ is likewise symmetric, therefore the result is ... yet another normal random variable.

It's instructive to ponder how $Y$ is impacted by changes in the parameter $p=\mathrm P(Z=1)$ of the Bernoulli random variable $Z$. Here is a plot of $Y$ as $p$ runs from $0$ to $1$:

Can you mentally confirm this animation by imagining $Y$ for $p=0$, $p=0.5$, and $p=1$, then doing a little interpolation?

-
Of course, $Z$ does have a standard normal distribution, but the original poster was trying to understand how to prove this. Aside from that, the fact that $-X$ and $X$ have the same (standard normal) distribution does not, by itself, prove the result. –  Macro Apr 26 '12 at 0:53
It follows from the aforementioned fact plus the symmetric nature of $Z$. If $Z$ was weighted unevenly then the result would have been different. You can prove this the laborious way but it's not necessary, and I dare say it's not good for sharpening intuition either. –  Emre Apr 26 '12 at 1:04
That's an important additional detail. Have you considered making it part of your answer? –  Macro Apr 26 '12 at 1:07
+1 Although I agree with @Macro that providing additional details would be nice, this answer reflects a good insight and greatly broadens the scope and interest of the original question. –  whuber Apr 26 '12 at 14:01
As Emre points out, it is not difficult to turn this into a "complete" proof: Note that $|Y| = |X|$ with probability one and so $|Y|$ is half-normal. Now, $Y$ and $-Y$ have the same distribution, so $Y$ is symmetric. Hence, $Y$ must be normal. :) –  cardinal Apr 26 '12 at 22:59

Here, I have done following calculation:

P(Y <= y)

=P(Z*mod(X) <= y)

=0.5P(mod(X) <= y) + 0.5P(-mod(X) <= y)

=0.5*[ P(-y <= X <= y) + P(mod(X) >= -y) ]

=0.5*[ 2Phi(y) - 1 + 1 - P(mod(X) < -y) ]

=0.5*[ 2Phi(y) - P(y <= X <= -y) ]

=Phi(y) because, 2nd component is probability of impossible event

Therefore Y have standard normal distribution.

Is my calculation is correct?

-
$P(y \leq X \leq -y)$ is not necessarily 0, since $y$ could be negative. –  Macro Apr 26 '12 at 1:09
Here is my modified calculation: from the 3rd line, 0.5*(P(|X|<=y + 1 - P(|X| <= -y))) = 0.5*(P(X <= y) - P(X <= -y) + 1 - P(X <= -y) + P(X <= y)) = P(X <= y) - P(X <= -y) + 0.5 = 2*P(X <= y) + c. So for this calculation Y does not seem to have Standard normal. Where did I make mistake? –  Saptarshi Apr 26 '12 at 1:51
I think your whole derivation is based on assuming that $y$ is positive. Maybe break it into cases based on the sign of $y$ and go from there? Also, it's hard to follow your argument in a straight line of text like it is in your comment - I suggest editing your answer, instead of posting modifications in comment form, to aide understanding. –  Macro Apr 26 '12 at 13:59