Comprehensive theory, key formulas, diagrams, and memory aids for Random Variables.
Up until now, we have discussed events like "drawing an Ace" or "flipping a Head." While descriptive, these textual outcomes are mathematically cumbersome. To apply calculus, algebra, and advanced statistics to probability, we need a way to translate these physical outcomes into numbers.
This is exactly what a Random Variable does. It acts as a bridge between the physical world of random experiments and the mathematical world of numbers.
Despite its name, a random variable is neither "random" nor a "variable" in the traditional algebraic sense (like solving for $x$).
Formally, a Random Variable (RV) is a mathematical function that assigns a specific numerical value to every possible outcome in the sample space of a random experiment. * It is traditionally denoted by capital letters, usually $X, Y,$ or $Z$. * The specific numerical values it can take on are denoted by lowercase letters (e.g., $x_1, x_2, \dots$).
Let the experiment be tossing a fair coin twice. * Sample Space ($S$): ${HH, HT, TH, TT}$ * Let's define a Random Variable $X$ as: "The number of Heads obtained." * $X$ maps the physical outcomes to numbers: * $X(TT) = 0$ * $X(HT) = 1$ * $X(TH) = 1$ * $X(HH) = 2$
Now, instead of asking "What is the probability of getting exactly one Head?", we can use compact mathematical notation: Find $P(X = 1)$.
Random variables are broadly classified into two categories depending on the types of numerical values they can assume.
A discrete RV has a finite or countably infinite number of possible values. You can usually list them out or count them on your fingers (even if you have to count forever, like $0, 1, 2, 3 \dots$). * They often arise from counting processes. * Examples: * The number of defective lightbulbs in a box of 10 ($X \in {0, 1, \dots, 10}$). * The number of times you have to roll a die before getting a 6 ($X \in {1, 2, 3, \dots}$).
A continuous RV can assume any value within a given interval or range of real numbers. Because there are infinitely many decimals between any two numbers, the possible values are uncountably infinite. * They often arise from measurement processes. * Examples: * The exact height of a randomly selected adult male. * The exact time it takes for a chemical reaction to complete. * The lifespan of a car battery.
Once we have mapped our outcomes to a Random Variable $X$, we want to know how the probability is "distributed" across those numerical values.
For discrete random variables, we use a Probability Mass Function, usually denoted as $P(x)$ or $P(X = x)$. It gives the exact probability that the RV will equal a specific value.
Properties of a PMF: 1. Every probability must be between 0 and 1: $0 \le P(X=x) \le 1$ 2. The sum of all probabilities must equal 1: $\sum P(X=x) = 1$
Example: PMF for $X$ (number of Heads in 2 tosses) | $x$ (Number of Heads) | $P(X = x)$ | | :--- | :--- | | 0 | 1/4 | | 1 | 2/4 = 1/2 | | 2 | 1/4 |
For continuous random variables, the probability of the RV taking on one exact, infinitely precise value (like exactly 5.000000... cm) is 0.
Instead of finding the probability of an exact value, we find the probability that the variable falls within a specific range (e.g., between 4.9 cm and 5.1 cm). We do this using a Probability Density Function, denoted as $f(x)$.
The probability is found by calculating the area under the curve of $f(x)$ between two points, which requires integration (calculus): $$ P(a \le X \le b) = \int_{a}^{b} f(x) dx $$
Properties of a PDF: 1. The function must be non-negative: $f(x) \ge 0$ 2. The total area under the entire curve must equal 1: $\int_{-\infty}^{\infty} f(x) dx = 1$
Regardless of whether an RV is discrete or continuous, we can define its Cumulative Distribution Function, denoted as $F(x)$.
The CDF gives the probability that the random variable $X$ will take a value less than or equal to $x$.
$$ F(x) = P(X \le x) $$