Expectation of quotient of random variables

You can prove as follows:

$$\begin{align} \mathsf E \Big[ \frac{\sum _{i=1}^k X_i}{\sum _{i=1}^n X_i} \Big] & = \sum _{m=0}^{\infty} \mathsf E \Big[ \frac{\sum _{i=1}^k X_i}{\sum _{i=1}^n X_i} \mid {\sum _{i=1}^n X_i}=m\Big]\mathsf P({\sum _{i=1}^n X_i}=m) \\[1ex] & = \sum _{m=0}^{\infty} \mathsf E \Big[ \frac{\sum _{i=1}^k X_i}{m} \mid {\sum _{i=1}^n X_i}=m\Big]\mathsf P({\sum _{i=1}^n X_i}=m) \\[1ex] & = \sum _{m=0}^{\infty} \frac{1}{m} \sum _{i=1}^{k}\mathsf E \Big[ X_i \mid {\sum _{i=1}^n X_i}=m\Big]\mathsf P({\sum _{i=1}^n X_i}=m) \\[1ex] & = \sum _{m=0}^{\infty} \frac{1}{m} \frac{km}{n} \mathsf P({\sum _{i=1}^n X_i}=m) \\[1ex] & = \frac{k}{n} \sum _{m=0}^{\infty}\mathsf P({\sum _{i=1}^n X_i}=m) \\[1ex] & = \frac{k}{n} \end{align}$$ Note: I have used identical distribution of $X_i$s and this fact that $E \Big[ {\sum _{i=1}^n X_i} \mid {\sum _{i=1}^n X_i}=m\Big] = m$ to conclude that $E \Big[ X_i \mid {\sum _{i=1}^n X_i}=m\Big]= \frac{m}{n}$.


$\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}$