# how the left side of this formula $\mathbb{E}[Y_i \sum_{j\neq i} Y_j ] = \sum_{j\neq i}\mathbb{E}[Y_i Y_j]$ conduct to the right side?

i am learning this justification

{\displaystyle {\begin{aligned} \mathbb{E}[\frac{2}{n} Y_i \sum_{j=1}^n Y_j] &=\frac{2}{n}\mathbb{E}[Y_i \sum_{j\neq i} Y_j + Y_i^2] \quad (1.1)\\ &=\frac{2}{n}\left(\sum_{j\neq i}\mathbb{E}[Y_i Y_j] + \mathbb{E}[Y_i^2]\right) \quad (1.2)\\ &=\frac{2}{n}\left(\sum_{j\neq i}\mathbb{E}[Y_i] \mathbb{E}[Y_j] + \mathbb{E}[Y_i^2]\right) \quad (1.3) \end{aligned}}}

i've understood most of this justification, except a part of equation (1.1) to (1.2)

$$\mathbb{E}[Y_i \sum_{j\neq i} Y_j ] = \sum_{j\neq i}\mathbb{E}[Y_i Y_j]$$

which rule or definition take $$Y_i$$ into $$[Y_i Y_j]$$?

firstly, the distributive law of arithmetic gives following equation inside the square brackets $$Y_i \sum_{j\neq i} Y_j = \sum_{j\neq i} Y_i Y_j$$
$$\mathbb{E} [\sum_{j\neq i} Y_i Y_j] = \sum_{j\neq i} \mathbb{E} [Y_i Y_j]$$
It is simply the distributive law of arithmetic. $$Y_i\times \sum=\sum Y_i\times$$ terms in sum.