4.5: Combinatorics- Inclusion/Exclusion
Terminology
Sometimes to count possibilities it is easier to over count and then count how much the over count was and fix it. For example, consider the size of the union of two sets \(A\) and \(B\) as shown in Figure \(\PageIndex{1}\) Note that \(|A|+|B|\) over counts the size of the union by precisely \(|A \cap B|.\) Thus the correct count is \((|A|+|B|)-|A \cap B|.\)
This can be extended to three sets. See Figure \(\PageIndex{2}\) This time there are three pairs of sets that overlap. Thus the count starts \((|A|+|B|+|C|)-(|A \cap B|+|A \cap C|+|B \cap C|).\) However this removes \(|A \cap B \cap C|\) three times. Thus the correct count is \((|A|+|B|+|C|)-(|A \cap B|+|A \cap C|+|B \cap C|)+|A \cap B \cap C|.\)
Because this process first includes (adds) everything, next excludes (subtracts) some things, then includes (adds) other things, the technique is called inclusion/exclusion .
To use inclusion-exclusion to count we must know the size of each of the sets and each of the intersections. Suppose we know the following.
- 210 students in Calculus I
- 36 students in Discrete Math
- 32 students in Programming I
- 1 student is in Calculus I and Discrete Math
- 8 students are in Calculus I and Programming I
- 6 students are in Discrete Math and Programming I
- 0 students are taking all three
The calculation for the total number of (distinct) students is as follows.
\begin{align*} |A|+|B|+|C| & =210+36+32 & & =278.\\ |A \cap B|+|A \cap C|+|B \cap C| & = 1+8+6 & & =15.\\ |A \cap B \cap C| & = 0.\\ |A \cup B \cup C| & = 278-15+0 & &= 263. \end{align*}
A permutation is a derangement if no element is in its original position.
For example “het” is a derangement of “the”, but “teh” is not a derangement.
Practice
Checkpoint \(\PageIndex{5}\)
Write the formula for the number of elements in the union of four, distinct sets.
Checkpoint \(\PageIndex{6}\)
Suppose you know that in the fall 2020 semester 37 distinct students took MATH A261, 25 distinct students took CSCE A311, and 11 distinct students took both. How many students total took either MATH A261 or CSCE A311 in the Fall 2020 semester?
Checkpoint \(\PageIndex{7}\)
Count all derangements of “one”.
Checkpoint \(\PageIndex{8}\)
Count all derangements of “four”.
Checkpoint \(\PageIndex{9}\)
Count the number of positive multiples of 2,3,5 that are less than 100.
Checkpoint \(\PageIndex{10}\)
If you know the following, what do you still need to know to determine the number of distinct students placing into MATH A054, WRTG A080, or having an SAT score below 1290?
- Number of distinct students taking MATH A054.
- Number of distinct students taking WRTG A080.
- Number of distinct students with SAT score below 1290.