TITLE: Expectation of quotient of random variables
QUESTION [9 upvotes]: Let $X_1,...X_n$ be independent, identically distributed and nonnegative random variables, and let $k\le n$. Compute: $$E\left[{\sum_{i=1}^k X_i\over \sum_{i=1}^n X_i}\right].$$ This question has already been asked: Expectation of random variables ratio.
The thing is that my teacher told me that the solution in the link wasn't really a "solution" the correct thing to do is to compute the conditional expectation of $${\sum_{i=1}^k X_i\over \sum_{i=1}^n X_i}$$ given that $\sum_{i=1}^n X_i=m$ where $m$ is a positive integer, but I have no idea how to do this, I would really appreciate if you can help me with this problem.

REPLY [8 votes]: $\begin{align}
\text{Let }\qquad M &=\sum_{i=1}^n X_i & \text{Define a new random variable}
\\[2ex]
\mathsf E(\sum_{i=1}^k X_i / \sum_{i=1}^n X_i)
 & = \mathsf E(\mathsf E(\sum_{i=1}^k X_i / M\mid M)) & \text{Law of Iterated Expectation}
\\[1ex]
 & = \mathsf E(\sum_{i=1}^k \mathsf E(X_i/M\mid M)) & \text{Linearity of Expectation}
\\[1ex]
 & = \mathsf E(\sum_{i=1}^k 1/n) & \{X_i\}\sim\text{ i.i.d.}
\\[1ex]
 & = k/n
\end{align}$