Let $(\Omega, P)$ be a probability space. One definition for the expected value of a random variable $X$ is
$$E(X)=\sum_{x\in \mathbb{R}} xP(X=x).$$
The notes I am reading say that this definition is equivalent to
$$E(X)=\sum_{\omega \in \Omega} X(\omega)P(\omega).$$
Okay, I sort of understand why, but not completely. Since the set $\left\{X=x\right\}=\emptyset$, then of course $P(X=x)=0$, so we only need to consider the real values $X(\omega)$ for each $\omega \in \Omega$. What I don't understand is why $P(X=x)$ gets replaced with $P(\omega)$. It seems like that change is made simply because the set we are taking the sum over changes, but somehow that is an unsatisfactory reason for me. Can anyone give me another reason? Thank you!
Since $X : \Omega \mapsto \mathbb{R}$, you can think of the distribution (or expectation) of $X$ either in terms of a probability function over the domain or range of this function, it's really just a conceptual difference.
Also by looking at the sum $\sum_{\omega \in \Omega} X(\omega) P(\omega)$ and collecting all those $\omega$ for which $X(\omega) = k$ for each $k$, you can by simple factoring get the first definition. (You can go in the other direction as well by decomposing $\{ X = k \}$ into the atoms of $\Omega$.)