Uploaded by sajidhossainhemal

Techniques of Counting

advertisement
1
Presented by
Presented to
Farhan Osman Haider
Roll: ASH1711017M
K.M. Aslam Uddin
Lecturer
Department of Information & Communication
Engineering,
Noakhali Science & Technology University
Md. Khalilur Rahman
Roll: ASH1711018M
Shajid Hossain Hemal
Roll: ASH1711019M
2
This chapter includes the study of
•
•
•
•
•
•
•
Basic Counting Principles
Mathematical Functions
Permutations
Combinations
The Pigeonhole Principle
The Inclusion–Exclusion Principle
Tree Diagrams
3
• BASIC COUNTING PRINCIPLES
There are two basic counting principles
 Sum Rule
If there are n choices for one action, and m choices for another action and the two actions
cannot be done at the same time, then there are n + m ways to choose one of these actions.
 Product Rule
If there are n ways of doing something, and m ways of doing another thing after that, then there
are n x m ways to perform both of these actions.
4
Suppose an event E1 can occur in n1 ways, a second event E2 can occur in n2 ways, a
third event E3 can occur in n3 ways, and so on. Then:
Sum Rule: If no events can occur at the same time, then one of the events can occur in:
n1 + n2 + n3 + . . . ways.
Product Rule: If the events occur one after the other, then all the events can occur in
the order indicated in:
n1 ・ n2 ・ n3 ・ . . . ways.
BASIC COUNTING PRINCIPLES
5
 A college has 3 different history courses, 4 different literature courses, and 2 different
sociology courses.
(a) The number m of ways a student can choose one of each kind of courses is:
m = 3(4)(2) = 24
(b) The number n of ways a student can choose just one of the courses is:
n=3+4+2=9
BASIC COUNTING PRINCIPLES
6
 A new company with just two employees, Sanchez and Patel, rents a floor of a
building with 12 offices. How many ways are there to assign different offices to these
two employees?
Solution: Assigning offices to these two employees consists of assigning an office to
Sanchez, which can be done in 12 ways, then assigning an office to Patel different from
the office assigned to Sanchez, which can be done in 11 ways.
By the product rule, there are 12 · 11 = 132 ways to assign offices to these two
employees.
BASIC COUNTING PRINCIPLES
7
• MATHEMATICAL FUNCTIONS
 Factorial Function
The product of the positive integers from 1 to n inclusive is called “n factorial.” It is
denoted by n!. Namely:
n! = 1 * 2 * 3 * . . . * (n−2)(n−1)n = n(n−1)(n−2) * . . . * 3 * 2 * 1
Accordingly, 1! = 1 and n! = n(n − l)!. It is also convenient to define 0! = 1.
8
 3! = 3 ・ 2 ・ 1 = 6
 4! = 4 ・ 3 ・ 2 ・ 1 = 24
 5! = 5 ・ 4! = 5(24) = 120
 12! = 12 ・ 11 ・ 10 ・ 9! = 12 ・ 11 ・ 10 = 220
3!9!
3 ・ 2 ・ 1 ・ 9!
3・2・1
MATHEMATICAL FUNCTIONS
9
 Binomial Coefficients
Suppose r and n are positive integers with r ≤ n, is defined as follows :
𝑛
𝑟
=
n(n − 1) ・ ・ ・ (n − r + 1)
or equivalently
r(r − 1) . . . 3 ・ 2 ・ 1
𝑛
𝑟
=
n!
r!(n − r)!
Note that n − (n − r) = r. This yields the following important relation.
𝑛
𝑛−𝑟
=
𝑛
𝑟
or equivalently,
𝑛
𝑎
=
𝑛
𝑏
where a + b = n
The numbers 𝑛𝑟 are called binomial coefficients, since they appear as the coefficients in
the expansion of (𝑎 + 𝑏)𝑛 . Specifically:
n an−k bk
(𝑎 + 𝑏)n = n
k=0 r
MATHEMATICAL FUNCTIONS
10

8
2
=
8 .7
2 .1

9
4
=
9 . 8 .7 . 6
4 . 3 . 2 .1

12
9

10
7
=
= 28
= 126
12 . 11 . 10 . 9 . 8
5.4.3.2.1
=
= 792
10 . 9 . 8. 7. 6. 5. 4
7. 6. 5. 4. 3 . 2 . 1
MATHEMATICAL FUNCTIONS
= 120
11
The coefficients of the successive powers of a + b can be arranged in a triangular array of
numbers, called Pascal’s triangle. The numbers in Pascal’s triangle have the following interesting
properties:
(i) The first and last number in each row is 1.
(ii) Every other number can be obtained by adding the two numbers appearing above it. For
example:
10 = 4 + 6, 15 = 5 + 10, 20 = 10 + 10.
MATHEMATICAL FUNCTIONS
12
• PERMUTATIONS
Any arrangement of a set of n objects in a given order is called a permutation of the object (taken
all at a time). Any arrangement of any r ≤ n of these objects in a given order is called an “rpermutation” or “a permutation of the n objects taken r at a time.”
The number of permutations of n objects taken r at a time will be denoted by
P(n, r) (other texts may use nPr, Pn,r , or (n)r ).
The following theorem applies.
P(n, r) = n(n − 1)(n − 2) ・ ・ ・ (n − r + 1) = __n!__
(n − r)!
We emphasize that there are r factors in n(n − 1)(n − 2) ・ ・ ・ (n − r + 1).
13
 Permutations with Repetitions
To know the number of permutations of a multiset, that is, a set of objects some of which are
alike. Let
P(n; n1, n2, . . . , nr )
denote the number of permutations of n objects of which n1 are alike, n2 are alike, . . ., nr are
alike. The general formula follows:
𝑛!
P(n ; n1, n2, . . . , nr ) =
𝑛1! 𝑛2! ...𝑛𝑟!
PERMUTATIONS
14
 How many ways are there to select a first-prize winner, a second-prize winner, and a third-prize
winner from 100 different people who have entered a contest?
Solution: The number of ways to pick the three prize winners is the number of ordered selections of
three elements from a set of 100 elements, that is, the number of 3-permutations of a set of 100
elements. Consequently, the answer is
P(100, 3) = 100 · 99 · 98 = 970,200.
 Find the number of seven-letter words that can be formed using the letters of the word
“BENZENE.”
Solution: We seek the number of permutations of 7 objects of which 3 are alike (the three E’s), and
2 are alike (the two N’s).
m = P(7; 3, 2) = _7!_ = 7 ・ 6 ・ 5 ・ 4 ・ 3 ・ 2 ・ 1 = 420
3!2!
3・2・1・2・1
PERMUTATIONS
15
• COMBINATIONS
Let S be a set with n elements. A combination of these n elements taken r at a time is any selection of
r of the elements where order does not count. Such a selection is called an r-combination; it is simply
a subset of S with r elements. The number of such combinations will be denoted by
C(n, r) (other texts may use nCr, Cn,r ).
Before we give the general formula for C(n, r), we consider a special case.
Theorem:
𝑃(𝑛, 𝑟)
𝑛!
C(n, r) =
=
𝑟!
𝑟! 𝑛−𝑟 !
16
 A farmer buys 3 cows, 2 pigs, and 4 hens from a man who has 6 cows, 5 pigs, and 8 hens. Find
the number m of choices that the farmer has.
Solution: The farmer can choose the cows in C(6, 3) ways, the pigs in C(5, 2) ways, and the hens in
C(8, 4) ways.
Thus the number M of choices follows:
M =6・5・4 . 5・4 . 8・7・6・5
3・2・1 2・1 4・3・2・1
= 20 ・ 10 ・ 70
= 14 000
COMBINATIONS
17
• THE PIGEONHOLE PRINCIPLE
If n pigeonholes are occupied by n + 1 or more pigeons, then at least one pigeonhole is
occupied by more than one pigeon.
This principle can be applied to many problems where we want to show that a given situation can
occur.
 Suppose a department contains 13 professors, then two of the professors (pigeons) were born
in the same month (pigeonholes).
 In any group of 27 English words, there must be at least two (pigeons) that begin with the
same letter, because there are 26 letters (pigeonholes) in the English alphabet.
18
 Generalized Pigeonhole Principle
If n pigeonholes are occupied by kn + 1 or more pigeons, where k is a positive integer, then at
least one pigeonhole is occupied by k + 1 or more pigeons.
 Find the minimum number of students in a class to be sure that three of them are born in
the same month.
Solution: Here the n = 12 months are the pigeonholes, and
k + 1 = 3 so k = 2.
Hence among any kn + 1 = 25 students (pigeons), three of them are born in the same month.
THE PIGEONHOLE PRINCIPLE
19
• THE INCLUSION–EXCLUSION PRINCIPLE
Suppose A and B are finite sets. Then A ∪ B and A ∩ B are finite and
n(A ∪ B) = n(A) + n(B) − n(A ∩ B)
That is, we find the number of elements in A or B (or both) by first adding n(A) and n(B) (inclusion)
and then subtracting n(A ∩ B) (exclusion) since its elements were counted twice.
Again for any finite sets A, B, C we have
n(A ∪ B ∪ C) = n(A) + n(B) + n(C) − n(A ∩ B) − n(A ∩ C) − n(B ∩ C) + n(A ∩ B ∩ C)
That is, we “include” n(A), n(B), n(C), we “exclude” n(A ∩ B), n(A ∩ C), n(B ∩ C), and finally “include”
n(A ∩ B ∩ C).
20
 Find the number of mathematics students at a college taking at least one of the languages
French, German, and Russian, given the following data:
65 study French, 20 study French and German,
45 study German, 25 study French and Russian,
42 study Russian, 15 study German and Russian,
8 study all three languages.
Solution: We have to find n(F ∪ G ∪ R) where F, G, and R denote the sets of students studying French,
German, and Russian, respectively.
By the Inclusion–Exclusion Principle,
n(F ∪ G ∪ R) = n(F ) + n(G) + n(R) − n(F ∩ G) − n(F ∩ R) − n(G ∩ R) + n(F ∩ G ∩ R)
= 65 + 45 + 42 − 20 − 25 − 15 + 8 = 100
Namely, 100 students study at least one of the three languages.
THE INCLUSION–EXCLUSION PRINCIPLE
21
• TREE DIAGRAMS
A tree diagram is a device used to enumerate all the possible outcomes of a sequence of events
where each event can occur in a finite number of ways.
 Find the product set A × B × C, where A = {l, 2}, B = {a, b, c}, C = {x, y}.
Solution: Here the tree is constructed from
left to right, and the number of branches at
each point corresponds to the possible outcomes
of the next event.
Each endpoint of the tree is labeled by the
corresponding element of A × B × C.
As noted previously, A × B × C has
n = 2(3)(2) = 12 elements.
22
 Mark and Erik are to play a tennis tournament. The first person to win two games in a row or who
wins a total of three games wins the tournament. Find the number of ways the tournament can
occur.
Solution: Here the tree is constructed from topdown(That is, the “root” is on the top of the
tree.) Note that there are 10 endpoints, and the
endpoints correspond to the following 10 ways
the tournament can occur:
MM, MEMM, MEMEM, MEMEE, MEE, EMM,
EMEMM, EMEME, EMEE, EE
TREE DIAGRAMS
23
THANK YOU !
Download