Lesson 3: Project Dataset Exploration
Welcome!

Calendar
Day 1

Day 2


Daily Kid Update
Events
Definition: Experiment
An experiment is a process or action that produces observable outcomes.
- It must have at least two possible outcomes.
- Each repetition of the experiment under the same conditions may produce a different outcome.
Example 1: Flipping a coin
Example 2: Rolling a die
Definition: Sample Space
The sample space is the set of all possible outcomes of a random experiment.
\(S = \{ \text{Outcome 1}, \text{Outcome 2}, \dots, \text{Outcome n} \}\)
\(S = \{ \text{Heads}, \text{Tails} \}\)
\(S = \{ 1,2,3,4,5,6 \}\)
Definition: Event
An event is a subset of the sample space \(S\) of an experiment. So… the outcome of an experiment.
Notation: If \(A\) is an event, then \(A \subseteq S\)
Example 1: Coin lands heads
Event \(A =\) “coin lands heads”
\[A = \{ \text{Heads} \}\]
Example 2: Die lands 1 or 2
Event \(B =\) “die lands 1 or 2”
\[B = \{ 1, 2 \}\]
Definition: Complement of an Event
The complement of an event \(A\), denoted \(A^c\), is the event that \(A\) does not occur.
Example 1: Coin flip lands not heads
\(A^c =\) “coin lands tails”
\[A^c = \{ \text{Tails} \}\]
Example 2: Die lands not 1 or 2
\(B^c =\) “die lands 3,4,5,6”
\[B^c = \{ 3,4,5,6 \}\]
Definition: Intersection of Events
The intersection of two events \(A\) and \(B\), denoted \(A \cap B\), is the event that both \(A\) and \(B\) occur at the same time.
Example: Coin flip + die roll
- \(A =\) coin lands heads
- \(B =\) die shows 1 or 2
\(A \cap B =\) “coin lands heads and die shows 1 or 2”
\[A \cap B = \{ (H,1), (H,2) \}\]
Definition: Union of Events
The union of two events \(A\) and \(B\), denoted \(A \cup B\), is the event that either \(A\) occurs, or \(B\) occurs, or both occur.
Example: Coin flip + die roll
- \(A =\) coin lands heads
- \(B =\) die shows 1 or 2
\(A \cup B = \{ (H,1), (H,2), (H,3), (H,4), (H,5), (H,6), (T,1), (T,2) \}\)
Probability
Definition: Probability of an Event
The probability of an event \(A\), written \(P(A)\), is a number between \(0\) and \(1\) that measures the likelihood that \(A\) occurs.
For equally likely outcomes:
\[ P(A) = \frac{|A|}{|S|} \]
where:
- \(|A| =\) number of outcomes in event \(A\)
- \(|S| =\) number of outcomes in the sample space
All probabilities are between 0 and 1, inclusive, so the probability of an event \(A\) is \(0 \leq P(A) \leq 1\).
Example 1: Coin flip
- Sample space: \(S = \{\text{Heads}, \text{Tails}\}\), so \(|S| = 2\)
- Event \(A =\) “coin lands heads” → \(A = \{\text{Heads}\}\), so \(|A| = 1\)
\[ P(A) = \tfrac{|A|}{|S|} = \tfrac{1}{2} \]
Example 2: Die roll
- Sample space: \(S = \{1,2,3,4,5,6\}\), so \(|S| = 6\)
- Event \(B =\) “die shows 1 or 2” → \(B = \{1,2\}\), so \(|B| = 2\)
\[ P(B) = \tfrac{|B|}{|S|} = \tfrac{2}{6} = \tfrac{1}{3} \]
Definition: Probability of Complements
For any event \(A\):
\[ P(A^c) = 1 - P(A) \]
Example 1 (coin):
- \(P(\text{A}) = \tfrac{1}{2}\)
- So \(P(A^c) = 1 - P(A) = 1 - \tfrac{1}{2} = \tfrac{1}{2}\)
Example 2 (die):
- \(P(B) = \tfrac{1}{3}\)
- So \(P(B^c) = 1 - P(B) = 1 - \tfrac{1}{3} = \tfrac{2}{3}\)
Definition: Probability of Intersections (AND)
If all outcomes are equally likely: \[ P(A \cap B) = \frac{|A \cap B|}{|S|} \]
Example 1 (coin + die):
- Sample space size: \(|S| = 12\) (2 coin outcomes × 6 die outcomes)
- \(A =\) coin lands heads
- \(B =\) die shows 1 or 2
- \(A \cap B = \{(H,1),(H,2)\}\), so \(|A \cap B| = 2\)
\[ P(A \cap B) = \tfrac{2}{12} = \tfrac{1}{6} \]
Definition: Probability of Unions (OR)
If all outcomes are equally likely: \[ P(A \cup B) = \frac{|A \cup B|}{|S|} \]
Example 1 (coin + die):
- Sample space size: \(|S| = 12\)
- \(A =\) coin lands heads
- \(B =\) die shows 1 or 2
- \(A \cup B = \{(H,1),(H,2),(H,3),(H,4),(H,5),(H,6),(T,1),(T,2)\}\), so \(|A \cup B| = 8\)
\[ P(A \cup B) = \tfrac{8}{12} = \tfrac{2}{3} \]
Probability Tables
2×2 Probability Table with Marginals (Blank)
| \(B\) (1 or 2) | \(B^c\) (3–6) | Row Total | |
|---|---|---|---|
| \(A\) (H) | |||
| \(A^c\) (T) | |||
| Col Total |
2×2 Probability Table with Marginals
| \(B\) (1 or 2) | \(B^c\) (3–6) | Row Total | |
|---|---|---|---|
| \(A\) (H) | \(P(A \cap B)\) | \(P(A \cap B^c)\) | \(P(A)\) |
| \(A^c\) (T) | \(P(A^c \cap B)\) | \(P(A^c \cap B^c)\) | \(P(A^c)\) |
| Col Total | \(P(B)\) | \(P(B^c)\) | \(1\) |
Reminder:
- \(A =\) “coin lands heads”
- \(B =\) “die shows 1 or 2”
- \(A^c =\) “coin lands tails”
- \(B^c =\) “die shows 3–6”
There are \(|S|=12\) equally likely outcomes for (coin, die).
Enumerate Events
\(A \cap B\) = \(\{(H,1),(H,2)\}\)
\(P(A \cap B) = \tfrac{2}{12} = \tfrac{1}{6}\)\(A \cap B^c\) = \(\{(H,3),(H,4),(H,5),(H,6)\}\)
\(P(A \cap B^c) = \tfrac{4}{12} = \tfrac{1}{3}\)\(A^c \cap B\) = \(\{(T,1),(T,2)\}\)
\(P(A^c \cap B) = \tfrac{2}{12} = \tfrac{1}{6}\)\(A^c \cap B^c\) = \(\{(T,3),(T,4),(T,5),(T,6)\}\)
\(P(A^c \cap B^c) = \tfrac{4}{12} = \tfrac{1}{3}\)
Marginals (row & column totals)
- \(P(A) = P(A \cap B) + P(A \cap B^c) = \tfrac{1}{6} + \tfrac{1}{3} = \tfrac{1}{2}\)
- \(P(A^c) = P(A^c \cap B) + P(A^c \cap B^c) = \tfrac{1}{6} + \tfrac{1}{3} = \tfrac{1}{2}\)
- \(P(B) = P(A \cap B) + P(A^c \cap B) = \tfrac{1}{6} + \tfrac{1}{6} = \tfrac{1}{3}\)
- \(P(B^c) = P(A \cap B^c) + P(A^c \cap B^c) = \tfrac{1}{3} + \tfrac{1}{3} = \tfrac{2}{3}\)
- Total: \(P(S)=1\)
2×2 Probability Table with Marginals
| \(B\) (1 or 2) | \(B^c\) (3–6) | Row Total | |
|---|---|---|---|
| \(A\) (H) | \(\tfrac{1}{6}\) | \(\tfrac{1}{3}\) | \(\tfrac{1}{2}\) |
| \(A^c\) (T) | \(\tfrac{1}{6}\) | \(\tfrac{1}{3}\) | \(\tfrac{1}{2}\) |
| Col Total | \(\tfrac{1}{3}\) | \(\tfrac{2}{3}\) | \(1\) |
Venn Diagram (A = Heads, B = Die is 1 or 2)
Probability Rules
Addition Rule
\[ P(A \cup B) = P(A) + P(B) - P(A \cap B). \]
Mutually Exclusive
Two events are mutually exclusive when it is impossible for both to happen at the same time.
Therefore:
\[ P(A \cup B) = P(A) + P(B) \]
Complements
For any event \(A\):
\[ P(A^c) = 1 - P(A) \]
Example 1 (coin + die):
- \(P(A)=\tfrac{1}{2}\)
- \(P(B)=\tfrac{1}{3}\)
- \(P(A\cap B)=\tfrac{1}{6}\)
Apply the rule: \[ P(A\cup B)=\tfrac{1}{2}+\tfrac{1}{3}-\tfrac{1}{6}=\tfrac{2}{3}. \]
Set view: \[ A\cup B=\{(H,1),(H,2),(H,3),(H,4),(H,5),(H,6),(T,1),(T,2)\},\quad |A\cup B|=8. \]
Board Problems
Problem 1
Out of 100 students:
- 40 like pizza
- 30 like burgers
- 10 of those included above like both pizza and burgers
Experiment: I select one student at random
Let:
- \(A =\) “student likes pizza”
- \(B =\) “student likes burgers”
- What is \(P(A)\)?
- What is \(P(B)\)?
- What is \(P(A \cap B)\)?
- What is \(P(A \cup B)\) using the addition rule?
- What is \(P(A^c)\), the probability a student does not like pizza?
- What is \(P(B^c)\), the probability a student does not like burgers?
- What is \(P(A^c \cap B^c)\), the probability a student likes neither?
- Verify your results using the 2×2 probability table.
- Represent the results with a Venn diagram.
- \(P(A) = \tfrac{40}{100} = 0.40\)
- \(P(B) = \tfrac{30}{100} = 0.30\)
- \(P(A \cap B) = \tfrac{10}{100} = 0.10\)
- \(P(A \cup B) = P(A) + P(B) - P(A \cap B) = 0.40 + 0.30 - 0.10 = 0.60\)
- \(P(A^c) = 1 - P(A) = 1 - 0.40 = 0.60\)
- \(P(B^c) = 1 - P(B) = 1 - 0.30 = 0.70\)
- \(P(A^c \cap B^c) = 1 - (A \cup \ B) = 1 - \tfrac{60}{100} = \tfrac{40}{100} = 0.40\)
2×2 Probability Table with Marginals
| \(B\) (burger) | \(B^c\) (not burger) | Row Total | |
|---|---|---|---|
| \(A\) (pizza) | \(\tfrac{10}{100} = 0.10\) | \(\tfrac{30}{100} = 0.30\) | \(\tfrac{40}{100} = 0.40\) |
| \(A^c\) (not pizza) | \(\tfrac{20}{100} = 0.20\) | \(\tfrac{40}{100} = 0.40\) | \(\tfrac{60}{100} = 0.60\) |
| Col Total | \(\tfrac{30}{100} = 0.30\) | \(\tfrac{70}{100} = 0.70\) | \(1\) |
Venn Diagram
Problem 2
Shade \(A \cap B^c\)
Problem 3
Shade \((A \cup B)^c\)
Problem 4
Shade \(\big( (A \cup B)^c \big) \cup (A \cap B)\)

Problem 5
Shade \((A \cup B)^c \cap C\)
