Probability Fundamentals & Distributions
The language of uncertainty β probability rules, conditional probability, and the distributions that describe real-world data.
Learning Objectives
- Define probability and calculate the probability of a simple event.
- Distinguish independent vs mutually exclusive events.
- Explain conditional probability and joint/marginal probability.
- Describe the normal distribution and the empirical rule (68β95β99.7).
- Know when to use binomial, Poisson, and uniform distributions.
- Explain the Central Limit Theorem conceptually.
1. Probability Basics
Probability measures how likely an event is, from 0 (impossible) to 1 (certain).
# Probability of rolling a 4 on a fair six-sided die
P = 1 / 6 # 0.1667 β one favourable outcome out of six
In general: P(event) = favourable outcomes Γ· total possible outcomes.
2. Independent vs Mutually Exclusive
| Independent | Mutually exclusive | |
|---|---|---|
| Meaning | one event doesn't affect the other | both events can't happen together |
| Example | two coin flips | rolling a 2 and a 5 on one die |
| Key rule | P(A and B) = P(A) Γ P(B) | P(A and B) = 0 |
3. Conditional Probability
Conditional probability is the chance of one event given that another has happened β written P(A | B).
# P(A | B) = P(A and B) / P(B)
# e.g. probability a customer churns, given they are inactive
It answers questions like: "Given a customer is in the South region, what's the probability they churn?"
Joint vs marginal vs conditional
- Joint β probability of two events together: P(A and B).
- Marginal β probability of one event, ignoring others: P(A).
- Conditional β probability of one event given another: P(A | B).
4. Probability Distributions
A probability distribution describes how likely each possible outcome is. Three matter most for a data analyst:
Normal distribution β the bell curve
Most natural data (heights, test scores, measurement errors) is roughly normal β symmetric around the mean.
Binomial β counting successes
Number of successes in n independent trials, each with the same probability p (success/failure). E.g., number of heads in 10 coin flips.
Poisson β counting rare events over an interval
Number of events in a fixed interval given a rate. E.g., customer arrivals per hour, calls per minute.
Uniform β all outcomes equally likely
Every value in a range is equally probable. E.g., a fair die roll.
5. The Central Limit Theorem (CLT)
The Central Limit Theorem is one of the most-asked statistics concepts: as your sample size grows, the distribution of the sample mean approaches a normal distribution β no matter what the original population looks like.
6. Interview Questions (with Model Answers)
The probability and distribution questions interviewers ask. Self-test before revealing.
IQ1. What is probability, and how is it calculated?
Model answer: "Probability is how likely an event is, from 0 to 1. I calculate it as favourable outcomes divided by total possible outcomes β like 1/6 for rolling a specific number on a die."
IQ2. What's the difference between independent and mutually exclusive events?
Model answer: "Independent events don't affect each other's probability β like two coin flips. Mutually exclusive events can't both happen β like rolling a 2 and a 5 on one die. Independent events can still happen together."
IQ3. What is conditional probability?
Model answer: "It's the probability of an event given another has occurred, written P(A|B). It's P(A and B) divided by P(B). For example, the probability a customer churns given they're inactive."
IQ4. What's the difference between joint, marginal, and conditional probability?
Model answer: "Joint is the probability of two events together, P(A and B). Marginal is the probability of one event ignoring others, P(A). Conditional is one event given another, P(A|B)."
IQ5. What is the normal distribution, and what's the empirical rule?
Model answer: "The normal distribution is a symmetric bell curve around the mean. The empirical rule says ~68% of data is within 1 standard deviation, ~95% within 2, and ~99.7% within 3."
IQ6. What is the Central Limit Theorem, and why does it matter?
Model answer: "The CLT says that as sample size grows, the distribution of the sample mean approaches normal, regardless of the population's shape. That's why we can use normal-based methods on sample means even when the data isn't normal."
IQ7. When would you use a binomial vs a Poisson distribution?
Model answer: "Binomial for the number of successes in a fixed number of independent trials β like heads in 10 flips. Poisson for the number of events in a fixed interval given a rate β like arrivals per hour."
IQ8. What is a probability distribution?
Model answer: "A probability distribution describes how likely each possible outcome is β it tells you which values are common and which are rare. Normal, binomial, and Poisson are the ones analysts use most."
IQ9. What is Bayes' theorem (conceptually)?
Model answer: "Bayes' theorem lets me update a probability when I get new evidence β it relates P(A|B) to P(B|A). It's the foundation of reasoning under uncertainty."
Hands-On Project: Probability in Python
Compute a few probability and distribution values in Python.
Steps
- Simulate 1000 rolls of a die and estimate P(rolling a 6).
- Simulate 1000 coin flips and estimate P(heads).
- Draw samples from a normal distribution and check the empirical rule (mean Β± 1 SD).
View Solution / Walkthrough
import numpy as np
# 1. P(rolling a 6)
rolls = np.random.randint(1, 7, size=1000)
print((rolls == 6).mean()) # β 0.1667
# 2. P(heads)
flips = np.random.randint(0, 2, size=1000)
print(flips.mean()) # β 0.5
# 3. Empirical rule on a normal sample
data = np.random.normal(100, 10, size=10000) # mean 100, sd 10
mean, sd = data.mean(), data.std()
within_1 = ((data > mean - sd) & (data < mean + sd)).mean()
print(within_1) # β 0.68 (68%)
Key Takeaways
P(event) = favourable Γ· total possible outcomes.
Independent β mutually exclusive β one can co-occur, the other can't.
Conditional P(A|B) = P(A and B) / P(B).
Normal: 68β95β99.7 rule; binomial counts successes; Poisson counts rare events.
CLT: sample means become normal as sample size grows.
Objective Questions β Test Your Understanding
Q1. Two events that cannot both happen at the same time are calledβ¦
Q2. P(A|B) representsβ¦
Q3. In a normal distribution, ~68% of data falls withinβ¦
Q4. The Central Limit Theorem states that as sample size increases, the distribution of sample means approachesβ¦
Q5. Which distribution models the number of successes in a fixed number of independent trials?