Definition
A random variable is a function that assigns a numerical value to each outcome in a sample space of a random experiment. It provides a way to quantify uncertain outcomes. There are two main types:
- Discrete random variable: Takes on a countable set of values (e.g., number of heads in coin tosses).
- Continuous random variable: Takes on values from an interval or collection of intervals (e.g., height, weight).
- HH
- HT
- TH
- TT
- $X(\text{HH}) = 2$
- $X(\text{HT}) = 1$
- $X(\text{TH}) = 1$
- $X(\text{TT}) = 0$
- $P(X = 0) = P(\text{TT}) = \frac{1}{4}$
- $P(X = 1) = P(\text{HT}) + P(\text{TH}) = \frac{1}{4} + \frac{1}{4} = \frac{1}{2}$
- $P(X = 2) = P(\text{HH}) = \frac{1}{4}$
- A random variable maps outcomes of a random process to numbers.
- It can be discrete (countable values) or continuous (any value in an interval).
- Random variables allow us to analyze and compute probabilities for numerical outcomes.
Mathematically, if $S$ is the sample space, a random variable $X$ is a function $X: S \to mathbb{R}$.
Worked Example
Example: Suppose you toss a fair coin twice. Let $X$ be the random variable representing the number of heads observed.
Step 1: List the sample space
The possible outcomes are:
Step 2: Assign values of $X$
Step 3: Find the probability distribution of $X$
So, the probability distribution is:
\[\begin{array}{c|c} x & P(X = x) \\ hline 0 & \frac{1}{4} \\ 1 & \frac{1}{2} \\ 2 & \frac{1}{4} \\ \end{array}\]