- •Preface
- •GNU Free Documentation License
- •1. APPLICABILITY AND DEFINITIONS
- •2. VERBATIM COPYING
- •3. COPYING IN QUANTITY
- •4. MODIFICATIONS
- •5. COMBINING DOCUMENTS
- •6. COLLECTIONS OF DOCUMENTS
- •7. AGGREGATION WITH INDEPENDENT WORKS
- •8. TRANSLATION
- •9. TERMINATION
- •10. FUTURE REVISIONS OF THIS LICENSE
- •Pseudocode
- •Operators
- •Algorithms
- •Arrays
- •The for loop
- •The while loop
- •Homework
- •Answers
- •Proof Methods
- •Proofs: Direct Proofs
- •Proofs: Mathematical Induction
- •Proofs: Reductio ad Absurdum
- •Proofs: Pigeonhole Principle
- •Homework
- •Answers
- •Logic, Sets, and Boolean Algebra
- •Logic
- •Sets
- •Boolean Algebras and Boolean Operations
- •Sum of Products and Products of Sums
- •Logic Puzzles
- •Homework
- •Answers
- •Relations and Functions
- •Partitions and Equivalence Relations
- •Functions
- •Number Theory
- •Division Algorithm
- •Greatest Common Divisor
- •Non-decimal Scales
- •Congruences
- •Divisibility Criteria
- •Homework
- •Answers
- •Enumeration
- •The Multiplication and Sum Rules
- •Combinatorial Methods
- •Permutations without Repetitions
- •Permutations with Repetitions
- •Combinations without Repetitions
- •Combinations with Repetitions
- •Inclusion-Exclusion
- •Homework
- •Answers
- •Sums and Recursions
- •Famous Sums
- •First Order Recursions
- •Second Order Recursions
- •Applications of Recursions
- •Homework
- •Answers
- •Graph Theory
- •Simple Graphs
- •Graphic Sequences
- •Connectivity
- •Traversability
- •Planarity
- •Homework
- •Answers
Chapter 6
Enumeration
6.1 The Multiplication and Sum Rules
We begin our study of combinatorial methods with the following two fundamental principles.
239 Definition (Cardinality of a Set) If S is a set, then its cardinality is the number of elements it has. We denote the cardinality of S by card (S).
240 Rule (Sum Rule: Disjunctive Form) Let E1, E2, . . . , Ek , be pairwise finite disjoint sets. Then
card (E1 E2 ··· Ek ) = card (E1) + card (E2) + ···+ card (Ek ) .
241 Rule (Product Rule) Let E1, E2, . . . , Ek, be finite sets. Then
card (E1 ×E2 ×···×Ek ) = card (E1) ·card (E2) ···card (Ek) .
242 Example How many ordered pairs of integers (x, y) are there such that 0 < |xy| ≤ 5?
Solution: Put Ek = {(x, y) Z2 : |xy| = k} for k = 1, . . . , 5. Then the desired number is card (E1) + card (E2) + ···+ card (E5) .
Then
E1 = {(−1, −1), (−1, 1), (1, −1), (1, 1)}
E2 = {(−2, −1), (−2, 1), (−1, −2), (−1, 2), (1, −2), (1, 2), (2, −1), (2, 1)}
E3 = {(−3, −1), (−3, 1), (−1, −3), (−1, 3), (1, −3), (1, 3), (3, −1), (3, 1)}
E4 = {(−4, −1), (−4, 1), (−2, −2), (−2, 2), (−1, −4), (−1, 4), (1, −4), (1, 4), (2, −2), (2, 2), (4, −1), (4, 1)}
E5 = {(−5, −1), (−5, 1), (−1, −5), (−1, 5), (1, −5), (1, 5), (5, −1), (5, 1)}
The desired number is therefore 4 + 8 + 8 + 12 + 8 = 40.
243 Example The positive divisors of 400 are written in increasing order
1, 2, 4, 5, 8, . . . , 200, 400.
How many integers are there in this sequence. How many of the divisors of 400 are perfect squares?
Solution: Since 400 = 24 ·52, any positive divisor of 400 has the form 2a5b where 0 ≤ a ≤ 4 and 0 ≤ b ≤ 2. Thus there are 5 choices for a and 3 choices for b for a total of 5 ·3 = 15 positive divisors.
57
58 Chapter 6
To be a perfect square, a positive divisor of 400 must be of the form 2α 5β with α {0, 2, 4} and β {0, 2}. Thus there are 3 · 2 = 6 divisors of 400 which are also perfect squares.
By arguing as in example 243, we obtain the following theorem.
244 Theorem Let the positive integer n have the prime factorisation
n = pa11 pa22 ··· pakk ,
where the pi are different primes, and the ai are integers ≥ 1. If d(n) denotes the number of positive divisors of n, then d(n) = (a1 + 1)(a2 + 1) ···(ak + 1).
245 Example (AHSME 1977) How many paths consisting of a sequence of horizontal and/or vertical line segments, each segment connecting a pair of adjacent letters in figure 6.1 spell CONT EST ?
|
C |
|
|
C |
C |
O |
C |
C |
O |
C O |
N |
O C |
C O |
N |
C O N T N O C |
C O N T |
|||
C O N T E T N O C |
C O N T E |
|||
C O N T E S E T N O C |
C O N T E S |
|||
C O N T E S T S T E N O C |
C O N T E S T |
|||
Figure 6.1: Problem 245. |
|
Figure 6.2: Problem 245. |
|
|
Solution: Split the diagram, as in figure 6.2. Since every required path must use the bottom right T , we count paths starting from this T and reaching up to a C. Since there are six more rows that we can travel to, and since at each stage we can go either up or left, we have 26 = 64 paths. The other half of the figure will provide 64 more path s. Since the middle column is shared by both halves, we have a total of 64 + 64 −1 = 127 paths.
246 Example The integers from 1 to 1000 are written in succession. Find the sum of all the digits.
Solution: When writing the integers from 000 to 999 (with three digits), 3 × 1000 = 3000 digits are used. Each of the 10 digits is used an equal number of times, so each digit is used 300 times. The the sum of the digits in the interval 000 to 999 is thus
(0 + 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9)(300) = 13500.
Therefore, the sum of the digits when writing the integers from 1 to 1000 is 13500 + 1 = 13501.
Aliter: Pair up the integers from 0 to 999 as
(0, 999), (1, 998), (2, 997), (3, 996), . . . , (499, 500).
Each pair has sum of digits 27 and there are 500 such pairs. Adding 1 for the sum of digits of 1000, the required total is
27 ·500 + 1 = 13501.
58
