A random process, where each outcome is associated with some number.
Random Variable
A random variable is a function that maps outcomes from a probability space to real numbers.
Formally, where is the sample space. For any borel set , the preimage must be measurable in the probability space.Two main types of random variables exist: discrete and continuous. A discrete random variable takes countably many values (like the number of head in coin flips), while a continuous random variable can take any value in an interval (like the height of people). Mixed types are also possible but less common.
The classification depends on the variable’s cumulative distribution function (CDF):
A discrete random variable has a step function as its CDF, while a continuous random variable has a continuous CDF.
Rolling a fair six-sided die can be represented as a discrete random variable that maps faces to numbers:
Each outcome has probability for (uniformly distributed).
The expected value is:
Flipping a coin 4 times and counting the number of heads:
The sample space contains all possible sequences of 4 flips .
Let be the random variable counting the number of heads.
For , the probability distribution is:This follows a binomial distribution with trials and probability of heads on each trial.
Random variables are a concise summary of all probabilities. We can apply functions over it:
E.g. the probability function → probability distribution.
Or the expected value, variance, standard deviation, …Then we can ask questions like:
We can do calculus across some range of values… what’s the probability of being in a range of values?
What value do I expect, if I just sample a random item?
How much spread does the distribution have? How surprised would I be if the sampled item differs by so much?
How many emails do I expect to get in the next 10 minutes, given a certain rate of email? Would I be surprised if I got no emails in that time?
Two random variables can be independent, meaning the outcome of one does not affect the probability distribution of the other.
and are independent if:
for all Borel sets . For discrete random variables, this simplifies to for all possible values .