How to explain this summation reordering? Could anyone help me explain how can we take the $x$ out of the sum and reorder the summation? 
Let $\Omega$ be countable. Then, every random variable $X:\Omega\to\mathbb{R}$ is discrete, and reordering or summation gives
$$\sum_{\omega\in\Omega}|X(\omega)|P(\{\omega\})=\sum_{x\in X(\Omega)}|x|\sum_{w\in\{X=x\}}P(\{\omega\})=\sum_{x\in X(\Omega)}|x|P(X=x)$$
What I know is that $X$ is a function of $\omega$, but how can we take the $x$ out and get two summations?
Thanks for the help.
 A: First, we group all the values of $\omega$ according to which
ones give the same value of $X(\omega)$.
That is, we first take all the $\omega$ for which $X(\omega) = x_1$,
then the ones for which $X(\omega) = x_2$, and so forth.
And then we put "parentheses" around all the summands with the same
$X(\omega)$ value, so for what used to be a flat sum over all the $\omega$,
instead we add up all the summands in each of the groups and then add
all those results together; the same terms, just associated differently:
$$
\sum_{\omega\in\Omega}\lvert X(\omega)\rvert\, P(\{\omega\})
= \sum_{x\in X(\Omega)}\,\sum_{\omega\in\{X=x\}}
     \lvert X(\omega)\rvert\, P(\{\omega\}).
$$
But if $\omega\in\{X=x\}$, then $\lvert X(\omega)\rvert = \lvert x\rvert$.
Moreover, $\lvert x\rvert$ is the same value for every $\omega\in\{X=x\}$,
so
$$
\sum_{\omega\in\{X=x\}} \lvert X(\omega)\rvert\, P(\{\omega\})
= \sum_{\omega\in\{X=x\}} \lvert x\rvert\, P(\{\omega\})
= \lvert x\rvert \sum_{\omega\in\{X=x\}} P(\{\omega\}).
$$
Last of all,
$$
\sum_{\omega\in\{X=x\}} P(\{\omega\}) = P(X = x).
$$
A: Let $A_x = \{\omega: X(\omega)=x\}=\{X=x\}$. We have
$\Omega = \cup_x A_x$ and the union is disjoint. Next,
\begin{align} \sum_{\omega} |X(\omega)| P(\omega) &= \sum_x \sum_{\omega \in A_x} |X(\omega)| P(\omega)\\ &=\sum_x\sum_{\omega \in A_x} |x|P(\omega)\\ &= \sum_x |x| P(A_x)\\& =\sum_x |x|P(X=x). \end{align} 
A: Since $\Omega$ is countable, then there exists a countable set of values the random variable can realise. $$X(\Omega):=\{x\in\Bbb R: x=X(\omega),\omega\in\Omega \}$$
Because $X$ is an onto function, we can partition the countable set $\Omega$ using these values, and define the disjoint subsets as:
$$\{X=x\}: = \{\omega\in\Omega: x=X(\omega)\}$$
Thus: $\Omega =\bigcup\limits_{x\in X(\Omega)}~\bigcup\limits_{\omega\in \{X=x\}}\{\omega\}~$ and since all such $\{X=x\}$ are mutually disjoint then:
$$\begin{align}\sum_{\omega\in\Omega}\lvert X(\omega)\rvert\,\mathsf P(\{\omega\})~=~ &\sum_{x\in X(\Omega)}~\sum_{\omega\in\{X=x\}} \lvert X(\omega)\rvert\, \mathsf P(\{\omega\})
\\[1ex] ~=~ & \sum_{x\in X(\Omega)}\lvert x\rvert\sum_{w\in\{X=x\}}\mathsf P(\{\omega\})\end{align}$$
The inner series is the sum of the probabilities of outcomes in a set; and that is the probability measure of the set. 
$$\begin{align}\sum_{\omega\in\Omega}\lvert X(\omega)\rvert\,\mathsf P(\{\omega\})~=~ & \sum_{x\in X(\Omega)}\lvert x\rvert \,\mathsf P(\{X=x\})\end{align}$$
$\lozenge$ ?
