Topic 8 Count
Topic 8 Count
8
LEARNING OUTCOMES
By the end of this topic, you should be able to:
1. Explain the principles of counting and pigeonhole principle;
2. Use the principles of counting and pigeonhole principle in solving
some problems in Information Technology; and
3. Solve recurrence relation.
X INTRODUCTION
The second application of integer is for counting. In solving some
problems in Information Technology, we need to do some counting. For
example, we need to count the number of routes from one node in a
computer network to another node. In this topic, we will discuss several
tools for counting. The last section of this topic discusses briefly the concept
of recurrence relation since this concept is sometimes being used in counting.
SELF-CHECK 8.1
Is counting only about counting as „one‰, „two‰, „three?‰ Counting is
more than what you knew.
ACTIVITY 8.1
How can you apply the principles in this chapter in any gambling
game? Express your ideas.
Multiplication Principle:
If an activity can be constructed in t successive steps and step 1 can be done in
n1 ways, step 2 can then be done in n2 ways, abd step t can then be done in nt
ways, then the number of different possible activities is n1. n2 . nt.
Example 8.1a
Suppose that a school has four academic societies (English Club, Mathematical
Society, Science Society and History Society) and three non-academic societies
(Police Cadette, Red Crescent and Debating Society). Suppose that every student
has to join one academic society and one non-academic society. How many
possible options is available to a student to choose?
Addition Principle:
Suppose that X1 Xt are sets and that the ith set X1 has n1 elements.
If {X1 Xt} is a pairwise disjoint family (i.e. if i z j, ) the number of possible
elements that can be selected from X1 or X2 or .. Xt is
n1 + n2 + . + nt
Example 8.1b
In how many ways can we select one book from different subjects among five
distinct computer science books, three distinct mathematics books, and two
distinct arts books?
Solution: Since these sets of selection are pairwise disjoint, we may use the
Addition Principle to conclude that there are
5 + 3 + 2 = 10
ways to selecting one book from different subjects among the computer
science, mathematics and art books.
Example 8.1c
Solution: An eight bit string that begins 101 can be constructed in five successive
steps:
(i) select the fourth bit.
(ii) select the fifth bit.
TOPIC 8 COUNTING W101
Since each of the five bits can be selected in two ways, by Multiplication
Principle, there are
2 . 2 . 2 . 2 . 2 = 25 = 32
eight bit strings that begin 101. The same argument can be used to show that
there are 32 eight bit strings that begin 111. Since there are 32 eight bit strings that
begin 111, there are 32 + 32 = 64 eight bit strings that begin either 101 or 111.
Example 8.1d
A six person committee composed of Aisyah, Rizal, Azman, Azam, Ainee, and
Aiman is to select a chairperson, secretary, and treasurer. In how many ways
can this be carried out?
The chairperson can be selected in six ways. Once the chairperson has been
selected, the secretary can be selected in five ways. After selecting the chairperson
and secretary, the treasurer can be selected in four ways. Therefore, the total
number of possibilities is
6 . 5 . 4 = 120.
Example 8.1e
In the example 8.1d, in how many ways can this be done if either Aisyah or Rizal
must be the chairperson?
102 X TOPIC 8 COUNTING
20 + 20 = 40
possibilities.
Example 8.1f
Refer to Example 8.1d. In how many ways can this be done if Ainee must hold
one of the offices?
20 + 20 + 20 = 60
possibilities.
Second solution: Let us consider the activity of assigning Ainee and two
others to offices to be made up of three successive steps:
(i) Assign Ainee an office
(ii) Fill the highest remaining office
(iii) Fill the last office
There are three ways to assign Ainee an office. Once Ainee has been assigned and
the highest remaining office filled, there are four ways to fill the last office.
By the Multiplication Principle, there are
3 . 5 . 4 = 60 possibilities.
TOPIC 8 COUNTING W103
ACTIVITY 8.2
2. A man has eight shirts, four pairs of pants, and five pairs of
shoes.
How many different outfits are possible?
8.2 PERMUTATION
Example 8.2a
There are six permutations of three elements. If the elements are denoted A, B, C,
the six permutations are
Theorem 8.2a:
The number of permutations of n elements is n !.
TOPIC 8 COUNTING W105
Example 8.2b
There are 24 permutations of four objects, since 4! = 4.3.2.1 = 24.
Theorem 8.2b:
If 1 d r d n, then the number of permutations of n elements taken r at a time is
n(n 1)(n 2).(n r + 1).
Example 8.2c
How many two letter words can be formed from letters in the set {a,b,c,d} if
repeated letters are allowed?
ab,ac,ad,ba,bc,bd,ca,cd,cd,da,db,dc
P (4, 2) = 43 = 12
n! 4! 4! 4<3< 2<1
P(n, r) = = = = = 12
(n - r)! (4 - 2)! 2! 2<1
ACTIVITY 8.3
1. A bank password consists of two letters of the English alphabet
followed by two digits. How many different passwords are there?
2. In a psychological experiment, a person must arrange a square, a
cube, a circle, a triangle, and a pentagon in a row. How many
different arrangements are possible?
3. A coin is tossed four times and the result of each toss is recorded.
How many different sequences of heads and tails are possible?
4. A fair six-sided die is tossed four times and the numbers shown are
recorded in a sequence. How many different sequences are there?
106 X TOPIC 8 COUNTING
8.3 COMBINATION
Example 8.3a
There are four combinations of four elements taken three at a time. If the
elements are denoted A, B, C and D, the four combinations are
Theorem 8.3a:
n!
The number of combination of n elements taken r at a time is
r!(n - r)!
Example 8.3c
7! 7 <6<5< 4<3<2<1
= = 35
3!(7 - 3)! 3<2<1< 4<3< 2<1
Example 8.3d
In how many ways can we select a committee of two women and three
men from a group of five distinct women and six distinct men?
TOPIC 8 COUNTING W107
Solution: The combinations of two women can be selected from five women is
C(5, 2) = 10
and the combinations of three men can be selected from six men is
C(6, 3) = 20
10 . 20 = 200
ACTIVITY 8.4
1. In how many ways can a 6-card hand be dealt from a deck of 52 cards?
2. In how many ways can a committee of three faculty members and
two students be selected from seven faculty members and eight
students?
3. How many different 8-card hands with 5 red cards and 3 black
cards can be dealt from a deck of 52 cards?
When the Pigeonhole Principle is successfully applied, the principle only tells us
that the object exists; the principle will not tell us how to find the object or how
many are there.
108 X TOPIC 8 COUNTING
Example 8.4a
Ten persons have first name Aisyah, Badrul, and Azman and last names Razak,
Farouq, and Adri. Show that at least two persons have the same first and last
names.
Solution: There are nine possible names for the 10 persons. If we think of the
persons as pigeons and the names as pigeonholes, we can consider the
assignment of names to people to be that of assigning pigeonholes to the
pigeons. By the Pigeonhole Principle, some name (pigeonhole) is assigned
to the least two persons (pigeons).
The second form of the Pigeonhole Principle can be reduced to the first form by
letting X be the set of pigeons and Y be the set of pigeonholes. We assign pigeon x
to pigeonhole f(x). By the first form of the Pigeonhole Principle, at least two
pigeons, x1 , x2 X, are assigned to the same pigeonhole; that is f(x1) = f(x2)
for some distinct x1, x2 X.
TOPIC 8 COUNTING W109
Example 8.4b
c1 + 1, c2 + 1, . c151 + 1
range in value between 1 and 301. By the second form of the Pigeonhole Principle, at
least two of these values coincide. The numbers (c1, c2, . c151) are all distinct and
hence the number (c1 + 1, c2 + 1, . c151 + 1) are also distinct. It must be that one of (c1,
c2, . c151) and one of (c1 + 1, c2 + 1, . c151 + 1) are equal. Thus we have
ci = cj + 1
ACTIVITY 8.5
1. Thirteen persons have first names Adri, Aisyah, and Firdaus and last
names Mohamed, Rashdan, Zairul, and Amir. Show that at least two
persons have the same first and last names.
2. It is possible to interconnect five processors so that exactly two
processors are directly connected to an identical number of
processors? Explain how this can be done.
3. An inventory consists of a list of 115 items, each marked „available‰
or „unavailable‰. There are 60 available items. Show that there are at
least two available items in the list exactly four items apart.
4. An inventory consists of a list of 100 items, each marked „available‰
or „unavailable‰. There are 50 available items. Show that there are at
least two unavailable items in the list either three or six items apart.
5. Eighteen persons have first names Nurul, Elyana, Badrul and
Ikhwan and last names Hafiz and Farid. Show that at least three
persons have the same first and last names.
110 X TOPIC 8 COUNTING
[1] This is an interesting site that makes you think a little bit more.
URL:
http://weasel.cnrs.humboldt.edu/~prompt/107/math107yz/semester1/Activiti
es/Discrete.html
[2] You can watch video, download notes and view some exam questions
with answers. Make sure you are on a high bandwidth connection to view the
video.
URL: http://www.aduni.org/courses/discrete/index.php?view=cw
[3] If you have extra time, read them. It is an interesting site to read about Math
and puzzles
URL: http://www.cut-the-knot.org/manifesto/MathAndPuzzles .shtml