Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
MATH 2001 Homework Han-Bom Moon Homework 9 Solution Section 3.2, 4.1. • • • • Please read your writing again before moving to the next problem. Do not abbreviate your answer. Write everything in full sentences. Write your answer neatly. If I couldn’t understand it, you’ll get 0 point. You may discuss with your classmates. But do not copy directly. 1. Consider the recurrence relation 1 an = an−1 + 1, 2 a1 = 1. (a) Find an for 2 ≤ n ≤ 7. 1 3 1 1 a2 = a1 + 1 = · 1 + 1 = = 2 − 2 2 2 2 1 1 3 7 1 a3 = a2 + 1 = · + 1 = = 2 − 2 2 2 2 4 2 1 1 7 15 1 a4 = a3 + 1 = · + 1 = =2− 3 2 2 4 8 2 1 1 15 31 1 a5 = a4 + 1 = · +1= =2− 4 2 2 8 16 2 1 31 63 1 1 +1= =2− 5 a6 = a5 + 1 = · 2 2 16 32 2 1 1 63 127 1 a7 = a6 + 1 = · +1= =2− 6 2 2 32 64 2 (b) Guess the closed formula for an and prove it by using induction. From above computation, it is reasonable to guess that an = 2 − 1 2n−1 . 1 Let’s prove it by using induction. Let n = 1. Then a1 = 1 = 2 − 0 . So the 2 statement is true. 1 Suppose that the statement is true for n = k − 1. Then ak−1 = 2 − k−2 . 2 1 1 1 1 1 ak = ak−1 + 1 = 2 − k−2 + 1 = 1 − k−1 + 1 = 2 − k−1 2 2 2 2 2 Therefore the statement is true for n = k case too. By induction, an = 2 − for all n ∈ N. 1 1 2n−1 MATH 2001 Homework Han-Bom Moon 2. By using generating functions, find the closed formula of an in the previous problem. Let p(x) = a1 x + a2 x2 + a3 x3 + · · · be the generating function of an . 1 1 2 3 2 p(x) = a1 x + a2 x + a3 x + · · · = x + a1 + 1 x + a2 + 1 x3 + · · · 2 2 1 a1 x2 + a2 x3 + a3 x4 + · · · + x2 + x3 + x4 + · · · = x+ 2 1 = x(a1 x + a2 x2 + a3 x3 + · · · ) + x + x2 + x3 + · · · 2 xp(x) x = + 2 1−x So x x 2−x x p(x) 1 − = ⇒ p(x) · = 2 1−x 2 1−x 2x 2 4 2 2 ⇒ p(x) = = − = − (1 − x)(2 − x) 1−x 2−x 1 − x 1 − x2 x x 2 x 3 2 3 = 2(1 + x + x + x + · · · ) − 2 1 + + + + ··· 2 2 2 1 1 1 1 x+ 2− x2 + 2 − 2 x3 + 2 − 3 x4 + · · · = 2− 1 2 2 2 Therefore an = 2 − 1 . 2n−1 3. Let bn denote the number of length n binary sequences (sequences consisting of 0 and 1 only) containing no two consecutive 0s. (a) Find b1 and b2 . There are two length 1 binary sequences: 0 and 1. There are three length 2 binary sequences without no consecutive 0s: 01, 10, and 11. So b1 = 2 and b2 = 3. (b) Show that bn = bn−1 + bn−2 if n ≥ 3. Let S(n) be the set of binary sequences of length n without consecutive 0s. For any (ak ) ∈ S(n), the last term an is either 0 or 1. If an = 1, then there is no restriction on an−1 . So the number of (ak ) with an = 1 is precisely |S(n − 1)|. On the other hand, if an = 0, then an−1 must be 1. Then there is no constraint on an−2 . Therefore the number of (ak ) with an = 0 is precisely |S(n − 2)|. In summary, bn = |S(n)| = |S(n − 1)| + |S(n − 2)| = bn−1 + bn−2 . 2 MATH 2001 Homework Han-Bom Moon (c) By using generating functions, find its closed formula. Let p(x) = b1 x + b2 x2 + b3 x3 + · · · be the generating function of bn . p(x) = b1 x + b2 x2 + b3 x3 + · · · = 2x + 3x2 + (b2 + b1 )x3 + (b3 + b2 )x4 + · · · = 2x + 3x2 + x2 (b1 x + b2 x2 + b3 x3 + · · · ) + x(b2 x2 + b3 x3 + b4 x4 + · · · ) = 2x + 3x2 + x2 p(x) + x(p(x) − b1 x) = 2x + 3x2 + x2 p(x) + xp(x) − 2x2 = 2x + x2 + (x2 + x)p(x) So we have (1 − x − x2 )p(x) = 2x + x2 ⇒ p(x) = 2x + x2 . 1 − x − x2 √ √ √ 1+ 5 1− 5 Let α = and β = . Then α + β = 1, α − β = 5, αβ = −1. So 2 2 it is easy to check that 1 − x − x2 = (1 − αx)(1 − βx). So we have 2x + x2 x(x + 2) = 2 1−x−x (1 − αx)(1 − βx) 1 1 2 2 =x 1+ √ + 1− √ 5 1 − αx 5 1 − βx 2 1 + αx + (αx)2 + (αx)3 + · · · =x 1+ √ 5 2 2 3 + 1− √ 1 + βx + (βx) + (βx) + · · · 5 2 2 2 2 x+ 1+ √ α+ 1− √ β x2 = 1+ √ +1− √ 5 5 5 5 2 2 2 + 1+ √ α + 1− √ β 2 x3 + · · · . 5 5 Therefore √ !n−1 √ !n−1 1+ 5 1− 5 2 2 bn = 1 + √ + 1− √ . 2 2 5 5 p(x) = 4. Consider the recurrence relation an = 4an−1 − 4an−2 (n ≥ 3), a1 = 1, a2 = 3. By using generating functions, find its closed formula. Let p(x) = a1 x + a2 x2 + a3 x3 + · · · be the generating function of an . p(x) = a1 x + a2 x2 + a3 x3 + · · · = x + 3x2 + (4a2 − 4a1 )x3 + (4a3 − 4a2 )x4 + · · · = x + 3x2 + 4x(a2 x2 + a3 x3 + a4 x4 + · · · ) − 4x2 (a1 x + a2 x2 + a3 x3 + · · · ) = x + 3x2 + 4x2 (p(x) − a1 x) − 4xp(x) = x + 3x2 + (4x2 − 4x)p(x) − 4x2 = x − x2 + (4x2 − 4x)p(x) 3 MATH 2001 Homework Han-Bom Moon So we have (1−4x+4x2 )p(x) = x−x2 ⇒ p(x) = x − x2 x − x2 x x2 = = − . 1 − 4x + 4x2 (1 − 2x)2 (1 − 2x)2 (1 − 2x)2 Recall that 1 = 1 + 2x + (2x)2 + (2x)3 + · · · = 1 + 2x + 22 x2 + 23 x3 + · · · . 1 − 2x By taking the derivative, we obtain 2 = 2 + 22 · 2x + 23 · 3x2 + 24 · 4x3 + · · · (1 − 2x)2 and 1 = 1 + 2 · 2x + 22 · 3x2 + 23 · 4x3 + · · · . (1 − 2x)2 Therefore x x2 − (1 − 2x)2 (1 − 2x)2 = x + 2 · 2x2 + 22 · 3x3 + 23 · 4x4 + · · · − x2 + 2 · 2x3 + 22 · 3x4 + 23 · 4x5 + · · · = x + (2 · 2 − 1) x2 + 22 · 3 − 2 · 2 x3 + 23 · 4 − 22 · 3 x4 + 24 · 5 − 23 · 4 x5 + · · · . p(x) = So we obtain an = 2n−1 · n − 2n−2 · (n − 1) = 2n−2 (2n − (n − 1)) = 2n−2 (n + 1). 5. (a) How many integers from 1 through 1000 are multiplies of 5 or multiplies of 7? Let A = {n ∈ N | 5|n, 1 ≤ n ≤ 1000} and B = {n ∈ N | 7|n, 1 ≤ n ≤ 1000}. What we want to find is |A ∪ B|. |A| = b 1000 c = 200, 5 |B| = b 1000 c = 142. 7 Because A ∩ B = {n ∈ N | 35|n, 1 ≤ n ≤ 1000}, |A ∩ B| = b 1000 c = 28. 35 Therefore |A ∪ B| = |A| + |B| − |A ∩ B| = 200 + 142 − 28 = 314. (b) How many integers from 1 through 1000 are multiplies of 4 or multiplies of 6? 4 MATH 2001 Homework Han-Bom Moon Let A = {n ∈ N | 4|n, 1 ≤ n ≤ 1000} and B = {n ∈ N | 6|n, 1 ≤ n ≤ 1000}. What we want to find is |A ∪ B|. |A| = b 1000 c = 250, 4 |B| = b 1000 c = 166. 6 Because A ∩ B = {n ∈ N | 12|n, 1 ≤ n ≤ 1000}, |A ∩ B| = b 1000 c = 83. 12 Therefore |A ∪ B| = |A| + |B| − |A ∩ B| = 250 + 166 − 83 = 333. 6. A combination lock requires three selections of numbers, each from 1 through 39. Suppose that the lock is constructed in a way that no number can be used twice in a row but the same number may occur both first and third. For example, 20 13 20 would be acceptable, but 20 20 13 would not. How many different combinations are possible? Sol 1. (Using multiplicative principle) We have to select three numbers. For the first number, there is no restriction. So the number of choices is 39. The second number must be different from the first one. So the number of choices is 38. Finally, the last number has to be different from the second one. So there are 38 possibilities. Therefore, the total number of acceptable combinations is 39 × 38 × 38 = 56316. Sol 2. (Using inclusion-exclusion principle) Let U be the set of all possible combinations regardless it is acceptable or not. Then |U | = 393 = 59319. Let A be the set of combinations whose first two numbers are same, and let B be the set of combinations whose last two numbers are same. Then the set of non-acceptable combinations is precisely |A∪B|. |A| = |B| = 392 . A∩B is the set of combinations whose three numbers are all same. So |A ∩ B| = 39. Therefore |A ∪ B| = |A| + |B| − |A ∩ B| = 392 + 392 − 39 = 3003. So the number of acceptable combinations is 59319 − 3003 = 56316. 7. The game of Sets uses a special deck of cards. Each card has either one, two, or three identical shapes, all of the same color and style. There are three possible shapes: squiggles, diamond, and oval. There are three possible colors: green, purple, and red. There are three possible styles: solid, shaded, or outline. The deck consists of all possible combinations of shape, color, style, and number of shapes. How many cards are in the deck? 3 × 3 × 3 × 3 = 81. 5 MATH 2001 Homework Han-Bom Moon 8. Let n = pk11 pk22 · · · pkmm where p1 , p2 , · · · , pm are distinct prime numbers and k1 , k2 , · · · , km are positive integers. Then every positive divisor of n is of the form p`11 p`22 · · · p`mm where `1 , `2 , · · · , `m are nonnegative integers. (a) By using this idea, list all positive divisors of 108. 108 = 22 · 33 . The positive divisors are: 1 = 20 · 30 , 3 = 20 · 31 , 9 = 20 · 32 , 27 = 20 · 33 , 2 = 21 · 30 , 6 = 21 · 31 , 18 = 21 · 32 , 54 = 21 · 33 , 4 = 22 · 30 , 12 = 22 · 31 , 36 = 22 · 32 , 108 = 22 · 33 . There are 3 × 4 = 12 positive divisors. (b) Find the number of positive divisors of n = pk11 pk22 · · · pkmm and explain your answer. To make a positive divisor, we have to select the power of p1 , that of p2 , and so on. For the power of p1 , we can choose one of 0, 1, 2, · · · , k1 . So there are k1 + 1 possibilities. For the power of p2 , we can choose one of 0, 1, 2, · · · , k2 . Thus there are k2 + 1 options. By multiplicative principle, the total number of positive divisors is (k1 + 1)(k2 + 1) · · · (km + 1). 6