A11 · Lesson 2 · Sample spaces and events
Listing what can happen, then adding up chances
A three-bit code word crosses a noisy link. What's the chance that exactly one bit arrives wrong? That at least one does? That the first bit is wrong or the word has an odd number of errors? Questions like these get confusing fast unless you do what probability theory does: list everything that can happen, mark the outcomes each question is about, and add up their chances. Three rules, the axioms, are enough to make that bookkeeping consistent.
- Two dice are thrown many times. The histogram counts each sum from 2 to 12; the line is what exact counting predicts.
- The readout measures how often the sum is at least . Move and compare with counting the outcomes on the 6 by 6 grid.
- At , how many of the 36 outcomes count? Does the measured fraction agree?
Predict
Two dice are thrown. What is the chance that the sum is 7 or that the first die shows 6?
. Each event has 6 of the 36 outcomes, but one outcome, (6, 1), is in both. Adding would count it twice, so subtract it once: .
Name it
Outcomes and events
The sample space is the list of every possible outcome of the experiment. For two dice it has 36 ordered pairs; for a three-bit word sent over a link, the error pattern is one of 8 strings from 000 to 111.
An event is a set of outcomes, the ones a question is about: "the sum is 7" is the event {(1,6), (2,5), (3,4), (4,3), (5,2), (6,1)}. Events combine like sets:
| Event | Means | Symbol |
|---|---|---|
| or | at least one happens | |
| and | both happen | |
| not | doesn't happen |
and are mutually exclusive if they can't both happen: is empty.
The axioms
A probability assigns a number to every event so that
- ;
- ;
- if and are mutually exclusive, (and the same for any list of them).
Everything else follows. For example:
- complement: ;
- inclusion-exclusion: ;
- equally likely outcomes: if has outcomes, each with chance , then , the number of outcomes in over .
With three events, inclusion-exclusion adds the singles, subtracts the pairs and adds back the triple: .
Worked example
Each bit of a three-bit word is flipped independently with probability . List the sample space and find the chance of exactly one error.
Show the solution
- List the sample space. The error pattern is one of 000, 001, ..., 111, with chance for a pattern with ones.
- Pick out exactly one error. It's the event {100, 010, 001}, three mutually exclusive outcomes, each with chance
- Add them.
- Check. The eight chances add to .
Answer the sample space is the eight patterns 000 to 111, and the chance of exactly one error is 0.243.
Worked example
In a batch of chips, 5% fail a speed test, 3% fail a leakage test, and 1% fail both. What fraction fails at least one test? Passes both?
Show the solution
- Inclusion-exclusion. Write for failing the speed test and for failing the leakage test: so 7% fail something.
- Passing both is the complement.
Answer 7% fail at least one test, and 93% pass both.
Worked example
Two independent tests each give a false alarm on 2% of good boards. What fraction of good boards fail at least one?
Show the solution
- Use the complement. The event "at least one false alarm" is the complement of "neither": just under 4%.
- Compare with adding the rates. Adding the two rates gives 4%, which slightly overcounts the boards that fail both:
- Inclusion–exclusion agrees.
Answer 3.96% of good boards fail at least one test, just under 4%.
Check
Two dice are thrown. How many of the 36 outcomes have a sum of 5?
Check
= 0.3, = 0.25 and = 0.15. What is ?
Check
Each bit of a three-bit word flips independently with probability 0.05. What is the chance of exactly one error?
Check
With the same link (flip probability 0.1), what is the chance that at least one bit of the three is wrong?
Check
A board fails inspection A with probability 0.04, inspection B with probability 0.02, and both with probability 0.02. What is the chance it passes both?
Check
Events and are mutually exclusive, each with probability 0.3. Which is true?
Check
Chips fail test A with probability 0.02, test B with 0.03, and both with 0.01.
(a)
What fraction fails at least one?
(b)
What fraction fails A only?
Check
Two independent events have probabilities and .
Step 1
What is the chance both happen?
Type it the way you would write it, like 3sin(2πft) or 3*sin(2*pi*f*t). Angles can be in radians or carry a degree sign, like 45°.
Step 2
What is the chance at least one happens?
Explain why
Why does inclusion-exclusion subtract ?
adds the chances of every outcome in and every outcome in . An outcome in both sets is added twice, once from each, but the event " or " should count it only once. Subtracting removes the extra copy. When the events can't overlap, and the rule reduces to the third axiom.
Practice
Keep practicing
9 kinds of problem on this topic, dealt one at a time with new numbers every time, for as long as you like.