CHAPTER 2(Discrete Maths)
CHAPTER 2(Discrete Maths)
CHAPTER 2
COUNTING METHODS
Combinatorics is a fascinating branch of discrete Mathematics, which deals with the art of
counting. Very often we ask the question, in how many ways can a certain task be done? Usually
Combinatorics comes to our rescue. In most cases, listing the possibilities and counting them is
the least desirable way of finding the answer to such a problem. Enumeration, the counting of
objects with certain properties is an important part of Combinatorics.
Let 𝐴 and 𝐵 be two mutually exclusive tasks. Suppose task 𝐴 can be done in 𝑚 ways and task 𝐵
in 𝑛 ways.Then there are 𝑛 + 𝑚 ways to do one of these tasks.
Example 1:- Suppose that either a member of the mathematics faculty or a student who is
mathematics major is chosen as a representative to a university committee. How many different
choices are there for this representative if there are 37 members of the mathematics faculty and
83 mathematics majors?
Solution: Let 𝐴 be the task, choosing a member of the mathematics faculty, can be done in 37
ways. Let 𝐵 be the task, choosing mathematics major, can be done in 83 ways. From the sum
(addition) rule, it follows that there are 37 + 83 = 120 possible ways to pick this representative.
✓ The addition principle can be extended to any finite number of pair wise mutually
exclusive tasks, using induction, for instance, let 𝑇1 , 𝑇2 , 𝑇3 ,…, 𝑇𝑛 be 𝑛 pair wise mutually
exclusive tasks. Suppose task 𝑇𝑖 can be done in 𝑚𝑖 ways, where1 ≤ i ≤ n. Then
task𝑇1 , 𝑇2 , 𝑇3 ,…, 𝑇𝑛 can be done to 𝑚1 + 𝑚2 + ⋯ + 𝑚𝑛 ways.
Example 2:- A freshman has selected four courses and needs one more course for the next term.
There are 15 courses in English, 10 in French and 6 in German. She is eligible to task. In how
many ways can she choose the fifth course?
Solution: Let 𝐸 be the task of selecting a course in English, 𝐹 be the task of selecting a course
in French and 𝐺 that of selecting a course in German. These tasks can be done in 15, 10 and 6
Hu 1 2024
Discrete Mathematics and Combinatory Math2011
ways, respectively, and are mutually exclusive, so by addition principle, the fifth course can be
selected in |𝐸| + |𝐹| + |𝐺| = 15 + 10 + 6 = 31 way.
The sum can be phrased in terms of sets as: if 𝐴1 , 𝐴2 , … , 𝐴𝑛 are disjoint sets, then the number of
elements in the union of these sets is the sum of the number of elements in them. To relate this
to our statement of the sum rule, let 𝑇𝑖 be the task of choosing an element from 𝐴𝑖 for 𝑖 =
1,2, … , 𝑛. There are |𝐴𝑖 | (|𝐴𝑖 | is the notation for the cardinality of 𝐴𝑖 ) ways to do 𝑇𝑖 . From the
sum rule, since no two of the tasks can be done, at the same time the number of ways to choose
an element from one of the sets, which is the number of elements in the union is
|𝐴1 ∪ 𝐴2 ∪ … 𝐴𝑛 | = |𝐴1 | + |𝐴2 | + ⋯ + |𝐴𝑛 |
This equality applies only when the sets in question are disjoint.
Multiplication principle
The most important counting principle is the multiplication principle. It allows for counting (like,
example the experiment consisting of both rolling a dice and tossing a coin), and this principle
apply when a procedure is made up of separate task.
Multiplication principle: if an experiment consisting of 𝑘 independent steps, in such a way that:
✓ The first step has 𝑛1 possible out come
✓ Any outcome of the first can be followed by 𝑛2 outcome of the 2nd step,
✓ Any one of the first and the second step can be followed 𝑛3 outcome of the 3rd step
.
.
.
Then the total number of outcomes 𝑛1 , 𝑛1 ,…, 𝑛𝑘
In total 𝑛1 𝑛2 𝑛3 =
3 × 2 × 4 = 24
possible out coomes.
Hu 2 2024
Discrete Mathematics and Combinatory Math2011
Example 4:- How many distinct phone numbers are there if we assume that a phone number is
made of 6 digits with the first digit begin different from 0 and 1?
Solution: Assume that 𝑎1 be the first digit, 𝑎2 be the second digits, 𝑎3 , 𝑎4, 𝑎5, 𝑎6 be the 3rd, 4th
,5th and 6th digit respectively. But 𝑎1 ≠ 0 𝑎𝑛𝑑 1. So we have 8 possible choice of 𝑎1 and we
have 10 possible choices for the digit 𝑎2 to 𝑎6 .
Therefore, 8 × 105 = 800,000 distinct phone number.
Example 5:- In how many ways can the letters of the word ‘CAR’ be reordered to produce
distinct ‘words’.
Solution: We have 3 possibilities for the first letter, 2 possibilities for the 2nd letter and have to
use the remaining letter. So, there are 3 × 2 × 1 = 6 distinct ‘words’.
Theorem 2 (Multiplication principle)
Suppose a task 𝑇 is made up of two subtasks. Subtask 𝑇1 followed by subtask 𝑇2 . If subtask 𝑇1
can be done in 𝑚 1ways and subtask 𝑇2 in 𝑚 2 different way for each way subtask 𝑇1 can be
done, then task 𝑇 can be done in 𝑚1 𝑚2 ways.
Example 6:- Find the number of two letter words that begins with a vowel 𝑎, 𝑒, 𝑖, 𝑜 or 𝑢.
Solution : The task of forming a two-letter word consists of two subtasks 𝑇1 𝑎𝑛𝑑 𝑇2 , 𝑇1
consisting of the first letter and 𝑇2 selecting the second letter; as figure 2 shows
Number of choices
? ?
Subtask 𝑇1 Subtask 𝑇2
Figure 2
Since each word must begin with a vowel, 𝑇1 can be accomplished in five ways. There is no
restriction on the choice of the 2nd letter, so 𝑇2 can be done in 26 ways (figure 3).
Number of choices
5 26
Subtask 𝑇1 Subtask 𝑇2
Figure 3
Hu 3 2024
Discrete Mathematics and Combinatory Math2011
𝑏𝑎 𝑏𝑏 𝑏𝑐 𝑏𝑑
𝑐𝑎 𝑐𝑏 𝑐𝑐 𝑐𝑑
𝑑𝑎 𝑑𝑏 𝑑𝑐 𝑑𝑑
ii.Permutations without repetitions. The order of listing the letters is important, and
repetition is not allowed. In this case there are 4 ·3 = 12 possible selections:
𝑎𝑏 𝑎𝑐 𝑎𝑑
𝑏𝑎 𝑏𝑐 𝑏𝑑
𝑐𝑎 𝑐𝑏 𝑐𝑑
𝑑𝑎 𝑑𝑏 𝑑𝑐
iii.Combinations with repetitions. The order of listing the letters is not important, and
repetition is allowed. In this case there are
4 ·3
+ 4 = 10 possible selections:
2
Hu 4 2024
Discrete Mathematics and Combinatory Math2011
𝑎𝑎 𝑎𝑏 𝑎𝑐 𝑎𝑑
𝑏𝑏 𝑏𝑐 𝑏𝑑
𝑐𝑐 𝑐𝑑
𝑑𝑑
iv. Combinations without repetitions. The order of listing the letters is not important, and
repetition is not allowed. In this case there are.
4 ·3
= 6 Possible selections: 𝑎𝑏 𝑎𝑐 𝑎𝑑
2
𝑏𝑐 𝑏𝑑
𝑐𝑑
Example 1:- Eight runners take part in a race. How many different of ways of allocating medals
(gold, silver and bronze) are there?
Solution: We choose 𝑟 = 3 medalists from the 𝑛 = 8 runners (the order dosen’t matter). The
number of 3 −permutation of 8 runners is 8 × 7 × 6 = 336 ways the medals can be handed out,
8!
thus, 𝑝(8,3) = 336 = (8−3)!
Example 2:- Find the number of words that can be formed by scrambling the letter of the word
SCRAMBLE (remember, a word is just an arrangement of symbols, it need not make sense )?
Solution: The word SCRAMBLE contains eight distinct letters. Therefore, the number of words
that can be formed equals. The number of arrangements of the letters in the word, namely
Hu 5 2024
Discrete Mathematics and Combinatory Math2011
8!
𝑝(8,8) = (8−8)! = 8 × 7 × 6 × 5 × 4 × 3 × 2 × 1 = 40,320
Example 4: - Find the number of different arrangements of the letter of the word REFERENCE.
Solution: The word REFERENCE contain nine letters; two R’s and four E’s, the remaining
9!
letters are distinct, now by theorem 1.9, the total number of words are 2!4! = 7560.
But 𝑟! of these ways result in the same set of 𝑟 objects. Since the ordering is not important, only
their membership is important. We will investigate such unordered arrangements in this section.
Definition 2:- An 𝑟 −combination of elements of a set, where 0 ≤ 𝑟 ≤ 𝑛 , is an unordered
selection of 𝑟 elements from the set. Thus, an 𝑟 −combination is simply a subset of the set with
𝑟 −elements. The number of 𝑟 −combinations of a set with 𝑛 elements is denoted
Hu 6 2024
Discrete Mathematics and Combinatory Math2011
𝑛
by 𝐶(𝑛, 𝑟)𝑜𝑟 ( ). Both notations frequently appear in combinatorics. The number of
𝑟
combinations is also called the binomial coefficient.
Example 1:- Find the number of 𝑟 −combinations of the set {𝑎, 𝑏, 𝑐} when 𝑟 = 0,1,2 𝑜𝑟 3
Solution:
▪ Exactly one subset contains zero element, the null set
Number of 0 − 𝑐ombinations: 𝐶(3,0) = 1
▪ Three subsets contain one elements each: {𝑎}, {𝑏} 𝑎𝑛𝑑 {𝑐}.
Number of 1 −combinations: 𝐶(3,1) = 3
▪ Three subset contains two elements each: {𝑎, 𝑏}, {𝑏, 𝑐}, 𝑎𝑛𝑑 {𝑐, 𝑎}
Number of 2 −combinations: 𝐶(3,2) = 3
▪ Finally, exactly one subset contains three elements: the set itself
Number of 3 −compinations: 𝐶(3,3) = 1
Theorem 2:- The number of 𝑟 −combinatios of a set with n elements, where 𝑛 is a nonnegative
integer and 𝑟 is an integer with 0 ≤ 𝑟 ≤ 𝑛 equals
𝑛!
𝐶(𝑛, 𝑟) = (𝑛−𝑟)!𝑟!
Note:
𝑛!
1. 𝐶(𝑛, 0) = 0!(𝑛−0)! = 1, that is, the number of 0 −combinations of a set with n
elements is one.
𝑛!
2. 𝐶(𝑛, 𝑛) = 𝑛!(𝑛−𝑛)! = 1, that is, the number of 𝑛 −combinations of a set with 𝑛
Hu 7 2024
Discrete Mathematics and Combinatory Math2011
Example 2:- John wants to go to the pub with 3 of his 5 best friends. How many options does
John have?
Solution: 3-combination of 5 is
5! 5! 5×4×3! 5×4
𝐶(5,3) = 3!(5−3)! = 3!2! = 2×1×3! = = 10
2
Hu 8 2024
Discrete Mathematics and Combinatory Math2011
Without repetition With repetition
Permutation 𝑛! 𝑛𝑟
𝑝(𝑛, 𝑟) =
(Retaining order) (𝑛 − 𝑟)!
Combination 𝑛 𝑛+𝑟−1
𝐶(𝑛, 𝑟) = ( ) ( )
𝑟 𝑟
(Not retaining order)
𝑛! (𝑛 + 𝑟 − 1)!
= =
(𝑛 − 𝑟)! 𝑟! 𝑟! (𝑛 − 1)!
Pigeonhole principle: - If 𝑛 + 1 objects are placed into 𝑛 boxes/containers, then some box must
contain at least 2 objects.
Proof: We prove the pigeonhole principle using proof by contraposition. Supposethat none
of the 𝑛 boxes contains more than one object. Then the total number of objects would be at
most 𝑛. This is a contradiction, because there are at least 𝑛 + 1 objects.
Remark: The expression ⌈𝑥⌉ called the ceiling function, is the smallest integer 𝑘,
such that k ≥ x and the expression ⌊𝑥⌋, called the floor function, is the largest integer 𝑟, such
that r ≤ x.
Examples:-
1. Among any group of 367 people, there must be at least two with the same birthday,
because there are only 366 possible birthdays.
2. If 50 people donate blood at the Red Cross, there must be at least 13people of the same
blood type.
100
3. Among 100 people there are at least ⌈ 12 ⌉ = 9 who were born in the same month.
Hu 9 2024
Discrete Mathematics and Combinatory Math2011
4. How many students must be in a class to guarantee that at least two students receive the
same score on the final exam, if the exam is graded on a scale from 0 to 100 points?
Solution: There are 101 possible scores on the final. The pigeonhole principle shows that
among any 102 students there must be at least 2 students with the samescore.
Solution: The minimum number of students needed to ensure that at least six students
N
receive the same grade is the smallest integer N such that ⌈ 5 ⌉ = 6 The smallest such
Hu 10 2024
Discrete Mathematics and Combinatory Math2011
Example 2: What is the coefficient of 𝑥12 𝑦13 in the expansion of (2𝑥 − 3𝑦)25
Solution: (2𝑥 − 3𝑦)25 = (2𝑥 + (−3𝑦))25. By the binomial theorem, we have
𝑛 𝑛
(2𝑥 − 3𝑦)25 = ∑𝑛𝑟=0 ( ) 𝑥 𝑛−𝑟 𝑦 𝑟 = ∑𝑛𝑟=0 ( ) (2𝑥)𝑛−𝑟 (−3𝑦)𝑟 .
𝑟 𝑟
Consequently, the coefficient of 𝑥12 𝑦 13 in the expansion is obtained when
𝑟 = 13, namely,
25 (2𝑥)25−13 25
( ) (−3𝑦)13 = ( ) (2𝑥)12 (−3𝑦)13
12 12
25
= ( ) (2)12 𝑥12 (−3)13 𝑦 13
12
25
= ( ) (2)12 (−3)13 𝑥12 𝑦13
12
25!
= 13!12! 212 (−13)13
Exercise
1. How many bit strings are there of length eight.
2. How many bit strings of length ten begin and end with a 1?
3. How many different functions are there from a set with 10 elements to a set with the following
numbers of elements
a) 2 b) 3 c) 4 d) 5
6. How many one to one function are there from a set with five elements to a set with the
following number of elements
a) 4 b) 5 c) 6 d) 7
7. A multi-choice test contains ten questions. There are four possible answer for each question
a) How many ways can a student answer the questions on the test if every question I
answered?
b) How many ways can a student answer the question on the test if the student can
leave answers blank?
8. Find the number of two-digit numerals that can be formed using the digits
2,3,5,6 𝑎𝑛𝑑 9 and that contain no repeated digits.
9. How many different strings can be made from the letters in MISSISSIPPI, using all the
letters.
10. How many different strings can be made from the letter in ORONO, using some or all of
the letters
Hu 11 2024
Discrete Mathematics and Combinatory Math2011
11. In one version of BASIC a variable name consists of letters or a letter followed by a digit.
Find the total number of possible names.
12. How many ways are there to select five unordered elements from a set with three elements
when repetition is allowed.
13. How many different ways are there to choose a dozen dounts from the 21 varieties at a
dount shpo
14. Solve each of the following, where 𝑛 ≥ 0
a) 𝑐(𝑛, 𝑜) = 1 c) 𝑐(𝑛, 1) = 10
b) 𝑐(𝑛, 2) = 28 d) 𝑐(𝑛, 𝑛 − 2) = 55
15. Make each sentence as true or false. When 𝑛 is an arbitrary non negative integer and 0 ≤
𝑟≤𝑛
a) p(n, r) = p(n, n − r) e). (m + n)! = m! + n!
b) 5 × 4! = 5! f). n(n − 1)! = n!
c) (2 × 3)! = 2! 3!
16. Find the number of ways of dividing a set of size 𝑛 into two disjoint subsets of sizes 𝑟 and
𝑛−𝑟
17. Find the number of three digit numerals that can be formed using the digit 2,3,5,6 and 9 if
repetitions are not allowed
18. Find the number of ways seven boys and three girls can be seated in a row if
a) A boy sit at each end of the row
b) A girl sits at each end of the row
c) The girl sit together at one end of the row
19. Find the coefficient of each:
a) 𝑥 3 𝑦 5 in the expansion of (𝑥 + 𝑦)8
b) 𝑥 4 𝑦 6 in the expansion of (𝑥 − 𝑦)10
c) 𝑥 2 𝑦 6 in the expansion of (2𝑥 + 𝑦)8
d) 𝑥 4 𝑦 5 in expansion (2𝑥 − 3𝑦)9
20. Use the binomial theorem, expand each
a) (𝑥 + 𝑦)6 c) (2𝑥 − 1)6
Hu 12 2024
Discrete Mathematics and Combinatory Math2011
b) (𝑥 − 𝑦)5 d) (𝑥 + 2𝑦)5
21. Find the largest binomial coefficient in the expansion of each
a) (𝑥 + 𝑦)5 c) (𝑥 + 𝑦)6
b) (𝑥 + 𝑦)4 d) (𝑥 + 𝑦)8
Hu 13 2024