08 Counting
08 Counting
2
The Product Rule
• Suppose that a procedure can be broken down into a
sequence of two tasks. If there are n1 way to do the first task
and for each of these ways of doing then first task there are n2
ways of doing the second task, then there are n1 n2 ways to
do the procedure.
– Example: The chairs of an auditorium are to be labeled with a letter
and a positive integer not exceeding 100. what is the largest number of
chairs can be labeled differently?
– Solution: To label a chair we can use any one from 26 letters in
alphabet and then assign one of the 100 possible integer. According to
product rule the largest number of chairs that can be labeled is
26 . 100 = 2600.
3
The Sum Rule
• If a procedure can be done either in one of n1 ways or in one of
n2 ways, where none of the set of n1 ways is same as any of the
set n2 ways, then there are n1 + n2 ways to do the task.
– Example: A student can choose a project from one of the three lists. The
three lists contain 23, 15 and 19 possible projects, respectively. No
project is on in more than one list. How many possible projects are
there to choose from?
– Solution: A student can choose any one project from any one of the
three list. As there is no common project in one of the lists, according
to sum rule a student can choose project in 23 + 15 + 19 = 57 ways.
4
The Pigeonhole Principle
• If k is a positive integer and k + 1 or more objects are placed
into k boxes, then there is at least one box containing two or
more of the objects.
– The pigeonhole principle is also known as the Dirichlet
drawer principle, or the shoebox principle.
5
Examples-- Pigeonhole Principle
• Question: How many students must be in a class to guarantee
that at least two students will get same score in the final
exam, if the exam is graded on a scale from 0 to 100?
• Answer: There are 101 possible score in the exam. According
to pigeonhole principle there must be at least 102 students to
get 2 students with same score.
6
Generalized Pigeonhole Principle
• If N objects are objects are into k boxes, then there are at
least one box containing at least objects.
• Example:
7
Permutations
A permutation of a distinct objects is an ordered arrangement of those objects
8
Example -- permutation
• Let S = {a, b, c}. The 2-permutation of S are ordered
arrangements a, b; a, c; b, a; b, c; c, a; and c, b. i. e. there are
six 2-permutation of the three elements .
• For the first element there are three ways to choose then two
ways to choose the second element of the element because it
must be different from the first element.
• P(3, 2) = 3. 2 = 6
9
Permutations
10
Example-- Permutation
• Question: How many ways are there to select a 1st prize, 2nd prize and 3rd
prize winner among 100 people participating in a contest?
• Answer: The number of ways to select three prize winner is the number of
ordered selection of three elements from a set of 100 elements, i.e. the 3-
permutation of 100 elements:
– P(100, 3) = 100! / (100 - 3)! = (100. 99. 98. 97!)/ 97! = 100. 99. 98 = 970200.
• Question: How many permutation of the letters ABCDEFGH contain the block
ABC?
• Answer: ABC occur in a block and the rest of individual letters are D, E, F, G,
and H; i. e. total six letters can occur in any order, there is
– 6! = 6. 5. 4. 3. 2. 1= 720 permutation of the letters ABCDEFGH contain the block
ABC.
11
Combinations
An r-combination of elements of a set is an unordered selection of r
elements from the set.
12
Combinations
13
Example- Combination
• Question: How many different committees of three student
can be formed from a group of four student?
• Answer: We have to select three student from four students in
any order, i.e. 3-combination of 4 elements:
– C(4, 3) = 4!/3!(4 - 3)! = (4. 3!)/ 3!. 1! = 4
• Question: A group of 30 people has been trained as astronauts
to go to the 1st mission on Mars. How many ways to select a
crew of six people to go to the mission?
• Answer: As we assume all the crew have same job, so it is 6-
combination of 30 elements, the order of the people chosen
does not matter. Thus:
– C(30,6) = 30!/6!(30-6)! = (30.29.28.27.26.25)/(6.5.4.3.2.1)= 593775
14
Thank You
• Study all the solved problem from your text
book.
• Try to solve related problems from exercise.