How to compute the expectation of this problem? Assume there are $n+1$ nodes $V = \{v_0,v_1,\dots,v_n\}$, and each node $v_i$ has a value $f_i$ and the weight between $v_0$ and each node $v_i \in \{v_1,\dots,v_n\}$ is $w_{0i}$. Both values and weights are sampled from $[0,1]$ uniformly and independently.
The difference between $v_0$ and $v_i$ is defined as $$\delta_i := w_{0i} \cdot |f_0-f_i|, \quad i = 1,\ldots,n.$$ Suppose that $10$ divides $n$ and denote by $V' \subset V$ the set of $\frac{9}{10}n$ nodes for which $\delta_i$ is smallest. Then I am wondering how one could compute the expectation $$\mathbb{E}\left[\sum_{v_j \in V'}w_{0j} \cdot |f_0-f_i|\right].$$
 A: I don't understand the statement "and the difference between node $v_j \in V'$" belongs to the last $90\%$ less difference.
Anyway, the expectation should be as follows:
\begin{align*}
\mathbb{E}\left[\sum_{v_j\in V'} w_{0j} \lvert f_0 - f_j \rvert \right] & = \sum_{v_j\in V'} \mathbb{E}\left[ w_{0j} \lvert f_0 - f_j \rvert \right] \\
& \stackrel{(a)}{=}  \sum_{v_j\in V'}\mathbb{E}\left[ w_{0j}\right] \mathbb{E}\left[\lvert f_0 - f_j \rvert \right] \\
& \stackrel{(b)}{=} \sum_{v_j\in V'} \frac{1}{2}\cdot\frac{1}{3} \\
& = \sum_{j=1}^{\frac{9}{10}n} \frac{1}{6} \\
& = \frac{3}{20}n,
\end{align*}
where $(a)$ holds for independence, while $(b)$ holds because $\mathbb{E}[w_{0j}] = 1/2$ and because
\begin{align*}
\mathbb{E}\left[\lvert f_0 - f_j \rvert \right] & \stackrel{(c)}{=} \int_0^1 \int_0^1 \lvert x - y \rvert dydx \\
& = \int_0^1 \left(\int_0^x (x - y) dy + \int_x^1 (y-x) dy\right) dx \\
& = \int_0^1 x^2 - \frac 12 x^2 + \frac 12 (1-x^2) - (1-x)xdx\\
& = \int_0^1\frac 12 -x + x^2 dx \\
& = \frac 12 - \frac 12 + \frac 13 \\
& = \frac 13.
\end{align*}
Observe that $(c)$ holds for independence as well.
