Consider a random variable $X \colon\Omega \rightarrow \mathbb{R}$ for a probability space $(\Omega, \mathcal{F}, P)$.
We had the following definition for the expectation:
$$\mathbb{E}[X]= \int_{\Omega} X(\omega) d P(\omega). \quad (1)$$
For the discrete case we would probably write
$$\mathbb{E}[X]= \sum_{ \omega \in \Omega} X(\omega) P(\omega). \quad (2)$$
Now as non-mathematician (i.e. not having much knowledge about integrals and measure theory),
I am wondering why converting the sum in (2) to an integral does not result in
$$\mathbb{E}[X]=\int_{\Omega} X(\omega) P(\omega) d \omega\quad (3)$$
instead of (1).
(3) is what I would expect, because instead of the sum we just integrate, hence informally "replace sum in (2) by integral sign and add a $d \omega$ at the end".
What is the difference between (1) and (3)? Is it valid to write (3)? Is it just "notation" for measures $P$ or is there a reason for this?
Thank you very much and please have patient with a non-mathematician that never had a lecture in mass theory or integrals.