Probability: Inclusion-Exclusion Principle

Interactive · 8 questions

Inclusion-Exclusion Principle

Before we get to practice word problems using the inclusion-exclusion principle, it might help to see what the principle looks like in a picture.

If A and B are events, then the intersection is the space overlapping between A and B; the union is the space covered by A combined with the space covered by B, possibly with overlap

With the inclusion-exclusion principle, we're going to use our knowledge of what's in each part of the Venn diagram to solve for a missing value.

Let's try an example.

Suppose we have two sets, A and B, such that A has 17 numbers in it. There are 35 elements in the union and there are 6 elements in the intersection. Using this information, find the number of elements in B.

Before we start trying to find n(B),n(B), let's fill in what we already know on our diagram.

What number should we put in the pink area of our diagram?

HINT: This is the union. Think of it like our total.

Choose one answer

Interactive · 2 questions

Principles of Inclusion and Exclusion

Let's say we are trying to count the number of students in a class. The only data we have is that everyone in the class plays a sport. 1212 people play basketball, 1616 people play baseball, and 44 people play both. How many people are in the class? At first this seems easy, just add up all the numbers and there are 3232 people in the class, right? Well it isn't that simple...

First let's look at our data. We know there are 1212 people who play basketball, but 44 of those people ALSO play baseball. So we know we have already counted 44 of the baseball people already. So in order to not double count anyone, we will subtract 44 people from the 1616 people playing baseball. Therefore we have:

12+16−4=2412 + 16 - 4 = 24

people in total. This can also be seen in a Venn Diagram.

8 kids play just basketball, 12 play just baseball, and 4 play both. Notice the numbers add up to 24.

This Venn Diagram illustrates my point!

We call this method of solving problems the Inclusion-Exclusion Principle.

However, the Inclusion-Exclusion Principle goes farther than that! What about if we have three sports? By now we need to use some basic set notation! A set is a group of things.

By the way, if you have a set A and a set B, the set of all elements that are either in A or B, is called A∪B.A\cup B. The set of all elements that are in both A and B is known as A∩B.A\cap B. The set that is NOT A is known as A′A ^ \prime

What does A∪B∪CA\cup B \cup C mean?

Choose one answer

Illustrated · 2 min

Introduction

Before we get started let's have a brief review of Venn diagrams. Venn diagrams are those circle things that overlap. Remember?

Circles A and B overlap

Set AA is the left circle, set BB is the right circle, and the space they overlap is the set that contains both AA and B.B.

We also have some notation: ∪\cup and ∩\cap

The union is the number that can be either AA or B.B. We denote it with the u-shape ∪\cup as A∪BA\cup B. Think "u" for union. The union of all the sets will be equal to the total amount of elements of each set.

The intersection holds the elements that are members of both AA and B.B. This is the overlap slice. We denote it with the n-shape ∩\cap as A∩BA\cap B. Think "n" for intersection.

Now we introduce the Inclusion-Exclusion Principle with this in mind.

Inclusion-Exclusion Principle

The inclusion-exclusion principle is a way to relate the set A, the set B, and the intersection to the union.

It says that if we add the elements in Set AA to the elements of Set BB and subtract the elements of A∩BA\cap B (intersection) we get the total number of elements or the union, A∪BA\cup B.

A∪B=A+B−A∩BA\cup B=A+B-A\cap B

Example

Suppose you ask 3535 people if they own a dog or a cat. 2323 of them say they only own a dog and 1616 say they only own a cat. How many own both a cat and a dog?

23 people own only a dog (left circle), 16 people own only a cat (right circle), 35 own at least one cat or dog

We can use our equation to figure this out. A∪B=A+B−A∩B35=23+16−A∩BA∩B=23+16−35A∩B=4\begin{align} A\cup B&=A+B-A\cap B\\ 35&=23+16-A\cap B\\ A\cap B&=23+16-35\\ A\cap B&=4 \end{align}

So we know that 44 of those people own both a dog and a cat! Now that is important information. Make friends with those 44 people.

Probability

We can use the inclusion-exclusion principle in tandem with probability. The formula is almost identical too. P(A∪B)=P(A)+P(B)−P(A∩B)P(A\cup B)=P(A)+P(B)-P(A\cap B) Which means the probability of the union is equal to the probability of AA plus the probability of BB minus the probability of the intersection. In order to find the probability of the intersection we must multiply P(A)P(A) and P(B)P(B) together. Thus, P(A∪B)=P(A)+P(B)−P(A∩B)=P(A)+P(B)−P(A)⋅P(B).\begin{align} P(A\cup B)&=P(A)+P(B)-P(A\cap B)\\ &=P(A)+P(B)-P(A) \cdot P(B) . \end{align}

Example

Suppose a neighborhood has a 50%50\% chance that a household has a pet. There's a 35%35\% chance they own a dog and a 25%25\% chance of owning a cat. What is the probability that they own both a dog and a cat?

We can use our i-e principle! P(A∪B)=P(A)+P(B)−P(A∩B)0.5=0.35+0.25−P(A∩B)P(A∩B)=0.35+0.25−0.5P(A∩B)=0.1\begin{align} P(A\cup B)&=P(A)+P(B)-P(A\cap B)\\ 0.5&=0.35+0.25-P(A\cap B)\\ P(A\cap B)&=0.35+0.25-0.5\\ P(A\cap B)&=0.1 \end{align}

There's a 10%10\% chance that if someone owns a pet, they own both a dog and a cat. I don't know about you but I wouldn't want to move into a neighborhood with that low of odds.

Video · + 1 min read

(Video) Ch9Pr4: Inclusion/Exclusion Principle

by MathsStatsUNSW

In this video, we walk through a problem that uses the inclusion-exclusion principle.

Summary\large{\text{Summary}}

We have 150150 students and 33 beer bands: A,B,CA, B, C.

Given information:

  • 5858 students drink AA

  • 4949 students drink BB

  • 5757 students drink CC

  • 1414 students drink A∩CA\cap{C}

  • 1313 students drink A∩BA\cap{B}

  • 1717 students drink B∩CB\cap{C}

  • 44 students drink A∩B∩CA\cap{B}\cap{C}

How many students drink none of the beers?

We can do this problem with venn diagrams which is seen in the video, or we can use the inclusion-exclusion principle.

To find how many students drink none of the beers, we want the compliment of the union of all the students that drink all the beers. The formula is A∪B∪C=A+B+C−(A∩B)−(A∩C)−(B∩C)+(A∩B∩C)A\cup{B}\cup{C}=A+B+C-(A\cap{B})-(A\cap{C})-(B\cap{C})+(A\cap{B}\cap{C})

We can plug in the numbers given above to get the number of students that drink beer AA, BB, or CC. We see, A∪B∪C=58+49+57−14−13−17+4=124A\cup{B}\cup{C}=58+49+57-14-13-17+4=124 Now, to find the number of students that don't drink any beer. We find the compliments of A∪B∪CA\cup{B}\cup{C}. The compliment is found by taking the total number of students and subtracting the amount of students that drink beers AA, BB, or CC. This means 150−A∪B∪C150-A\cup{B}\cup{C}. So, 150−124=126150-124=126

126126 students drink none of the beers!

Type a concept, like “slope” or “photosynthesis”.

↑ ↓ to choose · Enter to openSearch explanations and problems