Taking spheres from urn - expected value sum of number In one urn we have $n$-spheres with numbers from $1$ to $n$. We are taking one of them. Let $k$ be a number of this sphere. Then we return this sphere to urn and we are taking (without returning) $k$ spheres. Let $E(n)$ be expected value  sum of numbers on these spheres. Find $E(n)$.
I suppose that $k$ is random variable. Expected value of $k$ is of course $\frac{n+1}{2}$. But I don't have idea what I shoul do next. I will grateful for your help. Thanks in advance!
 A: The first number drawn is equally likely to be any one of $1,2,3,\dots, n$. So each number has probability $\frac{1}{n}$ of being drawn.
Suppose that we have drawn the number $k$. Then at the second stage we draw $k$ balls, say in some order. Let $X_i$ be the number on the $i$-th ball drawn in the second stage. Then by the linearity of expectation, 
$$E(X_1+X_2+\cdots +X_k)=E(X_1)+E(X_2)+\cdots +E(X_k)=k\cdot\frac{n+1}{2}.$$
So the conditional expectation of the second stage sum, given that the ball drawn in the first stage is $k$, is equal to
$$\frac{(k)(n+1)}{2}.$$
Thus the expectation of the second stage sum is
$$\frac{1}{n}\cdot \frac{(1)(n+1)}{2}+\frac{1}{n}\cdot \frac{(2)(n+1)}{2}+\cdots + \frac{1}{n}\cdot \frac{(n)(n+1)}{2}.\tag{1}$$
Using the fact that $1+2+3+\cdots +n=\frac{(n)(n+1)}{2}$, we can greatly  simplify Expression (1). 
A: First: This notation is no good - you're already using $n$ for something else!
Let's say that $K$ is the (random) number of balls to be drawn, $X_i$ is the value of the $i$th ball drawn (after choosing $K$), and $N:=X_1+\cdots+X_K$ is the sum of the $K$ balls drawn.
Note that
$$
P(N=m)=P(N=m,\ K=1)+\cdots+P(N=m,\ K=n),
$$
since these probabilities are disjoint. Now, note that
$$
P(N=m,\ K=j)=P(X_1+\cdots+X_K=m,\ K=j)=P(X_1+\cdots+X_j=m,\ K=j).
$$
Further, because the events $\{K=j\}$ and $\{X_1+\cdots+X_j=m\}$ are independent, we can write
$$
\begin{align*}
P(X_1+\cdots+X_j=m,\ K=j)&=P(X_1+\cdots+X_j=m)P(K=j).
\end{align*}
$$
So, we have
$$
\begin{align*}
\DeclareMathOperator*{\E}{\mathbb{E}}\E[N]&=\sum_{m=1}^{n(n+1)/2}mP(N=m)\\
&=\sum_{m=1}^{n(n+1)/2}m\sum_{j=1}^{n}P(X_1+\cdots+X_j=m)P(K=j)\\
&=\sum_{j=1}^{n}P(K=j)\sum_{m=1}^{n(n+1)/2}mP(X_1+\cdots+X_j=m).
\end{align*}
$$
Do you see any way that you could simplify this expression?
(Note that, in addition to wanting you to be able to finish the problem, I've left it written in this form so that you might spot an underlying principle here. See what you can find!)
