The mean value of $(X_1^2+X_2^2+\cdots X_N^2)/(X_1+X_2 + \cdots +X_N)$

expected valueprobabilityprobability distributions

Consider $N$ independent exponential distributed random variables $X_1, X_2, \cdots X_N$ with same parameter $\lambda$. What is the expected value of random variable, suppose N is very large:
$$
X=\frac{X_1^2+X_2^2+\cdots X_N^2}{X_1+X_2 + \cdots +X_N}
$$

By computer simulation, I found the answer is $2/\lambda$. The code is simple enough, however, due to so many random variables, I don't know how this problem can be formulated in simple analytical means. Here is the code:

In [1]: import numpy as np

In [3]: ar = np.random.exponential(size=10000)

In [4]: ar.mean()
Out[4]: 0.9996274823304305

In [5]: ar.dot(ar)/ar.sum()
Out[5]: 1.970052388599698

Best Answer

Here is an exact derivation for finite $n$. We first use the integral identity

$$z^{-1} = \int_0^{\infty} e^{-zs} ds $$

which is valid for $z > 0$. Furthermore, it follows that

$$\mathbb{E}\left[ \frac{X_1^2}{X_1 + \cdots + X_N} \right] = \mathbb{E}\left[ \frac{X_2^2}{X_1 + \cdots + X_N} \right] = \cdots = \mathbb{E}\left[ \frac{X_N^2}{X_1 + \cdots + X_N} \right] $$ by symmetry so it suffices to find only one of the above expected values and multiply by $N$ at the end.

Now,

$$ \mathbb{E}\left[ \frac{X_1^2}{X_1 + \cdots + X_N} \right] = \int_0^{\infty} \mathbb{E}[X_1^2e^{-(X_1 + \cdots + X_N)s}] \ ds = \int_0^{\infty} \mathbb{E}[X_1^2e^{-sX_1}] \mathbb{E}[e^{-sX_2}] \cdots \mathbb{E}[e^{-sX_N}] \ ds.$$

Note that moving the expected value inside the integral is justified since everything is non-negative. Now using the pdf of the exponential distribution, we can compute the following two quantities easily:

$$ \mathbb{E}[e^{-sX_i}] = \frac{\lambda}{\lambda + s} $$

and

$$ \mathbb{E}[X_1^2e^{-sX_1}] = \frac{2\lambda}{(\lambda + s)^3}.$$

So altogether, we have

$$\mathbb{E}\left[ \frac{X_1^2}{X_1 + \cdots + X_N} \right] = 2\lambda^n \int_0^{\infty} \frac{1}{(s+\lambda)^{n+2}} \ ds = \frac{2}{\lambda (n+1)}.$$

Therefore, our desired value is $\frac{2n}{\lambda(n+1)}.$ Non asymptotic results are much nicer :P.

Related Question