Module 1 DS 2 Final
Module 1 DS 2 Final
Module 1
COUNTING
INTRODUCTION
OBJECTIVES
DIRECTIONS/MODULE
ORGANIZER
There are four lessons in the module. Read each lesson carefully then answer
the exercises/activities to find out how much you have learned from it. Work on these
exercises carefully and submit your output to your instructor.
In case you encounter difficulty, discuss this with your instructor during the
face-to-face meeting. If not, you may contact your instructor.
God bless and enjoy the rest of this module!
Module 1 4
LESSON 1
BASICS OF COUNTING
A procedure can be broken down into a sequence of two tasks. There are n 1 ways to
do the first task and n2 ways to do the second task. Then, there are n1 x n2 ways to do
the procedure.
Example 2. How many different license plates can be made if each plate contains a
sequence of three uppercase English letters followed by two digits?
Solution:
_ _ _ _ _ 263 x 102 = 1,757,600
10 choices
Example 3. A company with three employees, Mark, Luke and John, rents a floor of a
building with 12 offices. How many ways are there to assign different offices to these
three employees?
Module 1 4
Solution:
The procedure of assigning offices to these three employees consists of assigning an
office to Mark, which can be done in 12 ways, assigning an office to Luke, which can
be done in 11 ways and assigning an office to John different from the offices assigned
to Mark and Luke, which can be done in 10 ways. By the product rule, there are
12·11·10 = 1320 ways to assign offices to these three employees.
If a task can be done either in one of n1 ways or in one of n2 ways, where none of the
set of n1 ways is the same as any of the n2 ways, then there are n1+ n2 ways to do the
task.
Example 2. A boy lives at X and wants to go to School at Z. From his home X he has to
first reach Y and then Y to Z. He may go X to Y by either 3 bus routes or 2 train
routes. From there, he can either choose 4 bus routes or 5 train routes to reach Z.
How many ways are there to go from X to Z?
Module 1 4
ASSESSMENT ACTIVTY
8. From a deck of playing cards, find the number of ways in which we can
draw:
a.) an ace or a king and
b.) a card of diamond or a spade?
_________________________________________________________________
_________________________________________________________________
_________________________________________________________________
_________________________________________________________________
Module 1 7
LESSON 2
𝑛!
𝑛Pr = (𝑛 − 𝑟)!
where 𝑛! = 1.2.3. … (𝑛 − 1).
Example 1. From a set S ={x, y, z} by taking two at a time, all permutations are
− xy,yx,xz,zx,yz,zy.
Example 3. From a bunch of 6 different cards, how many ways we can permute it?
Solution: As we are taking 6 cards at a time from a deck of 6 cards, the permutation
will be 6P6 = 𝟔! = 𝟕𝟐𝟎
Example 4. In how many ways can the letters of the word 'READER' be arranged?
Solution: There are 6 letters word (2 E, 1 A, 1D and 2R.) in the word 'READER'.
The permutation will be
𝟔!
=
(𝟐!)(𝟏!)(𝟏!)(𝟐!)
= 180
Module 1 9
Example 5. In how ways can the letters of the word 'ORANGE' be arranged so that the
consonants occupy only the even positions?
Solution: There are 3 vowels and 3 consonants in the word 'ORANGE'. Number of ways
3P =3!=6.
of arranging the consonants among themselves 3 The remaining 3
vacant places will be filled up by 3 vowels in 3P3=3!=6 ways. Hence, the total
number of permutation is 6×6=36.
Module 1 10
ASSESSMENT ACTIVTY
______1. How many words can be formed by using all letters of the
word 'BIHAR'?
A. 720 B. 24 C. 120 D. 60
______2. What is the value of 100P ?
2
______6. In how many different ways can the letters of the word
'RUMOUR' be arranged?
A. None of these B. 128 C. 360 D. 180
______7. How many words with or without meaning, can be formed by
using all the letters of the word, 'DELHI' using each letter
exactly once?
A. 720 B. 24 C. None of these D. 120
______8. 18. How many 3-digit numbers can be formed from the digits 2,
3, 5, 6, 7 and 9 which are divisible by 5 and none of the digits is
repeated?
A. 20 B. 16 C. 8 D. 24
Module 1 12
LESSON 3
A combination is selection of some given elements in which order does not matter.
The number of all combinations of n things, taken r at a time is −
nC 𝒏!
r=
r!(𝒏−r)!
Example 1. Find the number of subsets of the set {1,2,3,4,5,6} having 3 elements.
Solution: The cardinality of the set is 6 and we have to choose 3 elements from the
set. Here, the ordering does not matter. Hence, the number of subsets will be
6
C3=20.
Example 2. There are 6 men and 5 women in a room. In how many ways we can
choose 3 men and 2 women from the room?
Solution: The number of ways to choose 3 men from 6 men is 6C3 and the number of
ways to choose 2 women from 5 women is 5C2
Hence, the total number of ways is − 6C3×5C2=20×10=200
Example 3. How many ways can you choose 3 distinct groups of 3 students from total
9 students?
Solution: Let us number the groups as 1, 2 and 3
For choosing 3 students for 1st group, the number of ways − 9C3
The number of ways for choosing 3 students for 2nd group after choosing 1st group −
6C
3
The number of ways for choosing 3 students for 3rd group after choosing 1st and 2nd
group − 3C3
Hence, the total number of ways =9C3×6C3×3C3=84×20×1=1680
Module 1 13
ASSESSMENT ACTIVTY
______7. In how many ways can a selection of 3 men and 2 women can be
made from a group of 5 men and 5 women?
A. 10 B. 20 C. 30 D. 100
30
______8. C2
A. 435 B. 870 C. 470 D. 835
Module 1 15
LESSON 4
Pigeonhole Principle: If N objects are placed into k boxes, then there is at least one
box containing at least ⌈N/k⌉ objects.
If n > k (# pigeons > # pigeonholes) then at least one pigeonhole contains at least two
pigeons.
In problem solving, the “pigeons” are often numbers or objects, and the
“pigeonholes” are properties that the numbers/objects might possess.
Formula:
𝑁 = 𝑘 (𝑟 − 1) + 1
N−1
𝑘=
r−1
Example 1: Given a group of 100 people, at minimum, how many people were born in
the same month?
Solution: We have 12 months, so 100/12 = 8.33 gives us the content of each month.
But we cannot have partial people in each month, so we round up:
100
=9
2
Example 2. In the movie “Cheaper by the Dozen,” there are 12 children in the family.
(a) Prove that at least two of the children were born on the same day of the week;
Module 1 16
Solution: There are 12 children (pigeons) which we are placing into 7 days of the week
(pigeonholes), so by the PHP, some day of the week has two children.
(b) Prove that at least two family members (including mother and father) are born in
the same month;
Solution: There are 14 family members (pigeons) and only 12 months they can be born
in (holes), so some two family members must be born in the same month by the PHP.
(c) Assuming there are 4 children’s bedrooms in the house, show that there are at
least 3 children sleeping in at least one of them.
Solution: If no bedroom had at least 3 children, then each one would have 2 or fewer
children, so with four bedrooms the number of children would be ≤ 4×2 = 8, but we
know there are 12 children.
Example 3. Pigeonhole Elementary School has 500 students. Show that at least two of
them were born on the same day of the year.
Solution: There are 500 students, and only 366 days they could have been born on, so
by the PHP some two students were born on the same day.
Example 5. There are 50 baskets of apples. Each basket contains no more than 24
apples. Show that there are at least 3 baskets containing the same number of apples.
Solution: The baskets are the pigeons, and we place each of them in one of 24
pigeonholes according to how many apples are in it. Thus, the ratio n/k of pigeons to
pigeonholes is 50/24 = 2.08. By Generalized PHP there are at least this many baskets
with the same number of apples, so there must be at least 3.
Module 1 17
ASSESSMENT ACTIVTY
4. Prove that from any 12 natural numbers one can choose two those
difference is divisible by 11.
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
5. Sam has (many) pairs of red, yellow and purple socks. He gets up early
and wants to get his clothes without waking up his roommate. So he does
not turn on the light and grabs some socks in a dark. How many socks
should he take out to be sure to get at least four socks all of the same
color?
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
6. 51 numbers are chosen from the integers between 1 and 100 inclusively.
Prove that 2 of the chosen integers are consecutive.
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
7. Agoo East Elementary School has 1000 students. Show that at least two
of them were born on the same day of the year.
________________________________________________________________
________________________________________________________________
________________________________________________________________
________________________________________________________________
Module 1 19
MODULE SUMMARY
In module 1, you have learned about counting. There are four lessons in module 1.
Lesson 1 is the basics of counting namely the product rule and sum rule. The
product rule states that a procedure can be broken down into a sequence of two
tasks. There are n1 ways to do the first task and n2 ways to do the second task. Then,
there are n1 x n2 ways to do the procedure. The sum rule states that if a task can be
done either in one of n1 ways or in one of n2 ways, where none of the set of n1 ways
is the same as any of the n2 ways, then there are n1+n2 ways to do the task.
Lesson 2 deals with the permutation rule which is an ordered combination of
elements.
Lesson 3 discusses the combination rule which is selection of some given
elements in which order does not matter.
Lesson 4 presents the pigeonhole principle. If k is a positive integer and k + 1
objects are placed into k boxes, then at least one box contains two or more objects.
Congratulations! You have just studied Module 1. Now you are ready to evaluate how
much you have benefited from your reading by answering the summative test. Good
Luck!!!
Module 1 20
SUMMATIVE TEST
II. Solve the following. Use the next page to answer and show your solution.
(3 pts. each item)
Permutation
1. There are 7 members in a committee. How many ways are there to
choose a chairman, deputy chairman, secretary and a cash keeper?
2. Eight students promised to send a postcard each other. How many
postcards did they send together?
Combination
1. On a circle there are 9 points selected. How many triangles with
edges in these points exist?
2. In how many ways you can choose 8 of 32 playing cards not
considering their order?
3. In how many ways can a coach choose three swimmers from among
five swimmers?
Pigeonhole Principle
Answer Sheet:
Module 1 22
REFERENCES
https://sites.google.com/view/ccselibrary/home
Panda, B.S., et. al. (2018). Algorithms and Discrete Applied Mathematics.
Springer International Publishing.
Pilato (2015). Framework of Digital Signal Processing. NY. Research Press.
Rosen, Kenneth H. (2018). Discrete Mathematics and Its Applications. Eight
Edition. New York: McGraw-Hill
Rubinfeld, Ronitt and Meyer, Albert R. (2005). Mathematics for Computer
Science. http://ocw.mit.edu/courses/electrical-engineering-and-
computer-science/6-042j-mathematics-for-computer-science-fall-
2005/index.htm
Vector illustrations used from https://www.vectorfair.com/