0% found this document useful (0 votes)
49 views

5 Session Five: Counting 5.1 Session Objectives 5.2 5.3 Counting 5.4 Counting Techniques

Uploaded by

Abdiz Idriz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views

5 Session Five: Counting 5.1 Session Objectives 5.2 5.3 Counting 5.4 Counting Techniques

Uploaded by

Abdiz Idriz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Contents

5 Session Five: Counting 2


5.1 Session Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
5.2 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
5.3 Counting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
5.4 Counting techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Discrete Mathematics Counting

5 Session Five: Counting


5.1 Session Objectives
By the end of this session, you should be able to:

(i) State the different counting techniques/rules .

(ii) Apply different counting techniques in counting problems .

5.2 Introduction
Counting techniques are discussed with particular emphaize on the inclusion-exclusion prin-
ciple.

5.3 Counting
Counting is the process of creating a bijection between a set we want to count and some
set whose size we already know. Typically this second set will be a finite ordinal N =
{1, 2, · · · , n}.
Counting a set A using a bijection f : A → N gives its size |A| = n which is called the
cardinality of N . Furthermore, it gives a well-ordering of A, since N is well-ordered as we
can define x ≤ y for x, y ∈ A by x ≤ y if and only if f (x) ≤ f (y).
Often the quickest way to find f is to line up all the elements of A in a well-ordering and
then count them off: the smallest element of A gets mapped to 1, the next smallest to 2,
and so on.
The branch of mathematics that studies sets constructed by combining other sets is called
combinatorics, and the subbranch that counts these sets is called enumerative combi-
natorics.

5.4 Counting techniques


We shall not adopt the bijection approach to compute the size of a set, but instead we shall
use standard counting principles based on how we constructed the set.

Theorem 5.4.1 (Addition/Sum Rule). Let A and B be finite disjoint sets (A ∩ B = ∅).
Then
|A ∪ B| = |A| + |B|
More generally, if A1 , A2 , · · · , An are pairwise disjoint sets (i.e., Ai ∩ Aj = ∅ ∀ i 6= j). Then

[n X n
Ai = |Ai |


i=1 i=1

Corollary 5.4.1. If A ⊆ B, |A − B| = |A| − |B|

Copyright
c Dr. Michael Munywoki, 2020. All rights reserved Page 2
Discrete Mathematics Counting

Theorem 5.4.2 (Subtraction Rule). For any sets A and B.

|A − B| = |A| − |A ∩ B|

Theorem 5.4.3 (Product Rule). For any finite sets A and B,

|A × B| = |A| × |B|

More generally, n
Y Y n
Ai = |Ai |


i=1 i=1

where the product on the left is a Cartesian product and the product on the right is an
ordinary integer product.
Theorem 5.4.4 (Inclusion-Exclusion Principle). Let A and B be finite sets. Then

|A ∪ B| = |A| + |B| − |A ∩ B|

Example 5.4.1. A total of 35 programmers interviewed for a job; 25 knew FORTRAN, 28


knew PASCAL, and 2 knew neither languages. How many knew both languages?
Solution:

A ⇒ FOTRAN programmers, B ⇒ PASCAL programmers


A∩B ⇒ Knew both FOTRAN & PASCAL programmers
|A ∪ B| = |A| + |B| − |A ∩ B| ⇒ 33 = 25 + 28 − |A ∩ B|
⇒ |A ∩ B| = 20

Example 5.4.2. In a discrete mathematics class every student is a major in computer


science or mathematics, or both. The number of students having computer science as a
major (possibly along with mathematics) is 25; the number of students having mathematics
as a major (possibly along with computer science) is 13; and the number of students majoring
in both computer science and mathematics is 8. How many students are in this class?
Solution:

A ⇒ Computer Science majors


B ⇒ Maths majors
A∩B ⇒ Joint Computer Science and Maths majors
Therefore,
|A ∪ B| = |A| + |B| − |A ∩ B| = 25 + 13 − 8 = 30.

Theorem 5.4.5. Let A, B and C be any finite sets.

|A ∪ B ∪ C| = |A| + |B| + |C| − |A ∩ B| − |A ∩ C| − |B ∩ C| + |A ∩ B ∩ C|

Copyright
c Dr. Michael Munywoki, 2020. All rights reserved Page 3
Discrete Mathematics Counting

We state the general Inclusion-Exclusion Principle in the following theorem.


Theorem 5.4.6 (Inclusion-Exclusion Principle). Let A1 , A2 , · · · , An be finite sets. Then
X X
|A1 ∪ A2 ∪ · · · ∪ An | = |Ai | − |Ai ∩ Aj |
1≤i≤n 1≤i≤j≤n
X
+ |Ai ∩ Aj ∩ Ak | − · · ·
1≤i≤j≤k≤n
n+1
+ (−1) |A1 ∩ A2 ∩ · · · ∩ An |

Remark 5.4.1. To calculate the size of Al ∪ A2 ∪ · · · ∪ An , calculate the sizes of all possible
intersections of sets from {A1 , A2 , · · · , An }, add the results obtained by intersecting an odd
number of the sets, and then subtract the results obtained by intersecting an even number of
the sets.
Example 5.4.3. Give a formula for the number of elements in the union of four sets.
Solution:

|A1 ∪ A2 ∪ A3 ∪ A4 | = |A1 | + |A2 | + |A3 | + |A4 |


−|A1 ∩ A2 | − |A1 ∩ A3 | − |A1 ∩ A4 |
−|A2 ∩ A3 | − |A2 ∩ A4 | − |A3 ∩ A4 |
+|A1 ∩ A2 ∩ A3 | + |A1 ∩ A2 ∩ A4 |
+|A1 ∩ A3 ∩ A4 | + |A2 ∩ A3 ∩ A4 |
−|A1 ∩ A2 ∩ A3 ∩ A4 |
Note 5.4.1. Note that this formula contains 15 different terms, one for each nonempty
subset of {A1, A2, A3, A4}. Generally |A1 ∪ A2 ∪ · · · ∪ An | has 2n − 1 terms.
Example 5.4.4. How many positive integers not exceeding 1000 are divisible by 7 or 11.
Solution:
Let
A: Positive integers not exceeding 1000 and divisible by 7
B: Positive integers not exceeding 1000 and divisible by 11
A∪B : Positive integers not exceeding 1000 and divisible by 7 or 11
A∩B : Positive integers not exceeding 1000 and divisible by 7 and 11

So
|A ∪ B| = |A| + |B| − |A ∩ B|
     
1000 1000 1000
= + −
7 11 7 · 11
= 142 + 90 − 12

Copyright
c Dr. Michael Munywoki, 2020. All rights reserved Page 4
Discrete Mathematics Counting

Exercise 5.4.1. 1. A total of 1232 students take a course in Spanics, 879 take a course
in French, and 114 take a course in Russian. Further, 103 take courses in both Spanish
and French, 23 take both Spanish and Russian, and 14 take courses in both French and
Russian. If 2092 students are taking at least one Spanich, French, and Russian, how
many students take a course in all the three languages?

Solution:

2. Suppose that there are 1807 freshmen at your school. Of these, 453 are taking a
course in computer science, 567 are taking a course in mathematics, and 299 are
taking courses in both computer science and mathematics. How many are not taking a
course either in computer science or in mathematics?

3. 5. Find the number of elements in A1 ∪ A2 ∪ A3 if there are 100 elements in A1 , 1000


in A2 , and 10, 000 in A3 if

(a) A1 ⊆ A2 and A2 ⊆ A3 .
(b) the sets are pairwise disjoint.
(c) there are two elements common to each pair of sets and one element in all three
sets.

For more material on Counting check out [2, 1, 3] or check the following additional reading
notes:1, 2 and 3. For more reference material you can also watch inclusion-exclusion principle.

References
[1] D. J. Hunter. Essentials of Discrete Mathematics. Jones & Bartlett Learning, 4 edition,
2021. ISBN-13:978-1284184761.

[2] O. Levin. Discrete Mathematics: An Open Introduction. Independent, 8 edition, 2018.


ISBN-13 :978-1792901690.

[3] K. Ross. Discrete Mathematics and Its Applications. McGraw-Hill Higher Education, 8
edition, 2018.

Copyright
c Dr. Michael Munywoki, 2020. All rights reserved Page 5

You might also like