A112 of 55
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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 k. Move k and compare with counting the outcomes on the 6 by 6 grid.
  • At k=7, 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?

Name it

Outcomes and events

The sample space S 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:

EventMeansSymbol
A or Bat least one happensA∪B
A and Bboth happenA∩B
not AA doesn't happenAc

A and B are mutually exclusive if they can't both happen: A∩B is empty.

The axioms

A probability P assigns a number to every event so that

  1. P(A)≥0;
  2. P(S)=1;
  3. if A and B are mutually exclusive, P(A∪B)=P(A)+P(B) (and the same for any list of them).

Everything else follows. For example:

  • complement: P(Ac)=1−P(A);
  • inclusion-exclusion: P(A∪B)=P(A)+P(B)−P(A∩B);
  • equally likely outcomes: if S has N outcomes, each with chance 1N, then P(A)=|A|N, the number of outcomes in A over N.

With three events, inclusion-exclusion adds the singles, subtracts the pairs and adds back the triple: P(A∪B∪C)=P(A)+P(B)+P(C)−P(AB)−P(AC)−P(BC)+P(ABC).

Worked example

Each bit of a three-bit word is flipped independently with probability p=0.1. List the sample space and find the chance of exactly one error.

Show the solution
  1. List the sample space. The error pattern is one of 000, 001, ..., 111, with chance pk(1−p)3−k for a pattern with k ones.
  2. Pick out exactly one error. It's the event {100, 010, 001}, three mutually exclusive outcomes, each with chance 0.1×0.92=0.081
  3. Add them. P=3×0.081=0.243
  4. Check. The eight chances add to (p+1−p)3=1.

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
  1. Inclusion-exclusion. Write S for failing the speed test and L for failing the leakage test: P(S∪L)=0.05+0.03−0.01=0.07 so 7% fail something.
  2. Passing both is the complement. 1−0.07=0.93

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
  1. Use the complement. The event "at least one false alarm" is the complement of "neither": 1−0.982=0.0396 just under 4%.
  2. Compare with adding the rates. Adding the two rates gives 4%, which slightly overcounts the boards that fail both: 0.022=0.0004
  3. Inclusion–exclusion agrees. P=0.02+0.02−0.0004=0.0396

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

P(A) = 0.3, P(B) = 0.25 and P(A∩B) = 0.15. What is P(A∪B)?

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 A and B 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 p and q.

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°.

Explain why

Why does inclusion-exclusion subtract P(A∩B)?

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.