# What does $\Omega$ and $E$ mean in measure-theoretic probability theory?

I am reading about the measure-theoretic formulation of probability spaces. This is an excerpt from wikipedia.

Let ${\displaystyle (\Omega ,{\mathcal {F}},P)}$ be a probability space and ${\displaystyle (E,{\mathcal {E}})}$ a measurable space. Then an ${\displaystyle (E,{\mathcal {E}})}$-valued random variable is a function ${\displaystyle X\colon \Omega \to E}$ which is ${\displaystyle ({\mathcal {F}},{\mathcal {E}})}$-measurable. The latter means that, for every subset ${\displaystyle B\in {\mathcal {E}}}$, its preimage ${\displaystyle X^{-1}(B)\in {\mathcal {F}}}$ where ${\displaystyle X^{-1}(B)=\{\omega :X(\omega )\in B\}}$.[5] This definition enables us to measure any subset ${\displaystyle B\in {\mathcal {E}}}$ in the target space by looking at its preimage, which by assumption is measurable.

In more intuitive terms, a member of ${\displaystyle \Omega }$ is a possible outcome, a member of ${\displaystyle {\mathcal {F}}}$ is a measurable subset of possible outcomes, the function ${\displaystyle P}$ gives the probability of each such measurable subset, ${\displaystyle E}$ represents the set of values that the random variable can take (such as the set of real numbers), and a member of ${\displaystyle {\mathcal {E}}}$ is a "well-behaved" (measurable) subset of ${\displaystyle E}$ (those for which you might want to find the probability). The random variable is then a function from any outcome to a quantity, such that the outcomes leading to any useful subset of quantities for the random variable have a well-defined probability.

I am rather confused about what $\Omega$ and $E$ are exactly. Based solely on the bolded text above, I would conclude they are the same, because "a possible outcome" and "a value that the random variable can take" seem to me to be synonymous. But that of course doesn't make sense.

So can you explain what $\Omega$ and $E$ are in the case of a simple random variable from "statistics 101"? For example, suppose we have a variable $X$ with the probability density function $$f(X)= \{ 1, \text {if } 0\le X\le 1$$ $$f(X) = \{0, \text{otherwise }$$

What would be $\Omega$ and what would be $E$ in this case?

It seems that when you define a random variable via its distribution (or density) as you have done in your example, there is not much point in talking about the underlying probability space. By supplying the density, you already have defined all the probabilistic behavior of the variable, regardless of the underlying probability space $(\Omega, \mathcal F, P)$. There can be numerous different candidate probability spaces that underlie this random variable.
The probability distribution "forgets" about the particular probability space used to define $X$ and only records the probabilities of various values of $X$. [ ... ] The underlying probability space $\Omega$ is a technical device used to guarantee the existence of random variables, sometimes to construct them.
Consider this: I can define a probability space $(\Omega, \mathcal F, P)$ where $\Omega = \mathbb R$, $\mathcal F = \mathcal B(\mathbb R)$ and $P([a, b]) = \Phi(b)-\Phi(a)$ where $\Phi$ is the Normal density. So this is a "probability space" yet each outcome has the same behavior as a Normal variable. Or I can define $\Omega = [0, 1]$, $\mathcal F = \mathcal B ([0, 1])$ and then another space $E = \mathbb R$, along with a function $X:\Omega \rightarrow E$ and a probability measure $P$ on $(\Omega, \mathcal F)$ such that $X$ ends up having a Normal distribution. It doesn't really matter – either way it's easier to just define $X$ via a density without thinking about the underlying probability space.
So ultimately, it seems better to think of cases where you start with $\Omega$ and then put a random variable on top of it. $\Omega$ is the set of outcomes of the underlying phenomenon, e.g. a coin toss or a dice roll. A random variable is a function that maps the outcomes to numeric values, for example betting wins/losses on the said coin toss or dice roll.