






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Example 1.1. ... The answer can be obtained in another way: There are 90 two-digit num- ... The number of circular r-permutations of an n-set equals.
Typology: Slides
1 / 12
This page cannot be seen from the preview
Don't miss anything!







March 10, 2020
1 Two Counting Principles
Addition Principle. Let S 1 , S 2 ,... , Sm be disjoint subsets of a finite set S. If S = S 1 ∪ S 2 ∪ · · · ∪ Sm, then
|S| = |S 1 | + |S 2 | + · · · + |Sm|.
Multiplication Principle. Let S 1 , S 2 ,... , Sm be finite sets and S = S 1 × S 2 × · · · × Sm. Then
|S| = |S 1 | × |S 2 | × · · · × |Sm|.
Example 1.1. Determine the number of positive integers which are factors of the number 5^3 × 79 × 13 × 338.
The number 33 can be factored into 3 × 11. By the unique factorization theorem of positive integers, each factor of the given number is of the form 3 i^ × 5 j^ × 7 k^ × 11 l^ × 13 m, where 0 ≤ i ≤ 8, 0 ≤ j ≤ 3, 0 ≤ k ≤ 9, 0 ≤ l ≤ 8, and 0 ≤ m ≤ 1. Thus the number of factors is
9 × 4 × 10 × 9 × 2 = 7280.
Example 1.2. How many two-digit numbers have distinct and nonzero digits?
A two-digit number ab can be regarded as an ordered pair (a, b) where a is the tens digit and b is the units digit. The digits in the problem are required to satisfy a 6 = 0, b 6 = 0, a 6 = b.
The digit a has 9 choices, and for each fixed a the digit b has 8 choices. So the answer is 9 × 8 = 72. The answer can be obtained in another way: There are 90 two-digit num- bers, i.e., 10, 11 , 12 ,... , 99. However, the 9 numbers 10, 20 ,... , 90 should be excluded; another 9 numbers 11, 22 ,... , 99 should be also excluded. So the answer is 90 − 9 − 9 = 72.
Example 1.3. How many odd numbers between 1000 and 9999 have distinct digits?
A number a 1 a 2 a 3 a 4 between 1000 and 9999 can be viewed as an ordered tuple (a 1 , a 2 , a 3 , a 4 ). Since a 1 a 2 a 3 a 4 ≥ 1000 and a 1 a 2 a 3 a 4 is odd, then a 1 = 1 , 2 ,... , 9 and a 4 = 1, 3 , 5 , 7 , 9. Since a 1 , a 2 , a 3 , a 4 are distinct, we conclude: a 4 has 5 choices; when a 4 is fixed, a 1 has 8 (= 9 − 1) choices; when a 1 and a 4 are fixed, a 2 has 8 (= 10 − 2) choices; and when a 1 , a 2 , a 4 are fixed, a 3 has 7 (= 10 − 3) choices. Thus the answer is 8 × 8 × 7 × 5 = 2240.
Example 1.4. In how many ways to make a basket of fruit from 6 oranges, 7 apples, and 8 bananas so that the basket contains at least two apples and one banana?
Let a 1 , a 2 , a 3 be the number of oranges, apples, and bananas in the basket respectively. Then 0 ≤ a 1 ≤ 6, 2 ≤ a 2 ≤ 7, and 1 ≤ a 3 ≤ 8, i.e., a 1 has 7 choices, a 2 has 6 choices, and a 3 has 8 choices. Thus the answer is 7× 6 ×8 = 336.
General Ideas about Counting:
Example 1.6. How many distinct 5-digit numerals can be constructed out of the digits 1, 1 , 1 , 6 , 8?
The digit 6 can be located in any of the 5 positions; then 8 can be located in 4 positions. Thus the answer is 5 × 4 = 20.
2 Permutation of Sets
Definition 2.1. An r-permutation of n objects is a linearly ordered selec- tion of r objects from a set of n objects. The number of r-permutations of n objects is denoted by P (n, r).
An n-permutation of n objects is just called a permutation of n objects. The number of permutations of n objects is denoted by n!, read “n factorial.”
Theorem 2.2. The number of r-permutations of an n-set equals
P (n, r) = n(n − 1) · · · (n − r + 1) =
n! (n − r)!
Corollary 2.3. The number of permutations of an n-set is n!.
Example 2.1. Find the number of ways to put the numbers 1, 2 ,... , 8 into the squares of 6-by-6 grid so that each square contains at most one number.
There are 36 squares in the 6-by-6 grid below. We label the squares by the numbers 1, 2 , ..., 36 as follows:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
The filling pattern on the right can be viewed as an 8-permutation (35, 22 , 7 , 16 , 3 , 21 , 11 , 26) of { 1 , 2 ,... , 36 }. Thus the answer is
P (36, 8) =
Example 2.2. What is the number of ways to arrange the 26 alphabets so that no two of the vowels a, e, i, o, and u occur next to each other?
We first have the 21 consonants arranged arbitrarily and there are 21! ways to do so. For each such 21-permutation, we arrange the 5 vowels a, e, i, o, u in 22 positions between consonants; there are P (22, 5) ways of such arrangement. Thus the answer is
21! × P (22, 5) = 21! ×
Example 2.3. Find the number of 7-digit numbers in base 10 such that all digits are nonzero, distinct, and the digits 8 and 9 do not appear next to each other.
First Method. The numbers in question can be viewed as 7-permutations of { 1 , 2 ,... , 9 } with certain restrictions. Such permutations can be divided into three types: (i) permutations without 8 and 9; (ii) permutations with either 8 or 9 but not both; and (iii) permutations with both 8 and 9, but not next to each other. (i) There are P (7, 7) = 7! = 5, 040 such permutations. (ii) There are P (7, 6) 6-permutations of { 1 , 2 ,... , 7 }. Thus there are 2 × 7 × P (7, 6) = 2 × 7 × 7!1! = 70, 560 such permutations. (iii) For each 5-permutation of { 1 , 2 ,... , 7 }, there are 6 ways to insert 8 in it, and then there are 5 ways to insert 9. Thus there are 6 × 5 × P (7, 5) = 75, 600. Therefore the answer is 5 , 040 + 70, 560 + 75, 600 = 151, 200.
Second Method. Let S be the set of 7-permutations of { 1 , 2 ,... , 9 }. Let A be the subset of 7-permutations of S in the problem. Then A¯ is the set of 7-permutations of S such that either 89 or 98 appears somewhere. We may think of 89 and 98 as a single object in whole, then A¯ can be viewed as the set of 6-permutations of { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 89 } with 89 and 6-permutations of { 1 , 2 , 3 , 4 , 5 , 6 , 7 , 98 } with 98. It follows that | A¯| = 2(P (8, 6) − P (7, 6)). Thus the answer is
|A| = P (9, 7) − 2
First Method. We may have 11 people (including one of the two unhappy persons but not both) to sit first; there are 10! such seating plans. Next the second unhappy person can sit anywhere except the left side and right side of the first unhappy person; there are 9 choices for the second unhappy person. Thus the answer is 9 × 10!.
Second Method. There are 11! seating plans for the 12 people with no restric- tion. We need to exclude those seating plans that the unhappy persons a and b sit next to each other. Note that a and b can sit next to each other in two ways: ab and ba. We may view a and b as an inseparable twin; there are 2 × 10! such seating plans. Thus the answer is given by
11! − 2 × 10! = 9 × 10!.
Example 2.5. How many different patterns of necklaces with 18 beads can be made out of 25 available beads of the same size but in different colors?
Answer: P^ (25 18 ×,18) 2 = 36 25!×7!.
3 Combinations of Sets
A combination is a collection of objects (order is immaterial) from a given set. An r-combination of an n-set S is an r-subset of S. We denote by
(n r
the number of r-combinations of an n-set, read “n choose r.”
Theorem 3.1. The number of r-combinations of an n-set equals (n r
n! r!(n − r)!
P (n, r) r!
First Proof. Let S be an n-set. Let X be the set of all permutations of S, and let Y be the set of all r-subsets of S. Consider a map f : X → Y defined by
f (a 1 a 2... arar+1... an) = {a 1 , a 2 ,... , ar}, a 1 a 2... an ∈ X.
Clearly, f is surjective. Moreover, for each r-subset A = {a 1 , a 2 ,... , ar} ∈ Y , there are r! permutations of A and (n − r)! permutations of the complement A¯. Then
f −^1 (A) = {στ : σ is a permutation of A and τ is a permutation of A¯}.
Thus |f −^1 (A)| = r!(n − r)!. Therefore (n r
r!(n − r)!
n! r!(n − r)!
Second Proof. Let X be the set of all r-permutations of S, and Y the set of all r-subsets of S. Consider a map f : X → Y defined by
f (a 1 a 2... ar) = {a 1 , a 2 ,... , ar}, a 1 a 2... ar ∈ X.
Clearly, f is surjective. Moreover, there are exactly r! permutations of {a 1 , a 2 ,... , ar} sent to {a 1 , a 2 ,... , ar}. Thus (n r
r!
P (n, r) r!
Example 3.1. How many 8-letter words can be constructed from 26 letters of the alphabets if each word contains 3, 4, or 5 vowels? It is understood that there is no restriction on the number of times a letter can be used in a word.
The number of words with 3 vowels: There are
3
ways to choose 3 vowel positions in a word; each vowel position can be filled with one of the 5 vowels; the consonant position can be any of 21 consonants. Thus there are
3
words having exactly 3 vowels. The number of words with 4 vowels:
4
The number of words with 5 vowels:
5
Thus the answer is ( 8 3
Corollary 3.2. For integers n, r such that n ≥ r ≥ 0 , ( n r
n n − r
Theorem 3.3. The number of subsets of an n-set S equals (n 0
(n 1
(n 2
(n n
= 2n.
Corollary 4.3. The number of 0 - 1 words of length n with exactly r ones and n − r zeros is equal to
n! r!(n − r)!
(n r
Example 4.2. How many possibilities are there for 8 non-attacking rooks on an 8-by-8 chessboard? How about having 8 different color rooks? How about having 1 red (R) rook, 3 blue (B) rooks , and 4 yellow (Y) rooks.
We label each square by an ordered pair (i, j) of coordinates, (1, 1) ≤ (i, j) ≤ (8, 8). Then the rooks must occupy 8 squares with coordinates
(1, a 1 ), (2, a 2 ),... , (8, a 8 ),
where a 1 , a 2 ,... , a 8 must be distinct, i.e., a 1 a 2... a 8 is a permutation of { 1 , 2 ,... , 8 }. Thus the answer is 8!. When the 8 rooks have different colors, the answer is 8!8! = (8!)^2. If there are 1 red rook, 2 blue rooks, and 3 yellow rooks, then we have a multiset M = {R, 3 B, 4 Y } of rooks. The number of permutations of M equals 8! 1!3!4!, and the answer in question is 8!^ ×^
8! 1!3!4!.
Theorem 4.4. Given n rooks of k colors with n 1 rooks of the first color, n 2 rooks of the second color, ..., and nk rooks of the kth color. The number of ways to arrange these rooks on an n-by-n board so that no one can attack another equals
n! ×
n! n 1 !n 2! · · · nk!
(n!)^2 n 1 !n 2! · · · nk!
Example 4.3. Find the number of 8-permutations of the multiset
M = {a, a, a, b, b, c, c, c, c} = { 3 a, 2 b, 4 c}. The number of 8-permutations of { 2 a, 2 b, 4 c}: (^) 2!2!4!8!. The the number of 8-permutations of { 3 a, b, 4 c}: (^) 3!1!4!8!. The number of 8-permutations of { 3 a, 2 b, 3 c}: (^) 3!2!3!8!. Thus the answer is 8! 2!2!4!
5 Combinations of Multisets
Let M be a multiset. An r-combination of M is an unordered collection of r objects from M. Thus an r-combination of M is itself an r-submultiset of M. For a multiset M = {∞a 1 , ∞a 2 ,... , ∞an}, an r-combination of M is also called an r-combination with repetition allowed of the n-set S = {a 1 , a 2 ,... , an}. The number of r-combinations with repetition allowed of an n-set is denoted by (^) 〈 n r
Theorem 5.1. Let M = {∞a 1 , ∞a 2 ,... , ∞an} be a multiset of n types. Then the number of r-combinations of M is given by 〈 n r
n + r − 1 r
n + r − 1 n − 1
Proof. When r objects are taken from the multiset M , we put them into the following boxes
1st 2nd · · · · · · · · · nth
so that the ith type objects are contained in the ith box, 1 ≤ i ≤ n. Since the objects of the same type are indistinguishable, we may use the symbol “O” to denote an object in the boxes, and the objects in different boxes are separated by a stick “|”. Convert the symbol “O” to zero 0 and the stick “|” to one 1, any such placement is converted into a 0-1 sequence of length r + n − 1 with exactly r zeros and n − 1 ones. For example, for n = 4 and r = 7,
{a, a, b, c, c, c, d} ←→
{b, b, b, b, d, d, d} ←→
Now the problem becomes counting the number of 0-1 words of length r+(n−1) with exactly r zeros and n − 1 ones. Thus the answer is 〈 n r
n + r − 1 r
n + r − 1 n − 1