Probability · Lesson 1 of 1
Probability
Reason about events, sample spaces, conditional probability, independence, and Bayes’ theorem.
Lesson
1. Introduction
Probability quantifies uncertainty about outcomes under a defined model. Data scientists use it to reason about sampling, risk, classification, and evidence, but a number is only meaningful when its events and assumptions are clear.
2. Core concepts
An event is a set of outcomes in a sample space. The complement probability is one minus the event probability; conditional probability changes the reference population. Independence means learning one event does not change the probability of the other, which is a stronger claim than simply observing no apparent relationship.
3. Topics covered in this module
- Experiments, outcomes, sample spaces, events, and complements
- Addition and multiplication rules, mutually exclusive events, and independence
- Conditional probability and base rates
- Bayes’ theorem, confusion matrices, and probability practice
4. Syntax and how to read it
P(A | B) = P(A and B) / P(B)
P(A) + P(not A) = 1
P(A and B) = P(A) * P(B) # only when A and B are independentConditional probability divides the joint event by the condition event. The multiplication shortcut requires independence and should not be assumed automatically.
5. Practical workflow
Define the events in plain language, identify the population each probability uses, and draw a table or tree. Check that outcomes are mutually exclusive where required and that all probabilities are within zero and one.
6. Common mistakes
- Ignoring a low base rate when interpreting a positive test or alert.
- Multiplying probabilities as if events were independent without checking.
7. Best practices
- Draw a contingency table for conditional probability problems.
- State the population and assumptions behind every probability estimate.
8. Practice task
A fair six-sided die is rolled. What is the probability of rolling an even number?
9. One possible solution
Three outcomes (2, 4, 6) out of six are even, so the probability is 3/6 = 1/2.10. Summary
Reason about events, sample spaces, conditional probability, independence, and Bayes’ theorem. Draw a contingency table for conditional probability problems. State the population and assumptions behind every probability estimate.
11. What comes next
The next module, Probability Distributions and the Central Limit Theorem, builds on this foundation and applies it to a new part of the analytics workflow.
Visual guide
A reliable Probability workflow
-
Step 01
Frame
Define the question, input scope, and intended output.
-
Step 02
Work
Apply the method and validate assumptions as you go.
-
Step 03
Check
Compare results with known cases and communicate limitations.
Code examples
successes = 18
trials = 60
probability = successes / trials
print(probability)
0.3
prevalence = 0.01
sensitivity = 0.95
false_positive = 0.05
positive = sensitivity * prevalence + false_positive * (1 - prevalence)
posterior = sensitivity * prevalence / positive
print(round(posterior, 3))
0.161 (approximately)
Key points
- Reason about events, sample spaces, conditional probability, independence, and Bayes’ theorem.
- Draw a contingency table for conditional probability problems.
- State the population and assumptions behind every probability estimate.
Check your understanding
Practice
Your learning progress