Covariance of sum and maximum

covarianceexpected valueprobabilityprobability distributionsuniform distribution

I have the task 🙂

$X_1, X_2$ are independent and have uniform distribution on $(0,1).$ Calculate $\operatorname{Cov}(X_1+X_2,\max(X_1,X_2))$.

I did it in this way.
The distriburion of $\max(X_1,X_2)$ is $P(\max(X_1,X_2)=x)=2x$ on $(0,1)$. In this way we have:
$E(X_1+X_2)\cdot E\max(X_1,X_2)=1 \cdot \frac{2}{3}$

\begin{align}
& E((X_1+X_2) \cdot \max(X_1,X_2))=2 E(X_1\cdot \max(X_1,X_2)) \\[6pt]
= {} &2 \cdot \int_0^1 E(t \cdot \max(t,X_2))\cdot f_{X_1}(t) \,dt=2\cdot \int_0^1 t \cdot \frac{t+1}{2} \, dt=\frac{5}{6}
\end{align}

So the covariance is equal $\frac{1}{6}$

But I have the correct answer to this task and it is $\frac{1}{12}$

Where did I mistake?

Thanks in advance.

Best Answer

In fact $\Pr(\max\{X_1,X_2\}=x) = 0.$ I assume you must have meant that the value of the probability density function of $\max\{X_1,X_2\}$ at $x$ is $2x.$

$$ \operatorname E(\max\{t,X_2\}) = \operatorname E(\operatorname E(\max\{t,X_2\} \mid \mathbf 1[X_2>t])) $$ where $\mathbf 1[X_2>t] = 1$ or $0$ according as $X_2>t$ or not. $$ \operatorname E(\max\{t,X_2\} \mid \mathbf 1[X_2>t]) = \begin{cases} t & \text{if } X_2\le t, \\ (1+t)/2 & \text{if } X_2 > t. \end{cases} $$ And the expected value of that is \begin{align} & t\cdot\Pr(X_2\le t) + \frac{1+t} 2\cdot\Pr(X_2>t) \\[8pt] = {} & t^2 + \frac{1+t} 2\cdot(1-t) = \frac{1+t^2} 2 . \end{align}

Related Question