# The covariance between sum of random variables and maximum of random variables

Let

$X_1,\ldots,X_n,\; n\ge1$ — independent random variables $U(0,1),$

$S_n=\sum_{i=1}^n X_i,$

$Z_n=\max(X_1,\ldots,X_n).$

Calculate

$\mathrm{cov}(S_n,Z_n).$

Solution:

$\mathrm{cov}(S_n,Z_n)=\mathrm E(S_nZ_n)-\mathrm ES_n \mathrm EZ_n,$

$\mathrm E(S_nZ_n)=n \mathrm E(X_1 \max(X_1,\ldots,X_n)).$

Let $U=\max(X_1,\ldots,X_n),\,V=X_1$.

For $0 \le v \le u \le 1$ we have

$F(v,u) = \mathbb P(V \le v, U \le u) = \mathbb P(U \le u) - \mathbb P(U \le u, V > v) = \mathbb P(X_1 \le u,\ldots, X_n \le u) - \mathbb P(v < X_1 \le u, X_2 \le u,\ldots, X_n \le u) = vu^{n-1} .$

One don't need to calculate the distribution function for the other areas.

$f(v,u)= \frac{\partial^2}{\partial v \, \partial u} F(v,u) = (n-1)u^{n-2},$

$\mathrm E(VU) = \int_0^1 \int_0^u vu(n-1)u^{n-2} \mathrm dv \, \mathrm du = \frac{n-1}{2(n+2)},$

$\mathrm E(S_nZ_n) = \frac{n(n-1)}{2(n+2)} ,$

$\mathrm ES_n = n \mathrm EV = \frac n2 ,$

$\mathrm EZ_n = \mathrm EU = \frac n{n+1} .$

What is wrong? The problem must be with $f(v,u)$ because $\int_0^1 \int_0^u f(v,u) \mathrm dv \, \mathrm du \neq 1 .$

• Why the downvote? I can´t comprehend that. – callculus Jul 13 '18 at 19:57
• One of the $X_k$ is $=Z_n$. You need to treat that one special. – herb steinberg Jul 13 '18 at 20:58
• I should have said one of the $X_k$ is $Z_n$, not just equal. – herb steinberg Jul 14 '18 at 1:28