Counting Principles
Counting Principles
Counting Principles
Counting
For instance, assume that a license plate contains two letters fol-
lowed by three digits. How many different license plates can be printed?
Answer : each letter can be printed in 26 ways, and each digit can be
printed in 10 ways, so 26 26 10 10 10 = 676000 different plates can
be printed.
69
5.1. BASIC PRINCIPLES 70
5.2. Combinatorics
P (n, n) = n! .
By convention 0! = 1.
For instance, there are 3! = 6 permutations of the 3 letters a, b, c.
The number of permutations of size 2 of the 4 letters a, b, c, d is P (4, 2) =
4 3 = 12.
Exercise: Given a set A with m elements and a set B with n ele-
ments, find the number of one-to-one functions from A to B.
One way to derive the formula for C(n, r) is the following. Let A
be a set with n objects. In order to generate all possible permutations
of size r of the elements of A we 1) take all possible subsets of size
r in the set A, and 2) permute the k elements in each subset in all
possible ways. Task 1) can be performed in C(n, r) ways, and task
2) can be performed in P (r, r) ways. By the product rule we have
P (n, r) = C(n, r) P (r, r), hence
P (n, r) n!
C(n, r) = = .
P (r, r) r! (n r)!