- •Preface
- •8. TRANSLATION
- •9. TERMINATION
- •10. FUTURE REVISIONS OF THIS LICENSE
- •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
- •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
86 |
Chapter 7 |
1.Find the characteristic equation by “raising the subscri pts” in the form xn = axn−1 + bxn−2. Cancelling this gives x2 −ax −b = 0. This equation has two roots r1 and r2.
2. |
If the roots are different, the solution will be of the form xn = A(r1)n + B(r2)n, where A, B are constants. |
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||
3. |
If the roots are identical, the solution will be of the form xn = A(r1)n + Bn(r1)n. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||||||
328 Example Let x0 = 1, x1 = −1, xn+2 + 5xn+1 + 6xn = 0. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
Solution: The characteristic equation is x2 |
|
5x |
|
6 |
x |
3 |
|
x |
2 |
|
|
|
0. Thus we test a solution of the form x |
|
A |
2 n |
B |
3 n |
Since |
||||||||||||||||||||||||||||||||
|
|
|
|
|
|
|
|
+ |
|
|
+ |
|
|
= ( + )( + ) = |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
n |
|
n |
n = |
|
(− ) + |
|
(− ) . |
|
||||||||||||||
1 = x0 = A + B, −1 = −2A −3B, we quickly find |
|
A = 2, B = −1. Thus the solution is xn = 2(−2) −(−3) . |
|
|
|
|
|
|
|||||||||||||||||||||||||||||||||||||||||||
329 Example Find a closed form for the Fibonacci recursion f0 = 0, f1 = 1, fn = fn−1 + fn−2. |
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||||||||||
Solution: The characteristic equation is f 2 − f −1 = 0, whence a solution will have the form |
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
√ |
|
|
|
n |
|
|
√ |
|
|
|
n |
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fn = A |
|
1 + 5 |
|
|
|
|
+ B |
1 − 5 |
. |
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
The initial conditions give |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 = A + B, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
√ |
|
|
|
|
|
√ |
|
|
|
|
|
|
|
|
|
|
|
|
√ |
|
|
|
|
|
|
√ |
|
|
|
|
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
1 = A |
1 + |
5 |
|
|
+ B |
1 − |
5 |
|
|
= |
1 |
|
(A + B) + |
|
5 |
(A |
− |
B) = |
|
5 |
(A |
− |
B) |
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|||||||||||||||||||||||||||
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
2 |
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||
|
|
1 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
This gives A = √ |
|
, B = −√ |
|
. We thus have the Cauchy-Binet Formula: |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||||||||||
5 |
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
= 1 |
|
|
|
1 + √ |
|
n |
1 |
|
1 −√ |
|
n |
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
f |
|
|
|
5 |
|
5 |
|
|
|
|
|
|
|
|
|
|
(7.6) |
|||||||||||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
n |
√5 |
|
2 |
|
|
|
|
|
|
− √5 |
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||
330 Example Solve the recursion x0 = 1, x1 = 4, xn = 4xn−1 −4xn−2 = 0. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||||||||||||||
Solution: The characteristic equation is x2 |
− |
4x |
|
4 |
x |
2 |
2 |
|
|
0. There is a multiple root and so we must test a solution of the form |
|
||||||||||||||||||||||||||||||||||||||||
|
n |
n |
|
|
|
|
|
|
+ |
|
|
= ( − ) = |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||
xn = A2 |
+ Bn2 . The initial conditions give |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||
1 = A,
4 = 2A + 2B.
This solves to A = 1, B = 1. The solution is thus xn = 2n + n2n .
7.4 Applications of Recursions
331 Example Find the recurrence relation for the number of n digit binary sequences with no pair of consecutive 1's.
Solution: It is quite easy to see that a1 = 2, a2 = 3. To form an, n ≥ 3, we condition on the last digit. If it is 0, the number of sequences sought is an−1. If it is 1, the penultimate digit must be 0, and the number of sequences sought is an−2. Thus
an = an−1 + an−2, a1 = 2, a2 = 3.
332 Example Let there be drawn n ovals on the plane. If an oval intersects each of the other ovals at exactly two points and no three ovals intersect at the same point, find a recurrence relation for th e number of regions into which the plane is divided.
Solution: Let this number be an. Plainly a1 = 2. After the n −1th stage, the nth oval intersects the previous ovals at 2(n −1) points, i.e. the nth oval is divided into 2(n −1) arcs. This adds 2(n −1) regions to the an−1 previously existing. Thus
an = an−1 + 2(n −1), a1 = 2.
86
Homework |
87 |
333 Example Find a recurrence relation for the number of regions into which the plane is divided by n straight lines if every pair of lines intersect, but no three lines intersect.
Solution: Let an be this number. Clearly a1 = 2. The nth line is cut by he previous n −1 lines at n −1 points, adding n new regions to the previously existing an−1. Hence
an = an−1 + n, a1 = 2.
334 Example (Derangements) An absent-minded secretary is filling n envelopes with n letters. Find a recursion for the number Dn of ways in which she never stuffs the right letter into the right envelope.
Solution: Number the envelopes 1, 2, 3, ··· , n. We condition on the last envelope. Two events might happen. Either n and r(1 ≤ r ≤ n −1) trade places or they do not.
In the first case, the two letters r and n are misplaced. Our task is just to misplace the other n −2 letters, (1, 2, ··· , r −1, r + 1, ··· , n −1) in the slots (1, 2, ··· , r −1, r + 1, ··· , n −1). This can be done in Dn−2 ways. Since r can be chosen in n −1 ways, the first case can happen in
ways.
In the second case, let us say that letter r, (1 ≤ r ≤ n −1) moves to the n-th position but n moves not to the r-th position. Since r has been misplaced, we can just ignore it. Since n is not going to the r-th position, we may relabel n as r. We now have n −1 numbers to misplace, and this can be done in Dn−1 ways.
As r can be chosen in n −1 ways, the total number of ways for the second case is (n −1)Dn−1 . Thus Dn = (n −1)Dn−2 + (n −1)Dn−1 .
335 Example There are two urns, one is full of water and the other is empty. On the first stage, half of the contains of urn I is passed into urn II. On the second stage 1/3 of the contains of urn II is passed into urn I. On stage three, 1/4 of the contains of urn I is passed into urn II. On stage four 1/5 of the contains of urn II is passed into urn I, and so on. What fraction of water remains in urn I after the 1978th stage?
Solution: Let xn, yn, n = 0, 1, 2, . . . denote the fraction of water in urns I and II respectively at stage n. Observe that xn + yn = 1 and that
x0 = 1; y0 = 0
x1 = x0 − 12 x0 = 12 ; y1 = y1 + 12 x0 = 12 x2 = x1 + 13 y1 = 23 ; y2 = y1 − 13 y1 = 13 x3 = x2 − 14 x2 = 12 ; y1 = y1 + 14 x2 = 12 x4 = x3 + 15 y3 = 35 ; y1 = y1 − 15 y3 = 25 x5 = x4 − 16 x4 = 12 ; y1 = y1 + 16 x4 = 12 x6 = x5 + 17 y5 = 47 ; y1 = y1 − 17 y5 = 37 x7 = x6 − 18 x6 = 12 ; y1 = y1 + 18 x6 = 12 x8 = x7 + 19 y7 = 59 ; y1 = y1 − 19 y7 = 49
A pattern emerges (which may be proved by induction) that at each odd stage n we have xn = yn = 12 and that at each even stage we have (if
n = 2k) x2k = |
k+1 |
, y2k = |
k |
. Since |
1978 |
= 989 we have x1978 = |
990 |
. |
2k+1 |
2k+1 |
2 |
1979 |
Homework
336 Problem Find the sum of all the integers from 1 to 1000 inclusive, which are not multiples of 3 or 5.
337 Problem The sum of a certain number of consecutive positive integers is 1000. Find these integers. (There is more than one solution. You must find them all.)
338 Problem Use the identity
n5 −(n −1)5 = 5n4 −10n3 + 10n2 −5n + 1.
87
88 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Chapter 7 |
and the sums |
|
|
|
|
|
|
n(n + 1) |
|
|
|
|
|
|
||
|
s1 = |
1 + 2 + ··· + n = |
, |
|
|
|
|
||||||||
|
|
|
|
|
|
|
|||||||||
|
2 |
|
|
|
|
||||||||||
|
|
|
|
|
|
n(n + 1)(2n + 1) |
|
||||||||
s2 = 12 + 22 + ···+ n2 = |
|
• |
|
|
|
‹ |
|
|
, |
||||||
|
|
6 |
|
|
|
2 |
|
||||||||
|
s3 = 13 + 23 + ···+ n3 = |
|
n(n + 1) |
|
|
|
|||||||||
|
|
|
, |
|
|||||||||||
|
|
2 |
|
|
|
|
|||||||||
in order to find |
s4 = 14 + 24 + ···+ n4. |
|
|
|
|
|
|
||||||||
|
|
|
|
|
|
|
|
||||||||
339 Problem Find the exact value of |
|
|
1 |
|
|
|
|
1 |
|
|
|
|
|
|
|
|
1 |
+ |
+ ···+ |
|
|
|
|
|
|
. |
|
||||
1 ·3 ·5 |
|
3 ·5 ·7 |
997 ·999 ·1001 |
|
|||||||||||
Answers
336 We compute the sum of all integers from 1 to 1000 and weed out the sum of the multiples of 3 and the sum of the multiples of 5, but put back the multiples of 15, which we have counted twice. Put
An = 1 + 2 + 3 + ··· + n,
B = 3 + 6 + 9 + ··· + 999 = 3A333,
C= 5 + 10 + 15 + ··· + 1000 = 5A200,
D= 15 + 30 + 45 + ··· + 990 = 15A66.
The desired sum is
|
|
|
|
|
|
|
A1000 −B −C + D = |
A1000 −3A333 −5A200 + 15A66 |
|
|||||
|
|
|
|
|
|
|
= 500500 −3 ·55611 −5 ·20100 + 15 ·2211 |
|
||||||
|
|
|
|
|
|
|
= |
266332. |
|
|
|
|
||
337 Let the the sum of integers be S = (l + 1) + (l + 2) + (l + n). Using Gauss' trick we obtain S = |
n(2l + n + 1) |
. As S = 1000, |
||||||||||||
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
|
2000 |
= |
( |
+ |
n |
+ ) |
4 |
3 |
|
≤ b |
c |
= 44. Moreover, n and 2l + n + 1 are divisors of 2000 and are of |
|||
|
n 2l |
|
1 . Now 2000 |
= n2 + 2ln + n > n2, whence n |
√2000 |
|
||||||||
opposite parity. Since 2000 = 2 5 , the odd factors of 2000 are 1, 5, 25, and 125. We then see that the problem has the following solutions: n = 1, l = 999,
n = 5, l = 197, n = 16, l = 54, n = 25, l = 27.
338 Using the identity for n = 1 to n:
n5 = 5s4 −10s3 + 10s2 −5s1 + n,
whence
|
n5 |
n |
|
s4 = |
|
+ 2s3 −2s2 + s1 − |
|
5 |
5 |
||
=n5 + n2(n + 1)2 − n(n + 1)(2n + 1) + n(n + 1) − n
5 |
2 |
3 |
2 |
5 |
=n5 + n4 + n3 − n .
5 2 3 30
339 Observe that |
|
1 |
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
4 |
|
|
||||
|
|
|
|
|
|
|
− |
|
|
|
= |
|
|
|
|
|
|
|
|
. |
|||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||
|
(2n |
− |
1)(2n + 1) |
(2n + 1)(2n + 3) |
(2n |
− |
1)(2n + 1)(2n + 3) |
||||||||||||||||||||
Letting n = 1 to n = 499 we deduce that |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
4 |
|
|
+ |
4 |
|
+ ···+ |
4 |
|
|
|
|
= |
|
1 |
|
− |
1 |
, |
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|||||||||||||||||
1 ·3 ·5 |
|
3 ·5 ·7 |
997 ·999 ·1001 |
|
1 ·3 |
999 ·1001 |
|
||||||||||||||||||||
whence the desired sum is |
|
|
|
|
1 |
|
|
|
1 |
|
|
|
83333 |
|
|
|
|
|
|||||||||
|
|
|
|
|
|
|
|
− |
|
|
= |
. |
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||
|
|
|
|
|
|
|
4 ·1 ·3 |
4 ·999 ·1001 |
999999 |
|
|
|
|||||||||||||||
88
