# Random Variable Vs. Probability Function Intuition?

In a book on probability I'm reading they begin by defining random experiment, outcome, sample space & event, then using these notions they define & a probability space in terms of the sample space, a sigma field & a probability function.

After about 80 pages of working with this theory, i.e. Bayes theorem, conditional probability etc... they introduce the notion of a random variable & the distribution function of a random variable.

They give the impression that a random variable is a function of the outcomes, & that it is defined independently of the notion of a probability function, which this stack answer seems to imply:

Probability measures assign values (probabilities) to sets in the $\sigma$-algebra $\mathcal{A}$. On the other hand, random variables are functions $f\colon \Omega\to E$ that are measurable in this sense: If $B \in \mathcal{E}$, then $f^{-1}(B) \in \mathcal{A}$. https://math.stackexchange.com/a/124504

yet other sources I've seen seem to conflate the two notions or even imply they mean the same thing :(

What is a random variable a) intuitively, b) mathematically & c) in a way that distinguishes it from a probability function, i.e. a nice intuitive example of a situation where you can't just use a probability function you need a random variable. I can't believe I got through a course on probability without understanding this :(

Thanks!

Intuitively you can think of random variable , as a reward associated with any event . Suppose you play a game where you throw a six-sided dice . Depending on the outcome of the dice you get a particular outcome , say if you get $1$ you will get $1\$$, similarly for other outcomes . So the reward you will be getting after throwing the dice once is a random variable which take values from$1$to$6$. It is random because you don't know its value before you have thrown the dice ( ie you have not done the experiment ) . You can say it is a value associated with a probabilistic experiment . It differs from the probability distribution function in the way that it is the value that is associated with the outcome of the probabilistic experiment , but what the outcome of the experiment will be has nothing to do with the value associated it . • If I understood correctly the random variable is typically a function which map outcomes to a real value (in your example$\lbrace1,...,6\rbrace -> \mathbb{R}$) while a probability distribution or probability density function map the "image" of the random variable to a probability value ( in your example$\mathbb{R} -> [0,1]$). In the @PVanchinathan examples you have a set of call C(a finite set) and the random variable represent the mapping$C -> \mathbb{R} $where the real value is the duration and the probability function or probability density function associate the duration to a$[0,1]\$ – Bemipefe Feb 6 at 20:19