Overview
A random variable is a function that assigns a numerical value to each outcome in a sample space. It bridges probability theory with real-world data.
Types of Random Variables
| Type | Description | Examples |
|---|
| Discrete | Countable values | Dice roll, number of defects |
| Continuous | Any value in an interval | Height, weight, time |
Discrete Random Variables
Probability Mass Function (PMF)
For discrete random variable X:
P(X=x)=f(x)
Properties:
- f(x)≥0 for all x
- ∑f(x)=1
Cumulative Distribution Function (CDF)
F(x)=P(X≤x)=t≤x∑f(t)
Properties:
- 0≤F(x)≤1
- F(x) is non-decreasing
- F(−∞)=0, F(∞)=1
Continuous Random Variables
Probability Density Function (PDF)
P(a≤X≤b)=∫abf(x)dx
Properties:
- f(x)≥0 for all x
- ∫−∞∞f(x)dx=1
- P(X=x)=0 for any single point
CDF for Continuous Variables
F(x)=P(X≤x)=∫−∞xf(t)dt
Relationship:
f(x)=dxdF(x)
Key Formulas Summary
| Concept | Discrete | Continuous |
|---|
| Probability | P(X=x)=f(x) | P(a<X<b)=∫f(x)dx |
| CDF | F(x)=∑f(t) | F(x)=∫f(t)dt |
| Sum/Integral | ∑f(x)=1 | ∫f(x)dx=1 |
Examples
Example 1: Discrete PMF
Rolling a fair die. X = number on die.
P(X=x)=61for x=1,2,3,4,5,6
Example 2: Discrete CDF
For the die:
F(3)=P(X≤3)=P(1)+P(2)+P(3)=63=0.5
Example 3: Continuous PDF
If f(x)=2x for 0≤x≤1:
P(0≤X≤0.5)=∫00.52xdx=[x2]00.5=0.25
Example 4: Creating a PMF Table
Two coins flipped. X = number of heads.
| x | 0 | 1 | 2 |
|---|
| P(X=x) | 0.25 | 0.50 | 0.25 |
Joint Distributions
For two random variables X and Y:
Discrete
P(X=x,Y=y)=f(x,y)
Marginal Distributions
P(X=x)=y∑P(X=x,Y=y)
Independence
X and Y are independent if:
P(X=x,Y=y)=P(X=x)×P(Y=y)
Common Notation
| Symbol | Meaning |
|---|
| X,Y | Random variables |
| x,y | Specific values |
| f(x) | PMF or PDF |
| F(x) | CDF |
| E(X) | Expected value |
| Var(X) | Variance |