Module 2
5 min read
Probability Basics
Understand chance and likelihood in data
What is Probability?
Probability = How likely something will happen
Scale: 0 to 1 (or 0% to 100%)
- 0 = Impossible (never happens)
- 0.5 = 50-50 chance
- 1 = Certain (always happens)
The Basic Formula
P(Event) = Favorable outcomes / Total outcomes
Examples:
| Event | Favorable | Total | Probability |
|---|---|---|---|
| Coin: Heads | 1 | 2 | 1/2 = 0.5 (50%) |
| Dice: Roll 6 | 1 | 6 | 1/6 = 0.17 (17%) |
| Card: Draw Ace | 4 | 52 | 4/52 = 0.08 (8%) |
3 rows
3 Key Rules
1. Addition Rule (OR)
"What's the chance of A OR B?"
P(A or B) = P(A) + P(B) - P(both)
Example: Card is Heart OR King?
- P(Heart) = 13/52
- P(King) = 4/52
- P(King of Hearts) = 1/52
- Answer = 13/52 + 4/52 - 1/52 = 16/52
2. Multiplication Rule (AND)
"What's the chance of A AND B?"
P(A and B) = P(A) × P(B)
Example: Flip 2 heads in a row?
- P(Head) × P(Head) = 0.5 × 0.5 = 0.25 (25%)
3. Complement Rule (NOT)
"What's the chance it DOESN'T happen?"
P(not A) = 1 - P(A)
Example: 30% chance of rain
- P(no rain) = 1 - 0.3 = 0.7 (70%)
Conditional Probability
"What if something already happened?"
P(A | B) = P(A and B) / P(B)
Example: If it's raining, what's chance you're late?
- This is P(Late | Rain) — probability of being late given it's raining
Quick Reference
| Rule | Formula | Use When |
|---|---|---|
| OR | P(A) + P(B) - P(both) | Either event |
| AND | P(A) × P(B) | Both events |
| NOT | 1 - P(A) | Event doesn't happen |
| Given | P(A and B) / P(B) | Something already happened |
4 rows
Quick Practice
Deck of 52 cards:
- P(Ace) = 4/52 = 0.08
- P(Ace or King) = 8/52 = 0.15
- P(2 Aces in a row, with replacement) = 4/52 × 4/52 = 0.006
Tip: Probability is the foundation of A/B testing, risk analysis, and machine learning!