Show that the average of n observations is equal to the expected value with the density function with index k is equal to the number of observations equal to k divided by the total number of observation, that is, $$\frac{y_1 +...+y_n}{n} = \sum_{k=1}^{n}k*p_k$$ there $p_k=\#(y_i: y_i = k)/n$
Any hints? I really don't know how to show the statement above.
Let it be that the observations take values in set $\left\{ k_{1},\dots,k_{m}\right\} $ (where the $k_{i}$ are distinct) and that for $i=1,\dots,m$ exactly $n_{i}$ of the observations take value $k_{i}$.
Then: $$\tag{1}n_1+\cdots+n_m=n$$
and:
$$\tag{2}y_{1}+\cdots+y_{n}=k_{1}n_{1}+\cdots+k_{m}n_{m}$$
Note that for $i=1,\dots,m$ here: $$\tag{3}p_{k_{i}}=\frac{n_{i}}{n}$$
Dividing both sides in the second equality by $n$ leads to: $$\tag{4}\frac{y_{1}+\cdots+y_{n}}{n}=k_{1}p_{k_{1}}+\cdots+k_{m}p_{k_{m}}$$
The RHS you could also write as $\sum_k kp_k$ where $p_k=0$ if no observation takes value $k$.