Teknik Pengiraan

advertisement
Counting Technique
COUNTING TECHNIQUES
OBJECTIVES
1. Student should be able to understand all types of counting techniques.
2. Students should be able to identify the three techniques learned.
3. Students should be able to use each of the counting techniques based on different
questions and situations.
What, Which, Where, When
1. Permutation
Redundant elements
(Clear / Not Clear)
Non-redundant elements
(Clear / Not Clear)
The use of nPr
(Clear / Not Clear)
2. Combination
Non-redundant elements
(Clear / Not Clear)
The use of nCr
(Clear / Not Clear)
3. Pigeonhole
Pigeonhole Principle
(Clear / Not Clear)
Identifying n and m
(Clear / Not Clear)
Kolman, Busby and Ross
page 78 – 91
Rosen 4th Ed
page 232 – 259
Rosen 5th Ed
page 301 – 326
Jonsonbaugh
page 165 – 218
Mattson
page -
1
Counting Technique
COUNTING TECHNIQUES
Permutation
-
An order of objects.
-
Theorem 1
If there are two tasks T1 and T2 are to be done in sequence. If T1 can be done in n1
ways, and for each of these ways T2 can be done in n2 ways, the sequence T1T2 can
be done in n1n2 ways.
Ex 1:
T1
T2
2 ways
3 ways
T1T2
T2T1
2.3 ways = 6 ways
-
3.2 ways = 6 ways
Theorem 2
If there are k tasks T1, T2, T3, …, Tk are to be done in sequence. If T1 can be done in n1
ways, and for each of these ways T2 can be done in n2 ways, and for each of these
n1n2 ways, T3 can be done in n3 ways, and so on, then the sequence T1T2T3…Tk can be
done in n1n2n3…nk ways.
2
Counting Technique
-
Theorem 3
Let A be a set with n elements and 1
r
n. Then the number of sequences of length
r that can be formed from elements of A, allowing repetitions, is
n.n.n.n… = nr
Ex 2:
If A = { , , ,
that is n is multiplied r times
}, how many words that can be build with length 3, repetition
allowed?
n = 4, r = 3, then nr = 43 = 64 words
A sequence of r elements from n elements of A is always said as ‘permutation of r
elements chosen from n elements of A’, and written as nPr or P(n, r)
-
Theorem 4
If 1
r
n, then nPr is the number of permutation of n objects taken r at a time, is
n(n-1)(n-2)… (n-(r - 1))
When r = n, that is from n objects, taken r at a time from A, where r = n, it is a nPn or n
factorial, written as n!.
Ex 3:
Choose 3 alphabet from A = {a, b, c}
3P3
= 3! = 3.2.1 = 6, that are abc, acb, bac, bca, cab, cba.
So, if there are n elements, taken r at a time,
nPr
=
n.(n-1).(n-2)….. (n-(r-1)).(n-r).(n-(r+1))…..2.1
(n-r).(n-(r-1))….2.1
=
n.(n-1).(n-2)….. (n-(r-1))
=
n!
(n - r)!
Ex 4:
If A = {p, q, r, s}, find the number of permutation for 3 elements.
4P3
=
4.3.2.1
1
=
4.3.2
=
24
(ex: pqr, pqs, prq, prs, psq, psr, …….)
3
Counting Technique
Ex 5:
Choose 3 alphabets from A..Z
26P3
=
26.25.24.23 …. 3.2.1
23.22……3.2.1.
=
-
26.25.24
Theorem 5
The number of distinguishable permutations that can be formed from a collection of
n objects where the first object appears k1 times, the second object appears k2 times,
and so on, is:
n!
k1!k2!…ki!
Ex 6:
a) MISSISSIPPI
b) CANADA
Combination
-
Order does not matter.
-
Theorem 1
Let A be a set with |A| = n, and let 1
r
n. Then the number of combinations of the
elements of A, taken r at a time, written as nCr, is given by
nCr
=
n!
r! (n - r)!
Ex 7:
If A = {p, q, r, s}, find the number of combination for 3 elements.
4C3
-
=
4.3.2.1
3.2.1.1
=
4
(ex: pqr, pqs, prs, qrs)
(pqr, prq, rpq, rqp, all are the same)
Theorem 2
Suppose k selections are to be made from n items without regard to order and
repeats are allowed, assuming at least k copies of each of the n items. The number
of ways these selections can be made is (n + k -1)Ck.
Ex 8:
In how many ways can a prize winner choose three CDs from the Top Ten list if
repetition is allowed?
n = 10 and k = 3, so, (10 + 3 -1)C3
=
12C3
4
=
12.11.10.9.8….1
3.2.1.9.8….1
=
2.11.10
=
220 ways.
Counting Technique
Pigeonhole
-
Pigeonhole Principle is a principle that ensures that the data is exist, but there is no
information to identify which data or what data.
-
Theorem 1
If there are n pigeon are assigned to m pigeonhole, where m < n, then at least one
pigeonhole contains two or more pigeons.
Ex 9:
if 8 people were chosen, at least 2 people were being born in the same day
(Monday to Sunday). Show that by using pigeonhole principle.
Because there are 8 people and only 7 days per week, so Pigeonhole Principle
says that, at least two or more people were being born in the same day.
-
Note that Pigeonhole Principle provides an existence proof.
Ex 10: Show that if any five numbers from 1 to 8 are chosen, two of then will add to 9.
Two numbers that add up to 9 are placed in sets as follows:
A1 = {1, 8},
A2 = {2, 7},
A3 = {3, 6},
A4 = {4, 5}
Each of the 5 numbers chosen must belong to one of these sets. Since there are
only four sets, the pigeonhole principle tells us that two of the chosen numbers
belong to the same set. These numbers add up to 9.
-
The Extended Pigeonhole Principle
If there are m pigeonholes and more than 2m pigeons, three or more pigeons will
have to be assigned to at least one of the pigeonholes.
-
Notation
If n and m are positive integers, then n/m stands for largest integer less than equal
to the rational number n/m.
3/2 = 1,
-
9/4 = 2
6/3 = 2
Theorem 2
If n pigeons are assigned to m pigeonholes, then one of the pigeonholes must
contain at least
(n-1)/m + 1 pigeons.
5
Counting Technique
Exercise:
1. Find the number of order to choose 3 letters from the word COMPUTER
a) Without repetition
b) With repetition
2. How many choice are there if the student must answer:
a) 8 questions out of 10 questions?
b) 8 questions out of 10, but the first 3 are compulsory questions.
3. Find the number of choice to choose 3 men and 5 women from a group of 23 men and 14
women.
4. Given ABCDEF as 6 persons. How many ways are there to make sure that DEF always sits next to
each other, in that order.
5. Given ABCDEF as 6 persons. How many ways are there to make sure that DEF always sits next to
each other but not necessarily in that order.
6. Show that if there are 30 students in a class, at least the name of 2 students must start with the
same letter.
7. How many students should be in a class to ensure that at least 5 students get the same grade if
grades available are A, B C, D and E?
6
Download