math.wiki
Probability › Compound events › Union and intersection of events
Open on the map
Algebra 2 · S.CP.A.1

Union and intersection of events

A spinner is about to be spun. You win if it lands on an even number or on a multiple of 5. Which landings win, which win for both reasons at once, and how likely is each?

Where you are 10 in Compound events

Why this exists

An event is a set of outcomes, and its probability, when the outcomes are equally likely, is a count of that set over the count of the whole sample space. That handles one description at a time: “the spinner lands on an even number”. Real questions join descriptions. You win if the number is even or a multiple of 5. A ticket is valid if it is for today and for this seat. A part passes if it is not cracked.

Because events are sets, the joining words already have exact meanings waiting for them. “Or” is the union of the two sets, “and” is their intersection, and “not” is the complement inside the sample space. Once a compound description is turned into a set, finding its probability is the same counting as before. The work this lesson does is the turning: reading a sentence with “and”, “or” and “not” in it and finding exactly which outcomes it names.

Definition

Let A and B be events in the same sample space S.

The event “A or B” is the set of outcomes that are in A, in B, or in both. It is the union A \cup B. It happens when at least one of A and B happens.

The event “A and B” is the set of outcomes that are in A and also in B. It is the intersection A \cap B. It happens when both happen on the same trial.

The event “not A” is the set of outcomes of S that are not in A. It is the complement A^{c}. It happens exactly when A does not.

The “or” of probability is the inclusive or: an outcome in both events counts as “A or B”. An event that leaves out the shared outcomes, “exactly one of A and B”, is a different event and is always said in full.

When the outcomes of S are equally likely, every one of these new events gets its probability the usual way, by counting:

P(E) = \frac{n(E)}{n(S)},

where n(E) is the number of outcomes in E. So

\begin{aligned} P(A \cap B) &= \frac{n(A \cap B)}{n(S)}, \\ P(A \cup B) &= \frac{n(A \cup B)}{n(S)}. \end{aligned}

Intuition

Draw the sample space as a rectangle and each event as a loop inside it. Every outcome then sits in exactly one of four regions: in A only, in both, in B only, or in neither.

A
B
S
2
4
6
8
12
14
16
18
10
20
5
15
1
3
7
9
11
13
17
19
Figure 1One spin of a spinner with 20 equal sectors. A is an even number, B a multiple of 5. The shaded lens is A \cap B; everything inside either circle is A \cup B.

Figure 1 places all 20 outcomes of one spin. “A and B” is the lens in the middle, the outcomes that make both statements true: 10 and 20. “A or B” is everything inside at least one loop: the eight in A only, the two in the lens and the two in B only, twelve outcomes. “Not A” is everything outside loop A, which is every odd number. Each compound word is a region you can point to, and its probability is the share of the twenty sectors that region holds.

The picture also shows the sizes in order. The lens sits inside loop A, and loop A sits inside the union, so “and” can never hold more outcomes than either event alone, and “or” can never hold fewer.

Results

Order of the three. For any events A and B,

\begin{aligned} &A \cap B \subseteq A \subseteq A \cup B, \\ &P(A \cap B) \le P(A) \le P(A \cup B). \end{aligned}

The same holds with B in the middle.

The four regions. “A only” (A \cap B^{c}), “both” (A \cap B), “B only” (A^{c} \cap B) and “neither” (A^{c} \cap B^{c}) share no outcome and between them hold all of S, so their probabilities add to 1. The first three together make A \cup B, so

\begin{aligned} n(A \cup B) &= n(A \cap B^{c}) + n(A \cap B) \\ &\quad + n(A^{c} \cap B), \\ P(\text{neither}) &= 1 - P(A \cup B). \end{aligned}

Not, and, or (De Morgan’s laws). “Neither” and “not both” are two different events:

\begin{aligned} (A \cup B)^{c} &= A^{c} \cap B^{c}, \\ (A \cap B)^{c} &= A^{c} \cup B^{c}. \end{aligned}

Why P(A) + P(B) is not P(A \text{ or } B) in general. Adding n(A) and n(B) counts every outcome of A \cap B twice, so the sum equals n(A \cup B) exactly when A \cap B is empty. Turning that into a rule for probabilities is the work of The general addition rule.

Why it is true

Order. An outcome in A \cap B is in A, by the meaning of “and”. An outcome in A is in A \cup B, by the meaning of “or”. So each set sits inside the next, and a set inside another has no more outcomes. Dividing by the same positive n(S) keeps the order. (For outcomes that are not equally likely the same holds, because the probability of the larger event is the probability of the smaller one plus that of the outcomes it adds, which is not negative.)

Four regions. Any outcome either is in A or is not, and either is in B or is not. That is two yes-or-no questions, so four possible answers, and each outcome gives exactly one answer pair. So each outcome lies in exactly one region. The outcomes of A \cup B are those with at least one “yes”, which are the first three regions; the rest is “neither”, so n(\text{neither}) = n(S) - n(A \cup B), and dividing by n(S) gives the second formula.

De Morgan. An outcome is outside A \cup B exactly when it is in neither loop, which means it is outside A and outside B: that is A^{c} \cap B^{c}. An outcome is outside A \cap B exactly when it fails at least one of the two, which means it is outside A or outside B: that is A^{c} \cup B^{c}.

Double counting. n(A) counts the regions “A only” and “both”; n(B) counts “both” and “B only”. Their sum counts “both” twice and the other two once, while n(A \cup B) counts each of the three once. The two agree exactly when “both” is empty.

Worked examples

Example 1

Even or a multiple of five

A spinner has 20 equal sectors numbered 1 to 20. It is spun once. Let A be “the number is even” and B be “the number is a multiple of 5”. Find P(A \cap B) and P(A \cup B), and compare P(A \cup B) with P(A) + P(B).

Solution

The sectors are equal, so the 20 outcomes are equally likely and every probability is a count over 20. Write each event as a set:

\begin{aligned} A &= \{2, 4, 6, 8, 10, 12, 14, 16, 18, 20\}, \\ B &= \{5, 10, 15, 20\}. \end{aligned}

“A and B” keeps the numbers in both lists, A \cap B = \{10, 20\}, so

P(A \cap B) = \frac{2}{20} = \frac{1}{10}.

“A or B” takes every number in at least one list, writing each once: the ten even numbers, then 5 and 15 from B (the 10 and 20 of B are already listed). So n(A \cup B) = 12 and

P(A \cup B) = \frac{12}{20} = \frac{3}{5}.

Adding the separate probabilities gives \displaystyle P(A) + P(B) = \frac{10}{20} + \frac{4}{20} = \frac{14}{20}, which is too large by \displaystyle \frac{2}{20}. The 10 and the 20 are in both lists, so the sum counted each of them twice. Figure 1 shows the twelve winning sectors as the inside of the two loops.

Example 2

A red cube and a blue cube

A red number cube and a blue number cube are rolled. Let A be “the red cube shows 6” and B be “the sum of the two cubes is at least 10”. Find P(A \cap B), P(A \cup B) and the probability that exactly one of A and B happens.

Solution

An outcome is a pair (red, blue). Each cube has 6 faces, so there are 6 \times 6 = 36 pairs, all equally likely. Figure 2 lays them out as a grid.

1
1
2
2
3
3
4
4
5
5
6
6
\text{blue cube}
\text{red}
Figure 2Shaded row: A, the red cube shows 6. Dotted cells: B, the sum is at least 10. A shaded cell with a dot is in A \cap B.

A is the bottom row: (6,1), (6,2), (6,3), (6,4), (6,5), (6,6), six outcomes. For B, the sum is 10, 11 or 12:

\begin{aligned} B = \{&(4,6), (5,5), (6,4), \\ &(5,6), (6,5), (6,6)\}, \end{aligned}

six outcomes. The pairs in both are the dotted cells of the shaded row, (6,4), (6,5) and (6,6):

P(A \cap B) = \frac{3}{36} = \frac{1}{12}.

The union is the six cells of the row plus the dotted cells off the row, (4,6), (5,5) and (5,6), so n(A \cup B) = 9 and

P(A \cup B) = \frac{9}{36} = \frac{1}{4}.

“Exactly one” is the union with the shared cells taken out, 9 - 3 = 6 outcomes: (6,1), (6,2), (6,3) from A only and (4,6), (5,5), (5,6) from B only. Its probability is \displaystyle \frac{6}{36} = \frac{1}{6}. This is not the same event as “A or B”, which also wins on the three shared cells.

Example 3

Reading “and” and “or” from a table

A shop has 48 jackets on a rack, sorted as follows.

hoodno hoodtotal
waterproof16824
not waterproof101424
total262248

One jacket is picked at random. Let W be “the jacket is waterproof” and H be “the jacket has a hood”. Find P(W \cap H), P(W \cup H) and P(W^{c} \cap H^{c}).

Solution

Each jacket is one equally likely outcome, so n(S) = 48. Each inside cell of the table is one of the four regions of a Venn diagram, and the totals are whole events.

“Waterproof and hooded” is the single cell where the waterproof row meets the hood column:

P(W \cap H) = \frac{16}{48} = \frac{1}{3}.

“Waterproof or hooded” is every jacket in the waterproof row or the hood column. The whole waterproof row gives 24, and the hood column adds only its cell outside that row, 10, since the 16 waterproof hooded jackets are already counted. So n(W \cup H) = 34 and

P(W \cup H) = \frac{34}{48} = \frac{17}{24}.

“Not waterproof and not hooded” is the one remaining cell, 14:

P(W^{c} \cap H^{c}) = \frac{14}{48} = \frac{7}{24}.

Check. W \cup H and “neither” are complements, and 34 + 14 = 48, so the two probabilities add to 1, as they must.

Example 4

Not both, or neither

Return to the spinner of Example 1. Find the probability that the number is not both even and a multiple of 5, and the probability that it is neither even nor a multiple of 5.

Solution

“Not both” is the complement of “both”, (A \cap B)^{c}. Only 10 and 20 are both, so every other sector, 18 of them, is “not both”:

P\big((A \cap B)^{c}\big) = \frac{18}{20} = \frac{9}{10}.

“Neither” is outside both loops of Figure 1: odd and not a multiple of 5. The odd numbers are 1, 3, 5, \dots, 19; taking out 5 and 15 leaves \{1, 3, 7, 9, 11, 13, 17, 19\}, eight outcomes. This is A^{c} \cap B^{c}, the complement of the union, and the union had 12 outcomes, so the count agrees: 20 - 12 = 8.

P(A^{c} \cap B^{c}) = \frac{8}{20} = \frac{2}{5}.

The two sentences sound alike and give \displaystyle \frac{9}{10} against \displaystyle \frac{2}{5}. “Not both” lets a number such as 4 through, since 4 is even but not a multiple of 5; “neither” does not. In symbols, (A \cap B)^{c} = A^{c} \cup B^{c} while (A \cup B)^{c} = A^{c} \cap B^{c}, which are De Morgan’s laws.

Example 5

Finding the overlap from the probabilities

A sample space has 30 equally likely outcomes. Two events have \displaystyle P(A) = \frac{2}{5}, \displaystyle P(B) = \frac{1}{3} and \displaystyle P(A \cup B) = \frac{8}{15}. Find P(A \cap B).

Solution

Turn each probability back into a count by multiplying by 30:

\begin{aligned} n(A) &= \tfrac{2}{5} \cdot 30 = 12, \\ n(B) &= \tfrac{1}{3} \cdot 30 = 10, \\ n(A \cup B) &= \tfrac{8}{15} \cdot 30 = 16. \end{aligned}

The union is made of A together with the outcomes of B that are not in A. A supplies 12 of the 16, so “B only” has 16 - 12 = 4 outcomes. B has 10 outcomes in all, split between “B only” and “both”, so “both” has 10 - 4 = 6:

P(A \cap B) = \frac{6}{30} = \frac{1}{5}.

Check. The regions are A only 12 - 6 = 6, both 6, B only 4, which add to 16 = n(A \cup B), and neither 30 - 16 = 14.

Example 6

One event inside the other

An integer from 1 to 36 is chosen at random. Let A be “the number is a multiple of 6” and B be “the number is even”. Find P(A \cap B) and P(A \cup B).

Solution

Every multiple of 6 is 2 \times 3k, so it is even: every outcome of A is also in B, which is A \subseteq B. Then “A and B” adds no condition beyond A, and “A or B” adds no outcome beyond B:

A \cap B = A, \qquad A \cup B = B.

A = \{6, 12, 18, 24, 30, 36\} has 6 outcomes and B has the 18 even numbers up to 36, so

\begin{aligned} P(A \cap B) &= \frac{6}{36} = \frac{1}{6}, \\ P(A \cup B) &= \frac{18}{36} = \frac{1}{2}. \end{aligned}

This is the order of the Results at its extreme: P(A \cap B) \le P(A) \le P(A \cup B) becomes \displaystyle \frac{1}{6} = \frac{1}{6} \le \frac{1}{2}, with the first two equal because the overlap is all of A.

Boundaries

The counting formula needs equally likely outcomes. The sets A \cup B, A \cap B and A^{c} mean the same thing in any experiment, but \displaystyle P(E) = \frac{n(E)}{n(S)} only gives their probabilities when every outcome of S is as likely as every other. On a spinner with unequal sectors the union of two events is still the same set of sectors, and its probability is the sum of those sectors’ own probabilities, not a count.

Both events must live in one sample space. “The coin lands heads” and “the cube shows 3” can only be joined by “and” once the outcomes record both the coin and the cube, as pairs. Before that the two events are sets of different kinds of thing and have no intersection to speak of.

“Or” is inclusive. Throughout probability “A or B” includes the outcomes in both. “Exactly one”, “either but not both” and “only A” are other events, (A \cap B^{c}) \cup (A^{c} \cap B) and A \cap B^{c}, and have to be said in those words.

“And” means on the same trial. A \cap B is the set of single outcomes where both descriptions are true at once. When “and” joins the results of two separate stages, such as a first draw and a second draw, it is still an intersection, but of events in the sample space of the whole two-stage experiment; finding its probability without listing every outcome is the work of Tree diagrams and organized lists and The general multiplication rule.

An event needs a description that settles every outcome. “And” and “or” can only be applied to events whose membership is decided outcome by outcome; a vague phrase is not an event, and joining it to another does not make it one.

Where this goes next

The union’s count was always found by listing or by going region by region. When only the probabilities P(A), P(B) and P(A \cap B) are known, the general addition rule in The general addition rule turns the double-counting seen in Example 1 into a formula. The case where the overlap is empty, so that the separate probabilities simply add, is Mutually exclusive events and the addition rule. The counting version of the same idea, with no probabilities, is Venn diagrams and counting a union.

The intersection leads the other way. The cells of a table like the one in Example 3 are intersections, and the totals are single events, which is the language of Joint and marginal probability. Asking what share of B is taken up by A \cap B is Conditional probability, and building P(A \cap B) from a chain of stages is the The general multiplication rule.

Exercises

Listing compound events

  1. A ball is drawn at random from 16 balls numbered 1 to 16. Let A be “the number is odd” and B be “the number is prime”. List A \cap B and find P(A \cap B).
  2. For the balls numbered 1 to 16, with A odd and B prime, list A \cup B and find P(A \cup B).
  3. For the balls numbered 1 to 16, with A odd and B prime, find the probability that the number is neither odd nor prime.
  4. For the balls numbered 1 to 16, with A odd and B prime, find the probability that exactly one of A and B happens.
  5. For the balls numbered 1 to 16, with A odd and B prime, describe A^{c} \cap B in words, list it and find its probability.
  6. For the balls numbered 1 to 16, with A odd and B prime, list A \cap B^{c} and find its probability.

Two cubes, and a coin with a cube

  1. A red and a blue number cube are rolled. Let C be “the two cubes show the same number” and D be “the sum is 8”. Find P(C \cap D).
  2. With the red and blue cubes, C “the same number” and D “the sum is 8”, find P(C \cup D).
  3. With the red and blue cubes, C “the same number” and D “the sum is 8”, find the probability of neither.
  4. A coin is tossed and a number cube is rolled. Let H be “the coin shows heads” and F be “the cube shows at least 5”. List the sample space and find P(H \cap F).
  5. For the coin and cube of Exercise 10, find P(H \cup F).

Reading a table

For Exercises 12 to 15, a cafe took 50 orders one morning, sorted as below. One order is picked at random. Let T be “the drink is hot” and F be “the order includes food”.

with foodno foodtotal
hot drink121830
cold drink15520
total272350
  1. Find P(T \cap F) for the 50 cafe orders.
  2. Find P(T \cup F) for the 50 cafe orders.
  3. Find P(T^{c} \cap F^{c}) for the 50 cafe orders.
  4. Find P\big((T \cap F)^{c}\big) for the 50 cafe orders, and say in words what it measures.

Counting backwards and nested events

  1. For the balls numbered 1 to 16, with A odd and B prime, find the sizes of (A \cup B)^{c}, A^{c} \cap B^{c} and A^{c} \cup B^{c}, and say which two are the same event.
  2. A sample space has 40 equally likely outcomes, with \displaystyle P(A) = \frac{1}{4}, \displaystyle P(B) = \frac{3}{10} and \displaystyle P(A \cap B) = \frac{1}{10}. Find P(A \cup B).
  3. A sample space has 24 equally likely outcomes, with \displaystyle P(A) = \frac{1}{2}, \displaystyle P(B) = \frac{1}{3} and \displaystyle P(A \cup B) = \frac{2}{3}. Find P(A \cap B).
  4. An integer from 1 to 48 is chosen at random. Let A be “a multiple of 8” and B be “a multiple of 4”. Find P(A \cap B) and P(A \cup B).

Reasoning

  1. Explain why P(A \cap B) can never be larger than P(A), and say when the two are equal.
  2. For one roll of a number cube, give two events A and B with P(A \cup B) = P(A) + P(B), and two events for which it fails. Explain what decides which happens.
  3. Explain why the four events A \cap B^{c}, A \cap B, A^{c} \cap B and A^{c} \cap B^{c} between them contain every outcome of S exactly once.
  4. Can P(A \cup B) = P(A \cap B) happen for events with equally likely outcomes? Explain when.
Answers
  1. A \cap B = \{3, 5, 7, 11, 13\} and \displaystyle P(A \cap B) = \frac{5}{16}. The primes up to 16 are 2, 3, 5, 7, 11, 13, and all except 2 are odd.
  2. A \cup B is \{1, 2, 3, 5, 7, 9, 11, 13, 15\} and \displaystyle P(A \cup B) = \frac{9}{16}. The eight odd numbers, plus 2, the one prime that is not odd.
  3. \displaystyle \frac{7}{16}. Neither is \{4, 6, 8, 10, 12, 14, 16\}, the 16 - 9 = 7 outcomes outside the union.
  4. \displaystyle \frac{1}{4}. Exactly one is the union without the overlap, 9 - 5 = 4 outcomes, \{1, 9, 15, 2\}, and \displaystyle \frac{4}{16} = \frac{1}{4}.
  5. “The number is not odd and is prime”, that is even and prime: A^{c} \cap B = \{2\}, with probability \displaystyle \frac{1}{16}.
  6. A \cap B^{c} = \{1, 9, 15\}, odd but not prime, with probability \displaystyle \frac{3}{16}. Note 1 is not prime.
  7. \displaystyle \frac{1}{36}. Of the six pairs with equal numbers only (4,4) has sum 8.
  8. \displaystyle \frac{5}{18}. C has 6 pairs, D = \{(2,6), (3,5), (4,4), (5,3), (6,2)\} has 5, and (4,4) is in both, so the union has 6 + 4 = 10 pairs and \displaystyle \frac{10}{36} = \frac{5}{18}.
  9. \displaystyle \frac{13}{18}. Neither has 36 - 10 = 26 pairs, and \displaystyle \frac{26}{36} = \frac{13}{18}.
  10. S holds H1, H2, H3, H4, H5, H6, T1, T2, T3, T4, T5, T6, so 12 equally likely outcomes. H \cap F = \{H5, H6\}, so \displaystyle P(H \cap F) = \frac{2}{12} = \frac{1}{6}.
  11. \displaystyle \frac{2}{3}. H \cup F is the six heads outcomes plus T5 and T6, 8 outcomes, and \displaystyle \frac{8}{12} = \frac{2}{3}.
  12. \displaystyle \frac{6}{25}. The hot-drink, with-food cell is 12, and \displaystyle \frac{12}{50} = \frac{6}{25}.
  13. \displaystyle \frac{9}{10}. The hot row gives 30 and the food column adds its cold cell, 15: \displaystyle \frac{45}{50} = \frac{9}{10}.
  14. \displaystyle \frac{1}{10}. Cold drink and no food is the cell 5, and \displaystyle \frac{5}{50} = \frac{1}{10}.
  15. \displaystyle \frac{19}{25}. It is the probability that the order is not a hot drink with food, so every order except the 12 in that cell: \displaystyle \frac{38}{50} = \frac{19}{25}.
  16. (A \cup B)^{c} has 7 outcomes, A^{c} \cap B^{c} has 7 and A^{c} \cup B^{c} has 16 - 5 = 11. The first two are the same event, “neither odd nor prime”, by De Morgan’s law.
  17. \displaystyle \frac{9}{20}. The counts are n(A) = 10, n(B) = 12, n(A \cap B) = 4, so A only is 6, B only is 8 and the union is 6 + 4 + 8 = 18: \displaystyle \frac{18}{40} = \frac{9}{20}.
  18. \displaystyle \frac{1}{6}. The counts are n(A) = 12, n(B) = 8, n(A \cup B) = 16. “B only” is 16 - 12 = 4, so both is 8 - 4 = 4, and \displaystyle \frac{4}{24} = \frac{1}{6}.
  19. \displaystyle P(A \cap B) = \frac{1}{8} and \displaystyle P(A \cup B) = \frac{1}{4}. Every multiple of 8 is a multiple of 4, so A \cap B = A with 6 outcomes and A \cup B = B with 12: \displaystyle \frac{6}{48} and \displaystyle \frac{12}{48}.
  20. Every outcome of A \cap B is an outcome of A, so A \cap B has no more outcomes than A, and with any probabilities the larger event adds outcomes of probability at least zero. They are equal for equally likely outcomes exactly when every outcome of A is also in B, that is A \subseteq B.
  21. For example A “shows 1” and B “shows 2”: \displaystyle P(A \cup B) = \frac{2}{6} = \frac{1}{6} + \frac{1}{6}. For A “even” and B “at least 4”: A \cup B = \{2, 4, 5, 6\} has probability \displaystyle \frac{4}{6}, but \displaystyle \frac{3}{6} + \frac{3}{6} = 1. The sum works exactly when the two events share no outcome, because a shared outcome is counted in both P(A) and P(B) but only once in P(A \cup B).
  22. Each outcome is either in A or not, and either in B or not. The four events are the four possible answer pairs (yes and no, yes and yes, no and yes, no and no), and each outcome has exactly one answer pair, so it lies in exactly one of the four events.
  23. Yes, exactly when A = B. Since A \cap B \subseteq A \cup B, the two have equal probability with equally likely outcomes only when they are the same set, and that means there is no outcome in A only or in B only, so A and B have the same outcomes.
unattributed · CC-BY-SA-4.0