Discrete Random Variables
What is a Random Variable?
A random variable is a function that assigns a numerical value to each outcome in the sample space.
Definition
Mathematically, a random variable X is a function from the sample space Ω to the real numbers:
X:Ω→R
For each outcome ω∈Ω, the random variable X assigns a numerical value X(ω).
Example: Coin Flips
Flip a coin 3 times. Sample space: {HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}
Let X = number of heads. Then:
- X(HHH)=3
- X(HHT)=2
- X(HTT)=1
- X(TTT)=0
Discrete vs Continuous
A random variable is discrete if it takes values in a countable set:
- Finite: {1,2,3,4,5,6} (die roll)
- Infinite but countable: {1,2,3,…} (number of coin flips until heads)
A random variable is continuous if it takes values in an interval:
- [0,1] (uniform on unit interval)
- (−∞,∞) (normal distribution)
Probability Mass Function (PMF)
The PMF gives the probability of each possible value:
pX(x)=P(X=x)
Properties
- pX(x)≥0 for all x
- ∑xpX(x)=1 (total probability is 1)
Example: Fair Die
pX(x)=61for x=1,2,3,4,5,6
Example: Bernoulli
X takes values 0 or 1 with probabilities 1−p and p:
pX(0)=1−p,pX(1)=p
Common Discrete Distributions
Bernoulli
Single trial with success probability p:
- P(X=1)=p
- P(X=0)=1−p
Binomial
n independent Bernoulli trials:
P(X=k)=(kn)pk(1−p)n−k
Geometric
Number of trials until first success:
P(X=k)=(1−p)k−1pfor k=1,2,3,…
Poisson
Number of events in a fixed interval:
P(X=k)=k!λke−λ
Calculating Probabilities
For any event A:
P(X∈A)=x∈A∑pX(x)
Example
For a fair die, find P(X≥4):
P(X≥4)=pX(4)+pX(5)+pX(6)=61+61+61=21