# Mixing a uniform distribution with a normal distribution

• July 8th 2011, 06:49 AM
solvj
Mixing a uniform distribution with a normal distribution
Here is my Problem.

Let X~Uniform(0,2) and Y~Normal(0,1) be independent random variables. Let

Z ={1 if X > Y
{2 if X <Y

Find E[Z] and V ar[Z]. You may leave your answers in terms of de nite integrals.

My big question is, how can we join a uniform and a normal distribution on the same probability density function.

Thank you
• July 8th 2011, 07:08 AM
CaptainBlack
Re: Mixing a uniform distribution with a normal distribution
Quote:

Originally Posted by solvj
Here is my Problem.

Let X~Uniform(0,2) and Y~Normal(0,1) be independent random variables. Let

Z ={1 if X > Y
{2 if X <Y

Find E[Z] and V ar[Z]. You may leave your answers in terms of denite integrals.

My big question is, how can we join a uniform and a normal distribution on the same probability density function.

Thank you

If you know $x$ you can find $P(Y, which is the conditional probability $P(Z=1|X=x)$ that $Z=1$. Then integrate this multiplied by the pdf of $X$ to get the unconditional probability that $Z=1$.

CB
• July 8th 2011, 08:02 AM
chisigma
Re: Mixing a uniform distribution with a normal distribution
Quote:

Originally Posted by solvj
Here is my Problem.

Let X~Uniform(0,2) and Y~Normal(0,1) be independent random variables. Let

Z ={1 if X > Y
{2 if X <Y

Find E[Z] and V ar[Z]. You may leave your answers in terms of denite integrals.

My big question is, how can we join a uniform and a normal distribution on the same probability density function.

Thank you

Some cautions have to be taken because X and Y are continuos variables and Z is a discrete variable. The most sure way is to valuate the probability...

$P\{X > Y\}= P\{X > \alpha\}\ P\{Y < \alpha\}$ (1)

The first step...

$P\{X > \alpha\} = 1- \frac{\alpha}{2}\ ,\ 0< \alpha<2 ; 1 , \alpha<0 ; 0 , \alpha > 2$ (2)

$P\{Y < \alpha\} = \frac{1}{2}\ (1+ \text{erf}\ \frac{\alpha}{\sqrt{2}})$ (3)

Now other steps are...

a) use (2) and (3) to obtain (1)...

b) compute the derivative $\pi (\alpha)$ of (1) respect to $\alpha$ ...

c) compute...

$P\{Z=1\} = \int_{-\infty}^{+ \infty} \pi(\alpha)\ d \alpha$ (4)

d) use the result c) to compute $P\{Z=2\}$ , $E \{Z\}$ , $V\{Z\}$...

All these steps are left to You...

Kind regards

$\chi$ $\sigma$
• July 8th 2011, 08:05 AM
solvj
Re: Mixing a uniform distribution with a normal distribution
So if I understand quite good, I should get P(x>Y)=P(Z=1|X=x)

I need to find P(X>Y)=P(Z=1)=integral from 0 to 2 (P(Z=1|X=x)*P(X=x)dx)
But what is P(x>Y)??
• July 8th 2011, 08:27 AM
solvj
Re: Mixing a uniform distribution with a normal distribution
Thanks to both of you, my problem is solved.