Session 26 Β· Phase 4: Statistics & Visualization

Probability Fundamentals & Distributions

The language of uncertainty β€” probability rules, conditional probability, and the distributions that describe real-world data.

⏱ ~2 hrs πŸ“š Core content 🎯 High priority

Learning Objectives

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

IndependentMutually exclusive
Meaningone event doesn't affect the otherboth events can't happen together
Exampletwo coin flipsrolling a 2 and a 5 on one die
Key ruleP(A and B) = P(A) Γ— P(B)P(A and B) = 0
⚠️
Common confusion: independent events can happen together; mutually exclusive events cannot. They are different ideas β€” don't use the terms interchangeably.

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

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.

πŸ’‘
The empirical rule (68–95–99.7): in a normal distribution, ~68% of data is within 1 standard deviation of the mean, ~95% within 2, and ~99.7% within 3.

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.

🌐
Why it matters: it's why we can use normal-based methods (confidence intervals, hypothesis tests) on sample means even when the raw data isn't normal β€” as long as the sample is large enough.
πŸ“‹ Stable content β€” Reviewed: August 2026

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

  1. Simulate 1000 rolls of a die and estimate P(rolling a 6).
  2. Simulate 1000 coin flips and estimate P(heads).
  3. 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

1

P(event) = favourable Γ· total possible outcomes.

2

Independent β‰  mutually exclusive β€” one can co-occur, the other can't.

3

Conditional P(A|B) = P(A and B) / P(B).

4

Normal: 68–95–99.7 rule; binomial counts successes; Poisson counts rare events.

5

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?