— Page references correspond to locations of Extra Examples icons in the textbook.
#1. There are three available flights from Indianapolis to St. Louis and, regardless of which of these flights
is taken, there are five available flights from St. Louis to Dallas. In how many ways can a person fly from
Indianapolis to St. Louis to Dallas?
Solution:
There are three ways to make the first part of the trip and five ways to continue on with the second part
of the trip, regardless of which flight was taken for the first leg of the trip. Therefore, by the product rule
there are 3 · 5 = 15 ways to make the entire trip.
#2. A certain type of push-button door lock requires you to enter a code before the lock will open. The
lock has five buttons, numbered 1, 2, 3, 4, 5.
(a) If you must choose an entry code that consists of a sequence of four digits, with repeated numbers
allowed, how many entry codes are possible?
(b) If you must choose an entry code that consists of a sequence of four digits, with no repeated digits
allowed, how many entry codes are possible?
Solution:
(a) We need to fill in the four blanks in
, where each blank can be filled in with any of the five
digits 1, 2, 3, 4, 5. By the generalized product rule this can b e done in 5
4
= 625 ways.
(b) We need to fill in the four blanks in
, but each blank must be filled in with a distinct integer
from 1 to 5. By the generalized product rule that can be done in 5 · 4 · 3 · 2 = 120 ways.
#3. Count the number of print statements in this algorithm:
for i := 1 to n
begin
for j := 1 to n
prin t “hello”
for k := 1 to n
prin t “hello”
end
Solution:
1
Rosen, Discrete Mathematics and Its Applications, 7th edition, Global Edition
Extra Examples
Section 6.1—The Basics of Counting
p.376, icon before Example 1
p.376, icon before Example 1
p.376, icon before Example 1