Search the courses, subjects, tracks, games and features, or jump straight to a page.
Learn it your way
A short class with Sarah and her students. The other ways are under More.
Sign up free to listen. Transcripts are free to read.
Today we will talk about the Principle of Inclusion-Exclusion, or PIE, which helps us count the elements in the union of sets. Can anyone tell me what happens when we just add the sizes of two overlapping sets?
I think we would count the overlapping elements twice.
Exactly! So, to avoid double counting, we subtract the intersection. This leads us to our first formula for two sets, which is |A ∪ B| = |A| + |B| - |A ∩ B|. Can we recall what it means by each term?
|A| is the count in set A, |B| is the count in set B, and |A ∩ B| is the count of elements in both sets.
Great! Let's confirm our understanding. If set A has 5 elements, set B has 3 elements, and their intersection has 1 element, what is |A ∪ B|?
|A ∪ B| = 5 + 3 - 1, which gives us 7.
Correct! So let's summarize our first session: we learned about avoiding double counting through the intersection of two sets. Now, moving on...
Now, let's extend PIE from two sets to three sets. Can anyone state the formula for three sets?
It should be |A ∪ B ∪ C| = |A| + |B| + |C| - |A ∩ B| - |A ∩ C| - |B ∩ C| + |A ∩ B ∩ C|.
Correct! Notice how we add the individual sizes first, then subtract the pairwise intersections. Why do we add back the intersection of all three sets?
Because it gets subtracted too many times when we subtract the pairwise intersections.
Exactly! So if sets A, B, and C have 4, 5, and 3 elements respectively, with pairwise intersections of 1, 2, and 1, what is |A ∪ B ∪ C|?
It would be 4 + 5 + 3 - 1 - 2 - 1 + 1, which equals 9.
Excellent! In summary, we learned how to correctly account for overlaps in three sets. Now, let’s explore the general case...
Let's generalize PIE for n sets. Who can recall how we express the union of n sets?
We sum the sizes of all sets, subtract the size of all pairwise intersections, and continue alternately adding and subtracting higher-order intersections.
Right! The formula alternates the signs. This gives us a robust way to calculate |A_1 ∪ A_2 ∪ ... ∪ A_n|. Can someone provide an example?
If we have five sets with specific overlaps, we can apply the formula to find their union count step by step.
So essentially, you’re ensuring every element is counted once?
Precisely! Remember that the sequence of signs is key. As a recap, we discussed the extension of inclusion-exclusion to n sets and how to apply it practically.
Inunion, we add and subtract with glee, intersection’s the key to count accurately.
Imagine three friends at a party—each friend can only invite distinct guests but they all want the same cake. Count everyone enjoying the cake without repeats!
Remember: S P A = Single, Pair, All. Count singles, then pairs, and finally add all together.
I.E.P.O – Inclusion-Exclusion Principle On multiple sets.
Term
What does the Principle of Inclusion-Exclusion do?
Click to flip
Term
How do you calculate the cardinality of the union of three sets?
Click to flip
A formula used to find the cardinality of the union of multiple sets by adding the sizes of individual sets and subtracting the sizes of their intersections.
The number of elements in a set, representing its size.
A diagram representing sets, showing all possible logical relations between them.
The set containing all elements common to the intersecting sets.
The set containing all elements from both sets being considered.
This section introduces the Principle of Inclusion-Exclusion (PIE) for counting the cardinality of union sets, extending from two sets to n sets.
The section elaborates on the Principle of Inclusion-Exclusion, explaining its foundation using Venn diagrams and showcasing its generalization for n sets. The application includes counting problems and emphasizes how it avoids double counting in overlapping sets.
The Principle of Inclusion-Exclusion (PIE) is a crucial counting technique in discrete mathematics. Initially introduced for two sets, it elegantly extends to three and eventually n sets. The section discusses how to determine the cardinality of the union of multiple sets using this principle.
PIE for Two Sets:
The cardinality of the union of two sets A and B is given by:
|A igcup B| = |A| + |B| - |A igcap B|
This corrects the over-counting of the intersection.
PIE for Three Sets:
The extension incorporates pairwise intersections and the intersection of all three sets:
|A igcup B igcup C| = |A| + |B| + |C| - |A igcap B| - |A igcap C| - |B igcap C| + |A igcap B igcap C|
Generalization for n Sets:
The formula for n sets accounts for all intersections:
|A_1 igcup A_2 igcup ... igcup A_n| = ext{(sum of cardinalities of individual sets)} - ext{(sum of pairwise intersections)} + ext{(sum of triple intersections)} - ... + (-1)^{n-1} |A_1 igcap ... igcap A_n|
This formula allows for alternate addition and subtraction of intersections, which ensures that every element in the union is counted once.
Understanding PIE allows for practical applications in combinatorics and helps solve various counting problems without double counting and overlooking unique elements.