Pertemuan 8
Pertemuan 8
Pertemuan 8
Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill Education.
Chapter Summary
The Basics of Counting
The Pigeonhole Principle
Permutations and Combinations
Binomial Coefficients and Identities
Generalized Permutations and Combinations
Generating Permutations and Combinations (not yet
included in overheads)
Section 6.1
Section Summary
The Product Rule
The Sum Rule
The Subtraction Rule
The Division Rule
Examples, Examples, and Examples
Tree Diagrams
Basic Counting Principles: The Product
Rule
The Product Rule: 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∙n2 ways to do the procedure.
By the product rule, there are 2|S| such bit strings, and
therefore 2|S| subsets.
Product Rule in Terms of Sets
If A1, A2, … , Am are finite sets, then the number of
elements in the Cartesian product of these sets is the
product of the number of elements of each set.
The task of choosing an element in the Cartesian
product A1 ⨉ A2 ⨉ ∙∙∙ ⨉ Am is done by choosing an
element in A1, an element in A2 , …, and an element
in Am.
By the product rule, it follows that:
|A1 ⨉ A2 ⨉ ∙∙∙ ⨉ Am |= |A1| ∙ |A2| ∙ ∙∙∙ ∙ |Am|.
Basic Counting Principles: The Sum Rule
The Sum Rule: If a task can be done either in one of n1
ways or in one of n2, 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: The mathematics department must choose
either a student or a faculty member as a representative for
a university committee. How many choices are there for
this representative if there are 37 members of the
mathematics faculty and 83 mathematics majors and no
one is both a faculty member and a student.
Solution: By the sum rule it follows that there are
37 + 83 = 120 possible ways to pick a representative.
The Sum Rule in terms of sets.
The sum rule can be phrased in terms of sets.
|A ∪ B|= |A| + |B| as long as A and B are disjoint
sets.
Or more generally,
Solution: Let P be the total number of passwords, and let P6, P7, and P8 be the
passwords of length 6, 7, and 8.
By the sum rule P = P6 + P7 +P8.
To find each of P6, P7, and P8 , we find the number of passwords of the specified length
composed of letters and digits and subtract the number composed only of letters. We find
that:
Example: How many ways are there to seat four people around a circular table, where two
seatings are considered the same when each person has the same left and right
neighbor?
Solution: Number the seats around the table from 1 to 4 proceeding clockwise. There are
four ways to select the person for seat 1, 3 for seat 2, 2, for seat 3, and one way for seat 4.
Thus there are 4! = 24 ways to order the four people. But since two seatings are the same
when each person has the same left and right neighbor, for every choice for seat 1, we get
the same seating.
Therefore, by the division rule, there are 24/4 = 6 different seating arrangements.
Tree Diagrams
Tree Diagrams: We can solve many counting problems through the
use of tree diagrams, where a branch represents a possible choice and
the leaves represent possible outcomes.
Example: Suppose that “I Love Discrete Math” T-shirts come in five
different sizes: S,M,L,XL, and XXL. Each size comes in four colors
(white, red, green, and black), except XL, which comes only in red,
green, and black, and XXL, which comes only in green and black. What
is the minimum number of shirts that the campus book store needs to
stock to have one of each size and color available?
Solution: Draw the tree diagram.
Solution:
P(100,3) = 100 ∙ 99 ∙ 98 = 970,200
Solving Counting Problems by
Counting Permutations (continued)
Example: Suppose that a saleswoman has to visit eight
different cities. She must begin her trip in a specified
city, but she can visit the other seven cities in any order
she wishes. How many possible orders can the
saleswoman use when visiting these cities?
6! = 6 ∙ 5 ∙ 4 ∙ 3 ∙ 2 ∙ 1 = 720
Combinations
Definition: An r-combination of elements of a set is an
unordered selection of r elements from the set. Thus, an
r-combination is simply a subset of the set with r elements.
The number of r-combinations of a set with n distinct
elements is denoted by C(n, r). The notation is also
used and is called a binomial coefficient. (We will see the
notation again in the binomial theorem in Section 6.4.)
Example: Let S be the set {a, b, c, d}. Then {a, c, d} is a 3-
combination from S. It is the same as {d, c, a} since the
order listed does not matter.
C(4,2) = 6 because the 2-combinations of {a, b, c, d} are the
six subsets {a, b}, {a, c}, {a, d}, {b, c}, {b, d}, and {c, d}.
Combinations
Theorem 2: The number of r-combinations of a set
with n elements, where n ≥ r ≥ 0, equals
and