Discrete Random Variables
View .md

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 XX is a function from the sample space Ω\Omega to the real numbers:

X:Ω→RX: \Omega \to \mathbb{R}

For each outcome ω∈Ω\omega \in \Omega, the random variable XX assigns a numerical value X(ω)X(\omega).

Example: Coin Flips

Flip a coin 3 times. Sample space: {HHH,HHT,HTH,HTT,THH,THT,TTH,TTT}\{HHH, HHT, HTH, HTT, THH, THT, TTH, TTT\}

Let XX = number of heads. Then:

  • X(HHH)=3X(HHH) = 3
  • X(HHT)=2X(HHT) = 2
  • X(HTT)=1X(HTT) = 1
  • X(TTT)=0X(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}\{1, 2, 3, 4, 5, 6\} (die roll)
  • Infinite but countable: {1,2,3,…}\{1, 2, 3, \ldots\} (number of coin flips until heads)

A random variable is continuous if it takes values in an interval:

  • [0,1][0, 1] (uniform on unit interval)
  • (−∞,∞)(-\infty, \infty) (normal distribution)

Probability Mass Function (PMF)

The PMF gives the probability of each possible value:

pX(x)=P(X=x)p_X(x) = P(X = x)

Properties

  1. pX(x)≥0p_X(x) \geq 0 for all xx
  2. ∑xpX(x)=1\sum_x p_X(x) = 1 (total probability is 1)

Example: Fair Die

pX(x)=16for x=1,2,3,4,5,6p_X(x) = \frac{1}{6} \quad \text{for } x = 1, 2, 3, 4, 5, 6

Example: Bernoulli

XX takes values 0 or 1 with probabilities 1−p1-p and pp:

pX(0)=1−p,pX(1)=pp_X(0) = 1-p, \quad p_X(1) = p


Common Discrete Distributions

Bernoulli

Single trial with success probability pp:

  • P(X=1)=pP(X = 1) = p
  • P(X=0)=1−pP(X = 0) = 1 - p

Binomial

nn independent Bernoulli trials:

P(X=k)=(nk)pk(1−p)n−kP(X = k) = \binom{n}{k} p^k (1-p)^{n-k}

Geometric

Number of trials until first success:

P(X=k)=(1−p)k−1pfor k=1,2,3,…P(X = k) = (1-p)^{k-1} p \quad \text{for } k = 1, 2, 3, \ldots

Poisson

Number of events in a fixed interval:

P(X=k)=λke−λk!P(X = k) = \frac{\lambda^k e^{-\lambda}}{k!}


Calculating Probabilities

For any event AA:

P(X∈A)=∑x∈ApX(x)P(X \in A) = \sum_{x \in A} p_X(x)

Example

For a fair die, find P(X≥4)P(X \geq 4):

P(X≥4)=pX(4)+pX(5)+pX(6)=16+16+16=12P(X \geq 4) = p_X(4) + p_X(5) + p_X(6) = \frac{1}{6} + \frac{1}{6} + \frac{1}{6} = \frac{1}{2}


Key Terms

Random VariableA function that assigns a numerical value to each outcome in a sample space.
Discrete Random VariableA random variable that takes on a countable number of distinct values.
PMFProbability Mass Function — gives the probability that a discrete random variable equals a specific value.
BernoulliA random variable with exactly two outcomes: success (1) with probability p, and failure (0) with probability 1−p.
BinomialThe number of successes in n independent Bernoulli trials, each with success probability p.
GeometricThe number of trials until the first success in a sequence of independent Bernoulli trials.