Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
by Kenneth H. Rosen
Chapter 4 -- Counting
Enumeration, the counting of objects with certain properties, is an important concept involved
in solving a large number of problems. For example, counting is used to determine whether
there are enough telephone numbers, IP addresses, or automobile license plate numbers to meet
demand. It is also used in studying the complexity of algorithms as well as the probability of
events.
Basic Counting Principles
The sum rule: If a first task can be done in n1 ways and a second task in n2 ways, and if only
one of these tasks can be done but not both, then there are n1 + n2 ways to do either task.
Phrased in terms of sets: If a first task is to choose an element from set S and a second task is
to choose an element from set T, and S and T are two disjoint finite sets, then the number of
ways to choose an element from either set is | S T | = | S | + | T |.
The product rule: Suppose that a procedure can be broken down into two tasks. If there are
n1 ways to do the first task and n2 ways to do the second after the first task has been done,
then there are n1n2 ways to complete the procedure. Phrased in terms of sets: If a task to
choose an element from set S is followed by a second task to choose an element from set and
T, where both S and T are finite sets, then the number of ways to choose the pair of elements
is | S T | = | S | | T |.
The inclusion-exclusion principle: Suppose there are two tasks that can be done in n1 and n2
ways, respectively, and the two tasks can be done at the same time in n3 ways. Then the
number of ways to do one of the two tasks is n1 + n2 - n3. Phrased in terms of sets: If a first
task is to choose an element from set S and a second task is to choose an element from set T,
and S and T are two finite sets that may not be disjoint, then the number of ways to choose
an element from either set is | S T | = | S | + | T | - | S T |.
4.2
The pigeonhole principle: If 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 generalized pigeonhole principle: If N objects are placed into k boxes, then there is at
least one box containing at least N/k objects.
Exercises in 4.2
4.3