# Conditional Distributions

Suppose X is uniform in the interval [0, Y] and Y can either be 1 or 2 with equal probability.

How would I calculate P(X>1)?

This is what I'm trying to do:

$$f_x(x) = \int_a^b \! f_{X,Y}(x,y) \, \mathrm{d} y$$

where,

$$f_{X,Y}(x,y) = \sum\limits_{y=1}^{2}f_{X\mid Y=y}(x\mid y) * p_Y(y) = 3/4$$

Did I calculate the joint density correctly, because it feels a bit awkward adding pdf's like that.

Another trouble I'm having is figuring how to decide the limits of integration. I know a should be 1 but what should b be? Should it be 2 because that is technically the highest value X could take but can you only say that for the distribution $X\mid Y$ or can you say that for X also?

-

We have $X\gt 1$ precisely if $Y=2$ and a uniform on $[0,2]$ is greater than $1$. So the required probability is $(1/2)(1/2)$.
It is not difficult to find the cumulative distribution function of $X$. Nothing interesting happens outside $[0,2]$. For $0\le x\le 1$, we have $$F_X(x)=\Pr(X\le x)=\frac{1}{2}(x)+\frac{1}{2}(x/2).$$ For $1\lt x\le 2$, $$F_X(x)=\frac{1}{2}+\frac{1}{2}(x/2).$$