# Lecture 8: Discrete Probability Distributions

## Statistics / Biostatistics

---

## Learning Objectives

By the end of this lecture, students will be able to:

1. Define a random variable and distinguish discrete from continuous random variables
2. Construct and interpret a probability distribution for a discrete random variable
3. Calculate the expected value (mean) and variance of a discrete distribution
4. Identify the properties that all valid probability distributions must satisfy
5. Apply discrete distributions to clinical examples

---

## Lecture Content

### I. Random Variables

A **random variable** is a numerical quantity whose value is determined by the outcome of a random experiment. Random variables are denoted by uppercase letters (X, Y, Z), while specific values they take are denoted by lowercase letters (x, y, z). A **discrete random variable** takes on a countable number of distinct values, such as the number of patients admitted per day, the number of adverse events, or the number of positive tests in a batch. A **continuous random variable** can take any value in an interval or collection of intervals, such as blood glucose level, time to event, or weight. Continuous random variables are covered in subsequent lectures.

### II. Probability Distribution of a Discrete Random Variable

A probability distribution is a table, formula, or graph that lists all possible values of X and their associated probabilities. For a distribution to be valid, two requirements must be met: P(X = x) must be greater than or equal to zero for all x, and the sum of all P(X = x) must equal 1. The function f(x) = P(X = x) is called the **probability mass function (PMF)**.

As an example, let X represent the number of side effects experienced by a patient, with possible values 0, 1, 2, and 3. If P(X=0) = 0.40, P(X=1) = 0.30, P(X=2) = 0.20, and P(X=3) = 0.10, this constitutes a valid probability distribution because 0.40 + 0.30 + 0.20 + 0.10 = 1.00 and all probabilities are non-negative.

### III. Cumulative Distribution Function (CDF)

The **cumulative distribution function (CDF)**, denoted F(x) = P(X <= x), gives the probability that X takes a value less than or equal to x. It equals the sum of P(X = k) for all k <= x. For discrete variables, the CDF is a non-decreasing step function. It is useful for calculating probabilities over ranges: P(X > 1) = 1 - F(1) = 1 - P(X <= 1), and P(1 <= X <= 3) = F(3) - F(0).

<image>A two-panel figure for a discrete random variable (number of side effects, 0-3). Panel A: A bar chart showing the probability mass function (PMF), with bars at x = 0, 1, 2, 3 and heights 0.40, 0.30, 0.20, 0.10. Panel B: A step function showing the cumulative distribution function (CDF), starting at 0 and stepping up to 0.40, 0.70, 0.90, and 1.00 at the corresponding x values. Both panels have clearly labeled axes.</image>

### IV. Expected Value (Mean) of a Discrete Random Variable

The expected value of a discrete random variable is defined as E(X) = mu = sum of [x * P(X = x)] for all possible values of x. It represents the long-run average value of X over many repetitions and does not need to be a value that X can actually take.

Using the side effects distribution from earlier, E(X) = 0(0.40) + 1(0.30) + 2(0.20) + 3(0.10) = 0 + 0.30 + 0.40 + 0.30 = 1.00. On average, patients experience 1.0 side effects. Two important properties of expected value are that E(aX + b) = a * E(X) + b, and E(X + Y) = E(X) + E(Y), which holds regardless of whether X and Y are independent.

### V. Variance and Standard Deviation

The variance of a discrete random variable is Var(X) = sigma^2 = sum of [(x - mu)^2 * P(X = x)], with the equivalent computational formula Var(X) = E(X^2) - [E(X)]^2. The standard deviation is sigma = sqrt(Var(X)).

Continuing the example, E(X^2) = 0^2(0.40) + 1^2(0.30) + 2^2(0.20) + 3^2(0.10) = 0 + 0.30 + 0.80 + 0.90 = 2.00. Therefore Var(X) = 2.00 - (1.00)^2 = 1.00, and SD(X) = 1.00. Two key properties of variance are Var(aX + b) = a^2 * Var(X), and if X and Y are independent, Var(X + Y) = Var(X) + Var(Y).

### VI. Bernoulli Distribution

The Bernoulli distribution is the simplest discrete distribution, modeling a single trial with exactly two outcomes. X = 1 (success) with probability p, and X = 0 (failure) with probability 1 - p. The PMF is P(X = x) = p^x * (1 - p)^(1-x) for x = 0, 1. The expected value is E(X) = p, and the variance is Var(X) = p(1 - p). A clinical example would be a single patient either responding to treatment (X=1) or not (X=0). The Bernoulli distribution is the building block for the binomial distribution, which models multiple independent Bernoulli trials.

### VII. Uniform Discrete Distribution

In a uniform discrete distribution, all outcomes are equally likely. If X takes values 1, 2, ..., n, then P(X = k) = 1/n for each k. The expected value is E(X) = (n + 1) / 2, and the variance is Var(X) = (n^2 - 1) / 12. A familiar example is rolling a fair six-sided die, where each face has a probability of 1/6.

### VIII. Linear Combinations of Random Variables

When working with random variables X and Y that have known means and variances, the expected value of a linear combination is E(aX + bY) = a * E(X) + b * E(Y). If X and Y are independent, the variance of the linear combination is Var(aX + bY) = a^2 * Var(X) + b^2 * Var(Y). These rules are important for combining measurements, creating composite scores, or analyzing differences between groups.

<image>A summary comparison table of the Bernoulli and discrete uniform distributions. For each: the PMF formula, a small bar chart visualization, the expected value formula, and the variance formula. A clinical example accompanies each: Bernoulli (patient responds or not to treatment, p = 0.7) and Uniform (random assignment to one of 4 treatment arms, each with probability 0.25). The bar charts visually show the probability distributions.</image>

### IX. Applications in Clinical Biostatistics

Discrete probability distributions have numerous clinical applications. They are used to model the number of patients who respond to a therapy in a clinical trial, to predict the expected number of disease cases in a surveillance sample, and to calculate probabilities for quality control such as the number of defective items in a batch of medical devices. Risk assessment relies on expected values to estimate the expected number of adverse events per patient. Understanding expected value is also foundational for cost-effectiveness analysis, where the expected cost is calculated as the sum of each outcome's cost multiplied by its probability.

---
