We were able to count 3 digit numbers in the last section by constructing the number as a sequence of digits. We will use this example to think about how to count these as disjoint sets.
It is going to take practice to be able to see when to use the multiplication rule and when to use the addition rule. If you are counting elements of different sets, use addition. If you are counting elements that are constructed in a process (can you determine step 1, step 2, etc?), then use the multiplication rule. Many problems require both rules, as we saw in ExampleΒ 9.3.1.
If we want to count the number of elements in \(A\cup B\text{,}\) we can count those in \(A\) and those in \(B\text{.}\) But every element in the intersection has now been counted twice. so we need to subtract \(N(A\cap B)\text{.}\) This is the idea behind the Inclusion-Exclusion Rule.
For the case with three sets, we can see that each element in the intersection of at least two sets got counted twice, but when we subtract off all three intersections, we end up subtracting each element in more than one intersection twice, so we need to add back the elements in the intersection of all three sets. For this class, we wonβt need to use Inclusion-Exclusion on more than three sets, but the rule does generalize to \(n\) sets by adding the sets, subtracting intersections of two sets, adding the intersections of three sets, subtracting the intersections of four sets, etc.
We need a good way to count the multiples of 3. We know they have the form \(n=3k\text{.}\) Since \(1\leq n\leq 1000\text{,}\) we have that \(1\leq 3k \leq 1000\text{.}\) Hence, \(1/3\leq k\leq 1000/3\approx 333.3\text{.}\) Since \(k\in \mathbb{Z}\text{,}\)\(1\leq k\leq 333\text{.}\) Thus,
What is the number of integers from 1-50 divisible by 3 or 7? You can pretty easily check you answer by writing them all down. Can you use inclusion-exclusion to calculate this?
Suppose a study was done with three drugs, A, B and C. A total of 50 subjects used all three drugs. They reported which drugs made them feel better, with the following results:
Some of the subjects who had relief from, say, A, might also have had relief from another drug. So some of the 21 who reported feeling better with A, may also be included in the count of the 9 who felt better with A and B.
How many bit strings consist of from one through four digits? (Note, strings of different lengths are considered distinct. For example 10 and 0010 are distinct strings.)
At a certain company, passwords must be 3-5 symbols long and composed of the 26 letters, the ten digits, and the 14 symbols !, @, #, $, %, ^, &, *, (, ), \(-\text{,}\)\(+\text{,}\) {, }.
A college conducted a survey to explore the academic interests and achievements of its students. It asked students to place checks beside the numbers of all statements that were true of them. Statement #1 was βI was on the honor roll last term.β Statement #2 was βI belong to an academic club.β Statement #3 was βI am majoring in at least two subjects.β Out of a sample of 100 students, 28 checked #1, 26 checked #2, and 14 checked #3, 18 checked both #1 and #2, 4 checked both #1 and #3, 3 checked both #2 and #3, and 2 checked all three. Note that some of the students who checked #1 (or #2 or #3) may have also checked other numbers.