# Distribution of Max of 2 Uniforms with different support

I've got 2 independent draws from these two distributions :$X\sim U(0,1)$ and $Y\sim U(0,2)$.

I want to find $E(\max(X_,Y))$.

I know that for two (0,1) independent Uniforms:

$P(\max(X,Y)<z)=P(X<z)P(Y<z)=z^2$

However now when the support changes I'm struggling to figure it out. I thought maybe splitting it over the 2 supports because when z leaves X's support the CDf is 1. I tried to do a conditional thing like: $P(\max(X,Y)<z |z<1)$ but then I'd have to find P(z<1).

Context: Mechanism design problem with 2 bidders in a first price sealed bid auction so I wanted to calculate expected revenue.

• You have the right intuition, but you don't "condition" on z being less than 1. It's just a piece wise function. So breaking it up into those two cases is easier than you think. – Taylor Aug 4 '16 at 2:01
• @Taylor so I thought about that with doing z^2/2 from 0 to 1 and z/2 1 to 2. So piecewise cdf? – VCG Aug 4 '16 at 2:06
• yes that's right – Taylor Aug 4 '16 at 2:11
• If $Y>1$ then $Z$ is just $Y$ and otherwise it's the max of 2 std uniforms. – Glen_b Aug 4 '16 at 2:16
• If you were to draw the graphs of the CDFs--which I encourage you to do for its instructive value--you could easily visualize their product, which is the CDF of the max. The expectation is the area between this CDF and $1$, which can be found by subtracting the area beneath the CDF from $2$. That area obviously breaks into a parabola, a rectangle, and a triangle, allowing you immediately to write down the answer as $2 - (1/6+1/2+1/4)=13/12$. – whuber Aug 4 '16 at 14:32

Let $Z=\max(X,Y)$. It's always true by independence that
$$F_Z(z) = P(\max(X,Y) \le z) = P(X \le z)P(Y \le z).$$

If $0 \le z \le 1$, then $P(\max(X,Y) \le z) = z^2/2$. If $1 < z \le 2$ then $P(\max(X,Y) \le z) = z/2$.

You get the density by taking the derivative. The density is $f_Z(z) = z 1(0 \le z \le 1) + 1(1 < z \le 2)/2$. Then

$$E[\max(X,Y)] = \int_0^1 z^2dz + \int_1^2 z/2 dz = \frac{1}{3} + 1 - \frac{1}{4}$$

We can check this by taking the simulating data and taking the sample average with some R code. It should be close to our answer by the law of large numbers.

num <- 1000
x <- runif(num,0,1)
y <- runif(num,0,2)
df <- cbind(x,y)
mean(apply(df, 1, max))  # [1] 1.08731

• Perfect thanks. Don't know why I doubted myself before. – VCG Aug 4 '16 at 2:50