# Product of three independent random variables

We are given three independent random variables $X, Y, Z$.

$X$ has the following Bernoulli distribution: $P(X=1)=\frac{3}{4}, \ P(X=0) = \frac{1}{4}$

$Y$ has a uniform distribution on the interval $[-1,1]$

$Z$ has a uniform distribution on the interval $[0,2]$

How to establish the distribution of random variable $W=XY - (1-X)Z$?

I know how to solve a similar problem, that is if we are given a random variable $X$ and its distribution and are asked to find the distriobution of $g(X)$, for example $X^2, \ aX+b,$ etc

But I don't know what to do if there are several random variables and of different types of distributions.

Could you help?

## 1 Answer

Using the tower rule and the independence of our random variables we write that

$F_W(x)=P(W(X,Y,Z)<x)=E[P(W(X,Y,Z)<x|X)]=$ $P(W(X,Y,Z)<x|X=1)\frac{3}{4}+P(W(X,Y,Z)<x|X=0)\frac{1}{4}=$ $P(W(1,Y,Z)<x)\frac{3}{4}+P(W(0,Y,Z)<x)\frac{1}{4}.$

Since $W(1,Y,Z)=Y,\text{ and }W(0,Y,Z)=-Z$ we have finally $$F_W(x)=P(Y<x)\frac{3}{4}+P(-Z<x)\frac{1}{4}.$$

Given that $Y$ is uniformly distributed over $[-1,1]$ and $-Z$ is uniformly distributed over $[-2,0]$, $$P(Y<x)=\begin{cases}0 &\text{ if } x<-1\\ \frac{1}{2}(x+1) &\text{ if } -1\le x \le 1\\ 1&\text{ if } x>1 \end{cases},$$ and $$P(-Z<x)=\begin{cases}0 &\text{ if } x<-2\\\frac{1}{2}x+1& \text{ if } -2\le x \le 0\\ 1&\text{ if } x>0 \end{cases}.$$

The rest is easier to be drawn than told. Here is $F_W(x)$ the distribution function of $W$:

Edited to better explain the first steps of the calculation

Rather than referring to the tower rule we can do the first steps directly:

$P(W(X,Y,Z)<x)=$ $P(\{W(X,Y,Z)<x\}\cap \{X=1\}\cup \{W(X,Y,Z)<x\}\cap \{X=0\})=$ $P(\{W(X,Y,Z)<x\}\cap \{X=1\})+P(\{W(X,Y,Z)<x\}\cap \{X=0\})=$ $P(\{W(1,Y,Z)<x\}\cap \{X=1\})+P(\{W(0,Y,Z)<x\}\cap \{X=0\}).$

And now, here comes independence:

$P(\{W(1,Y,Z)<x\}\cap \{X=1\})=P(W(1,Y,Z)<x)P(X=1)=P(W(1,Y,Z)<x)\frac{3}{4}$ $P(\{W(0,Y,Z)<x\}\cap \{X=0\})=P(W(0,Y,Z)<x)P(X=0)=P(W(0,Y,Z)<x)\frac{1}{4}.$

• Thank you very much. Could you tell me why this equation holds? $$P(W(X,Y,Z)<x)=E[P(W(X,Y,Z)<x|X)]$$ Feb 28 '15 at 7:45
• The rest of calculations is clear to me. I suppose it somehow follows from en.wikipedia.org/wiki/Law_of_total_expectation , but I don't see how, at the moment. Feb 28 '15 at 8:15
• @Hagrid: Yes, the first step of my solution is based on en.wikipedia.org/wiki/Law_of_total_expectation. I will add some explanatory notes to my answer so you get full satisfaction.
– zoli
Feb 28 '15 at 9:08
• @Hagrid: I did the promised edits.
– zoli
Feb 28 '15 at 9:31
• Thank you. Everything is clear to me now. Feb 28 '15 at 12:01