Sub topic 4
Compound Events: Reading “And” and “Or”
Assume you can work with fractions, ratios, percentages, and basic counting. You should also know that an event is a set of outcomes from a probability experiment. A compound event combines two or more events.
Let:
- \(A\) = the first die shows 6
- \(B\) = the second die shows 6
The words and and or describe different operations.
“And” means both events occur
The event \(A\) and \(B\), written \(A \cap B\), occurs only when both conditions are true. With two dice, this happens only for the outcome \((6,6)\).
For two fair dice, there are 36 equally likely outcomes, so:
\[ P(A \text{ and } B)=\frac{1}{36} \]
When listing outcomes, keep only outcomes that satisfy both conditions.
“Or” means at least one event occurs
The event \(A\) or \(B\), written \(A \cup B\), occurs when \(A\) happens, \(B\) happens, or both happen.
For the dice example:
- \(A\) has 6 outcomes because the first die can be 6 while the second die varies.
- \(B\) has 6 outcomes because the second die can be 6 while the first die varies.
- \((6,6)\) belongs to both events.
If you simply add the counts, you count \((6,6)\) twice. Therefore, subtract the overlap once:
\[ P(A \text{ or } B)=P(A)+P(B)-P(A \text{ and } B) \]
\[ P(A \text{ or } B)=\frac{6}{36}+\frac{6}{36}-\frac{1}{36} =\frac{11}{36} \]
| Phrase | Meaning | Symbol |
|---|---|---|
| \(A\) and \(B\) | Both events occur | \(A \cap B\) |
| \(A\) or \(B\) | At least one event occurs | \(A \cup B\) |
| Neither \(A\) nor \(B\) | Neither event occurs | \((A \cup B)^c\) |
from fractions import Fraction
from itertools import product
space = list(product(range(1, 7), repeat=2))
def probability(event):
favorable = sum(event(outcome) for outcome in space)
return Fraction(favorable, len(space))
A = lambda outcome: outcome[0] == 6
B = lambda outcome: outcome[1] == 6
p_or = probability(lambda outcome: A(outcome) or B(outcome))
p_rule = probability(A) + probability(B) - probability(
lambda outcome: A(outcome) and B(outcome)
)
print(p_or) # 11/36
print(p_rule) # 11/36Mutually exclusive events
Two events are mutually exclusive if they cannot happen at the same time. For example, on one roll of a die:
- \(C\) = rolling an even number
- \(D\) = rolling an odd number
No result is both even and odd, so \(P(C \text{ and } D)=0\). For mutually exclusive events, the addition rule simplifies to:
\[ P(C \text{ or } D)=P(C)+P(D) \]
Do not use this shortcut unless the events cannot overlap.
Exercise
A number is selected at random from 1 through 20. What is the probability that it is a multiple of 3 or a multiple of 4?
Show answer
There are 6 multiples of 3, 5 multiples of 4, and 1 overlap, which is 12. Thus the probability is (6 + 5 - 1) / 20 = 1/2.