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
Location arithmetic wikipedia , lookup
Line (geometry) wikipedia , lookup
Large numbers wikipedia , lookup
Hyperreal number wikipedia , lookup
Series (mathematics) wikipedia , lookup
Elementary mathematics wikipedia , lookup
Proofs of Fermat's little theorem wikipedia , lookup
MATH 154 Homework 5 - Solutions Due December 7, 2012 Version December 10, 2012 Assigned questions to hand in: (1) Suppose a drawer contains ten red beads, eight blue beads, and eleven green beads. Determine a generating function that encodes the answer to each of the following problems. (a) The number of ways to select k beads from the drawer. (b) The number of ways to select k beads if one must obtain an even number of red beads, and odd number of blue beads, and a prime number of green beads. (c) The number of ways to select k beads if one must obtain exactly two red beads, at least five blue beads, and at most four green beads. HHM 2.6.3 p. 166 Solution: (a) G x 1 x x2 x10 1 x x8 1 x x11 . (b) G x 1 x2 x4 x6 x8 x10 x x3 x5 x7 x2 x3 x5 x7 x11 . (c) G x x2 x5 x6 x7 x8 1 x x3 x4 . (2) Two lottery systems are proposed for a new state lottery. In the first system, players select six different numbers from 1, 2, . . . , 50. In the second system, players select six numbers from 1, 2, . . . , 45, and may select any number as many times as they want. (In the second system, each ball selected in the lottery drawing is replaced before another ball is selected.) Which systems has more possible tickets? HHM 2.6.2.8 p. 171 Solution: In the first 50¨system, each ticket is determined by a subset of 1, . . . , 50 of size 6. Thus, there are 6 many tickets. In the second system, each ticket is a choice of 6 among objects, 45 45 ¨ 50¨with repetition 61 6 tickets in this allowed. Therefore (see bottom of page 169), there are 6 system as well. (3) A binary sequence is a sequence in which each term (entry) is 0 or 1. Determine a recurrence relation for the number of binary sequences of length n that do not contain two adjacent 1s. HHM 2.6.5.6 p. 184 Solution: Let an be the number of binary sequences of length n that do not contain two adjacent 1s. First, consider the early terms in the sequence to obtain initial conditions of the recurrence equation: a1 2 because 0, 1 both don’t contain adjacent 1s. Then, a2 3 because there is a length 2 sequence 1, 1 which is excluded. In general, we can partition the set of length n sequences without adjacent 1s based on their first entry: 0, a2 , . . . , an 1, a2 , . . . , an . Then an is the sum of the sizes of these two sets. Each sequence in the first set is determined by a2 , . . . , an , a binary sequence of length n 1 with no adjacent 1s. Therefore, the size of this first set is an1 . For the second set, note that a2 0 for each sequence (otherwise the sequence would have adjacent 1s. Therefore, each element of this set is determined by the sequence a3 , . . . , an , a binary sequence with no adjacent 1s. Thus, the size of the second set is an2 . We arrive at the recurrence relation an an1 an2 a1 2, a2 3. (4) Determine the number of compositions of n with any number of parts (sequences with positive entries a1 , . . . , ak of any length k where a1 ak n) where each part (entry) is odd. Ver Part 2 # 7 p. 34 Solution: The generating function can be expressed as the sum over all lengths k of the generating function for compositions into k parts: ô 3 ô 2 k 0 x 1x 4 x ¨k ô ¢ ªk x 1 , 1 1xx2 where the last step uses the formula for a geometric series. Multiplying top and bottom by 1 x2 , we get ô 1 x2 an xn . 1 x2 x n xx ¨k k 0 k 0 1 x2 We multiply through by the denominator to get an equation about formal power series: 1 0x x2 ô an xn x n ô an x ô ô n 1 an x n an x n 0 ô j 1 a0 a1 x ô an xn n ô an xn 2 n j aj 1 x ô « n an x n 2 n £ an xn x2 n n n ô a0 a1 a0 x k 2 ak2 xk £ a0 x ô n 2 ô ô n 2 « n an1 x ô n 2 an2 xn an an1 an2 xn We can now obtain a recurrence equation for an : an an1 an2 for n 3 a0 1, a1 a0 , a2 a1 a0 1. Therefore, a0 a1 a2 1 and for n 3, we have the Fibonacci recurrence. Using HHM Section 2.6.4, the number of partitions of n into odd parts is an Fn ϕn ϕ̂n , 5 ϕ 2 1 5 1 5 , ϕ̂ . 2 2 Confirming for small n: if n 3, 1, 1, 1. In the equation, ¡ 1 3, then there are 2 compositions that use odd entries, ©3 5 ¡ © 5 3 1 2 5 2 5 2. a3 F3 5 5 (5) Solve the following recurrence equation with the initial conditions a0 2 2 an 13an1 36an2 0, a1 5: 0. Ver Part 3 # 3a p. 10 Solution: We have the characteristic equation x2 13x 36 0. The LHS factors as x 9 x 4 so the solution will be of the form c1 9 n c2 4 n for some constants c1 , c2 . To solve for these constants, we use the initial conditions: n 0 : c1 c2 Then, c1 1 and c2 1. n 1 : 9c1 4c2 0 5. Thus, an 9n 4n . We can check this answer for some small values of n: a0 1 10 a1 a2 9 4 5 3 81 16 65 13 5 36 0