STAT 7 - Statistical Methods for the Biological, Environmental & Health Sciences
10 Mar 2026
| Week | Topics | Readings | Deliverables |
|---|---|---|---|
| Four | Random Variables & Distributions | Sections 4.1, 4.2, 4.3 | Complete HW3 and Practice Exam (HW4) |
| Attend 2 lectures, 1 DSA |
Today: We connect probability to real-world phenomena through random variables!
Remember Week 1:
This Week:
Remember the general form:
\[P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}\]
Example: Medical Testing
If you test positive, what’s the probability you have the disease?
Let D = has disease, T+ = tests positive
\[P(D|T+) = \frac{P(T+|D) \cdot P(D)}{P(T+)}\]
\[P(D|T+) = \frac{0.95 \times 0.01}{0.1085} \approx 0.088\]
Only 8.8% chance! Base rates matter enormously.
Definition: A random variable is a function that assigns a numerical value to each outcome of a random phenomenon.
Example:
Flip a coin 3 times
Let X = number of heads
X maps outcomes to numbers
Which of these are random variables?
Examples:
Examples:
Classify each as discrete or continuous:
For a discrete random variable X:
Probability Distribution = List of all possible values and their probabilities
Requirements:
Flip a fair coin 3 times. Let X = number of heads.
Sample Space:
TTT, TTH, THT, HTT, THH, HTH, HHT, HHH
Probability Distribution:
| X | 0 | 1 | 2 | 3 |
|---|---|---|---|---|
| P(X) | 1/8 | 3/8 | 3/8 | 1/8 |
Visualization:
Expected Value = long-run average value of the random variable
For discrete X:
\[E(X) = \mu = \sum_{all\ x} x \cdot P(X = x)\]
Example (coin flips):
\[E(X) = 0 \cdot \frac{1}{8} + 1 \cdot \frac{3}{8} + 2 \cdot \frac{3}{8} + 3 \cdot \frac{1}{8} = 1.5\]
Variance = average squared deviation from the mean
\[Var(X) = \sigma^2 = \sum_{all\ x} (x - \mu)^2 \cdot P(X = x)\]
Standard Deviation:
\[SD(X) = \sigma = \sqrt{Var(X)}\]
Measures the spread or variability of the distribution
For our coin flip example (X = number of heads in 3 flips):
We found: \(E(X) = 1.5\)
Calculate Variance:
\[\begin{align} Var(X) &= (0-1.5)^2 \cdot \frac{1}{8} + (1-1.5)^2 \cdot \frac{3}{8} \\ &\quad + (2-1.5)^2 \cdot \frac{3}{8} + (3-1.5)^2 \cdot \frac{1}{8} \\ &= 2.25 \cdot \frac{1}{8} + 0.25 \cdot \frac{3}{8} + 0.25 \cdot \frac{3}{8} + 2.25 \cdot \frac{1}{8} \\ &= 0.75 \end{align}\]
Standard Deviation: \(SD(X) = \sqrt{0.75} \approx 0.87\)
Rather than deriving probability distributions from scratch every time, statisticians have identified common patterns:
Each has a specific formula and properties.
Today we focus on Binomial and Normal
Four conditions must be met:
Notation: \(X \sim Binomial(n, p)\) or \(X \sim Bin(n, p)\)
X = number of successes in n trials
A botanist plants 50 seeds, each with 80% germination probability.
Check the conditions:
✓ This is a Binomial setting!
Probability of exactly k successes:
\[P(X = k) = \binom{n}{k} p^k (1-p)^{n-k}\]
Where:
Mean and Variance:
\[E(X) = np \qquad Var(X) = np(1-p)\]
Setup: 10 seeds, p = 0.8
What’s the probability exactly 10 seeds germinate?
\[P(X = 10) = \binom{10}{10} (0.8)^{10}(0.2)^{0}\]
\[= 1 \times 0.107 \times 1 = 0.107\]
About 10.7% chance all 10 germinate
We don’t calculate by hand! Use BINOM.DIST()
Syntax:
=BINOM.DIST(k, n, p, cumulative)
k = number of successesn = number of trialsp = probability of successcumulative = FALSE for P(X = k), TRUE for P(X ≤ k)Example: =BINOM.DIST(10, 10, 0.8, FALSE) gives 0.107
A botanist plants 10 seeds, each with 80% germination probability.
Calculate:
=BINOM.DIST(10, 10, 0.8, FALSE) = 0.107=BINOM.DIST(4, 10, 0.8, TRUE) = 0.0064=1 - BINOM.DIST(6, 10, 0.8, TRUE) = 0.879Shape depends on p: symmetric when p=0.5, skewed otherwise

Let’s take 2 minutes to stretch!

We’ll cover:
Be ready to connect probability to inference!
Before you leave, please complete:
One question you still have about random variables or distributions
Complete by Friday:
Complete during Discussion Section:
Study for Midterm (next week!)
Office hours available - check Ed Discussion for times
Questions?
![]()
STAT 7 – Winter 2026