What is it meant with the $\sigma$-algebra generated by a random variable? Often, in the course of my (self-)study of statistics, I've met the terminology "$\sigma$-algebra generated by a random variable". I don't understand the definition on Wikipedia, but most importantly I don't get the intuition behind it. Why/when do we need $\sigma-$algebras generated by random variables? What is their meaning? I know the following:


*

*a $\sigma$-algebra on a set $\Omega$ is a nonempty collection of subsets of $\Omega$ which contains $\Omega$, is closed under complement and under countable union.

*we introduce $\sigma$-algebras to build probability spaces on infinite sample spaces. In particular, if $\Omega$ is uncountably infinite, we know there can exist unmeasurable subsets (sets for which we cannot define a probability). Thus, we can't just use the power set of $\Omega$ $\mathcal{P}(\Omega)$ as our set of events $\mathcal{F}$. We need a smaller set, which is still large enough so that we can define the probability of interesting events, and we can talk about convergence of a sequence of random variables.


In short, I think I have a fair intuitive understanding of $\sigma-$algebras. I would like to have a similar understanding for the $\sigma-$algebras generated by random variables: definition, why we need them, intuition, an example...
 A: Consider a random variable $X$. We know that $X$ is nothing but a measurable function from $\left(\Omega, \mathcal{A} \right)$ into $\left(\mathbb{R}, \mathcal{B}(\mathbb{R}) \right)$, where $\mathcal{B}(\mathbb{R})$ are the Borel sets of the real line. By definition of measurability we know that we have 
$$X^{-1} \left(B \right) \in \mathcal{A}, \quad \forall B \in \mathcal{B}\left(\mathbb{R}\right)$$
But in practice the preimages of the Borel sets may not be all of $\mathcal{A}$ but instead they may constitute a much coarser subset of it. To see this, let us define 
$$\mathcal{\Sigma} = \left\{ S \in \mathcal{A}: S = X^{-1}(B), \  B \in \mathcal{B}(\mathbb{R}) \right\}$$
Using the properties of preimages, it is not too difficult to show that $\mathcal{\Sigma}$ is a sigma-algebra. It also follows immediately that $\mathcal{\Sigma} \subset \mathcal{A}$, hence $\mathcal{\Sigma}$ is a sub-sigma-algebra. Further, by the definitions it is easy to see that the mapping $X: \left( \Omega, \mathcal{\Sigma} \right) \to \left( \mathbb{R}, \mathcal{B} \left(\mathbb{R} \right) \right)$ is measurable.   $\mathcal{\Sigma}$ is in fact the smallest sigma-algebra that makes $X$ a random variable as all other sigma-algebras of that kind would at the very least include $\mathcal{\Sigma}$. For the reason that we are dealing with preimages of the random variable $X$, we call $\mathcal{\Sigma}$ the sigma-algebra induced by the random variable $X$.
Here is an extreme example: consider a constant random variable $X$, that is, $X(\omega) \equiv \alpha$. Then $X^{-1} \left(B \right), \ B \in \mathcal{B} \left(\mathbb{R} \right)$ equals either $\Omega$ or $\varnothing$ depending on whether $\alpha \in B$. The sigma-algebra thus generated is trivial and as such, it is definitely included in $\mathcal{A}$.
Hope this helps.
A: I will attempt to illustrate the intuition from a different perspective, less technically detailed.
Assume 4 random variables $X_1,X_2,X_3$ and $Y=f(X_1,X_2)$ for an arbitrary  function $f$. Notice that $Y$ is random, but it's determined completely for fixed $X_1, X_2$, while $X_3$ is not determined for fixed $X_1, X_2$. In other words,

the randomness in $Y$ is exclusively due to $X_1$ and $X_2$.

Can we express that formally without referencing the function $f$?
This is precisely what the notion of the $\sigma$-algebra generated by a random variable captures. Informally, we could say that $\sigma(X)$ restricts  the world's probabilism to just $X$, disabling any other source of randomness. In the example above, $\sigma((X_1,X_2))$ contains $\sigma(Y)$ (or $Y$ is $\sigma((X_1,X_2))$-measurable), because the randomness of $(X_1,X_2)$ contains the randomness of $Y$. The converse would be true only if $f$ is a one-to-one mapping.
