Free preview

15 lessons

Essential Probability & Statistics for ML

Free preview

Essential Probability & Statistics for ML · 15 lessons

Master the fundamentals

No surprise gaps

Actually remember it

Skip what you know

One subscription. All learning paths included.

Our content is best on a larger screen

Exactly one of two events

Exactly one of AA, BB

Explanation

We are often interested in determining when exactly one of two events has occurred, but not both. For example, let AA be the event "a student passes the first exam" and BB the event "the student passes the second exam". The student passes exactly one exam by passing the first and failing the second, or by failing the first and passing the second.

The first case is A∩BcA \cap B^c and the second is Ac∩BA^c \cap B. Either case counts, so we take the union of the two events.

Exactly one of AA, BB

Definition

The event that exactly one of AA and BB occurs is

(A∩Bc)∪(Ac∩B)(A \cap B^c) \cup (A^c \cap B)

This is not A∪BA \cup B, because the union also contains the overlap A∩BA \cap B, where both events occur.

The diagram below builds the event on a Venn diagram in four steps. Work through them with the buttons.

Ω
A
B

Step 1: A occurs, B does not

The shaded region holds the outcomes in A only: in A but not in B. This is the event A∩Bc.

It is also the set difference A∖B, read "A minus B".

Step 2: B occurs, A does not

The shaded region holds the outcomes in B only: in B but not in A. This is the event Ac∩B.

As a set difference, it is B∖A.

Step 3: Exactly one occurs

Joining the two regions gives the event that exactly one of A, B occurs:

(A∩Bc)∪(Ac∩B)

In set-difference notation, this is (A∖B)∪(B∖A). The overlap, where both events occur, is left out.

Step 4: Compare with A∪B

The union A∪B contains both regions and also the overlap A∩B, where both events occur.

So A∪B is larger than the event that exactly one occurs.

Example

Two coins are flipped, so Ω={HH,HT,TH,TT}\Omega = \{HH, HT, TH, TT\}. Let AA be the event "the first coin shows heads" and BB the event "the second coin shows heads". Write the event "exactly one head" as a set expression in AA and BB, and list its outcomes.

Solution

Exactly one head means one coin shows heads and the other does not. Either the first coin shows heads and the second does not, which is A∩BcA \cap B^c, or the second shows heads and the first does not, which is Ac∩BA^c \cap B. Either case counts, so the event is the union:

(A∩Bc)∪(Ac∩B)(A \cap B^c) \cup (A^c \cap B)

To list it, we write out the two events and their complements:

A={HH,HT},Ac={TH,TT}B={HH,TH},Bc={HT,TT}\begin{align*} A &= \{HH, HT\}, & A^c &= \{TH, TT\} \\ B &= \{HH, TH\}, & B^c &= \{HT, TT\} \end{align*}

The only outcome in both AA and BcB^c is HTHT, and the only outcome in both AcA^c and BB is THTH:

A∩Bc={HT},Ac∩B={TH}A \cap B^c = \{HT\}, \qquad A^c \cap B = \{TH\}

These are the differences A∖BA \setminus B and B∖AB \setminus A. Joining them gives the event:

(A∩Bc)∪(Ac∩B)={HT,TH}(A \cap B^c) \cup (A^c \cap B) = \{HT, TH\}

The outcome HHHH lies in the overlap, where both events occur, and TTTT lies outside both circles, where neither occurs. Neither is in the shaded regions below.

Ω
A
B
HT
HH
TH
TT

Practice questions

4 questions

A standard die is rolled, so Ω={1,2,3,4,5,6}\Omega = \{1, 2, 3, 4, 5, 6\}. Let AA be "the roll is even" and BB be "the roll is greater than 33".

Which set is the event that exactly one of AA, BB occurs?

Select the correct answer:

+ 3 more questions

Exactly one as union minus overlap

Explanation

Another way to build "exactly one of AA, BB" starts from the union. The union A∪BA \cup B is the event that at least one of AA, BB occurs. It contains every outcome where exactly one occurs, but also the overlap A∩BA \cap B, where both occur.

So we remove the overlap from the union. This is the set difference

(A∪B)∖(A∩B)(A \cup B) \setminus (A \cap B)

The diagram below builds the event in two steps. Work through them with the buttons.

Ω
A
B

Step 1: Start from the union

A∪B

The union holds every outcome where A occurs, B occurs, or both do. It includes the overlap A∩B, where both events occur.

Step 2: Remove the overlap

(A∪B)∖(A∩B)

Removing the overlap leaves the outcomes in A only, A∩Bc, and the outcomes in B only, Ac∩B. These are the outcomes where exactly one event occurs.

Writing the set difference as an intersection with a complement gives a second form.

Exactly one as union minus overlap

Theorem

The event that exactly one of AA and BB occurs is

(A∪B)∖(A∩B)=(A∪B)∩(A∩B)c(A \cup B) \setminus (A \cap B) = (A \cup B) \cap (A \cap B)^c

On the diagram, removing the overlap from the union leaves the outcomes in AA only, A∩BcA \cap B^c, and those in BB only, Ac∩BA^c \cap B. So both forms describe the same event as (A∩Bc)∪(Ac∩B)(A \cap B^c) \cup (A^c \cap B).

EventReads as
(A∩Bc)∪(Ac∩B)(A \cap B^c) \cup (A^c \cap B)AA but not BB, or BB but not AA
(A∪B)∖(A∩B)(A \cup B) \setminus (A \cap B)at least one, with both removed
(A∪B)∩(A∩B)c(A \cup B) \cap (A \cap B)^cat least one, and not both

All three describe the same event. Many events can be written in more than one way, and which form is easiest to work with depends on the information we have.

Here, if AA and BB are listed, the first applies directly. If we know only the union and the overlap, the second does. If we know only that at least one occurs and that not both occur, the third does.

Example

A spinner lands on one of the numbers 11 to 88, so Ω={1,2,…,8}\Omega = \{1, 2, \ldots, 8\}. Let AA be "the number is at most 55" and BB be "the number is odd". Find the event that exactly one of AA, BB occurs.

Solution

Listing the outcomes of each event:

A={1,2,3,4,5},B={1,3,5,7}A = \{1, 2, 3, 4, 5\}, \qquad B = \{1, 3, 5, 7\}

The union holds the numbers in at least one event, and the overlap holds the numbers in both:

A∪B={1,2,3,4,5,7}A∩B={1,3,5}\begin{align*} A \cup B &= \{1, 2, 3, 4, 5, 7\} \\ A \cap B &= \{1, 3, 5\} \end{align*}

Exactly one event occurs on the union with the overlap removed:

(A∪B)∖(A∩B)={1,2,3,4,5,7}∖{1,3,5}={2,4,7}(A \cup B) \setminus (A \cap B) = \{1, 2, 3, 4, 5, 7\} \setminus \{1, 3, 5\} = \{2, 4, 7\}

The numbers 22 and 44 are at most 55 but even, and 77 is odd but greater than 55.

Practice questions

4 questions

Two events AA and BB in Ω={1,2,…,10}\Omega = \{1, 2, \ldots, 10\} have

A∪B={1,2,4,5,7,8},A∩B={4,7}A \cup B = \{1, 2, 4, 5, 7, 8\}, \qquad A \cap B = \{4, 7\}

Which set is the event that exactly one of AA, BB occurs?

Select the correct answer:

+ 3 more questions