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 denite integrals.

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

Thank you

Re: Mixing a uniform distribution with a normal distribution

Re: Mixing a uniform distribution with a normal distribution

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)??

Re: Mixing a uniform distribution with a normal distribution

Thanks to both of you, my problem is solved.