Some Review Problems for Exam 3: Solutions

Math 3355 Fall 2016 Some Review Problems for Exam 3: Solutions I thought I’d start by reviewing some counting formulas. Counting the Complement: Giv...
Author: Guest
1 downloads 0 Views 144KB Size
Math 3355 Fall 2016

Some Review Problems for Exam 3: Solutions

I thought I’d start by reviewing some counting formulas. Counting the Complement: Given a set U (the “universe” for the problem), if you want to know how many things in U have some property, an indirect approach is to count how many things don’t have that property instead. The formula: The number of things that do = |U | − the number that don’t. ¯ Said differently, if A is a subset of U, and A¯ is the complement of A in U, then |A| = |U |−|A|. Inclusion-Exclusion: |A ∪ B| = |A| + |B| − |A ∩ B|. The binomial coefficient

n k



counts:

k-element subsets of a set of size n, bit strings of length n having exactly k ones, committees of size k from a group of n people. n! counts the number of ways to Permutations: P (n, k) = n(n − 1) · · · (n − k + 1) = (n−k)! arrange k things from n types of things, if repetition is not allowed. If repetition IS allowed, the formula is easier, in this case, there are nk possible arrangements.

The other important idea is a combinatorial proof of an identity. We establish the identity by counting something in two different ways. Typically, one side of the identity is simpler than the other. The simpler side usually has a direct count. The trickier side often involves breaking up the count into cases.

Here are the review question solutions: 1. The English alphabet contains 21 consonants and five vowels. How many strings of four lowercase letters of the English alphabet contain: (a) A vowel in position 2? Solution: This is a product rule: 26 · 5 · 26 · 26 = 5 · 263 = 87880. On an exam, 26 · 5 · 26 · 26 or better, 5 · 263 are fine. In fact, I would say that 5 · 263 is a better answer than 87880 because it is easier to grade and shows some of the ideas going into getting the count. (b) Vowels in positions 2 and 3? Solution: Same idea as in (a): 26 · 5 · 5 · 26 = 52 · 262 , or 16900.

(c) A vowel in position 2 or in position 3? Solution: This is harder. One way is to count the complement: Subtract off the number of strings that don’t have a vowel in either position from the total: ¯ = 264 − 26 · 21 · 21 · 26 = 158860. |U | − |A| An alternative is to use inclusion-exclusion: |A ∪ B| = |A| + |B| − |A ∩ B|. In (a) we said 5 · 263 strings have a vowel in position 2, and the same number have a vowel in position 3. In (b), we said 52 · 262 have vowels in both positions. The total is 5 · 263 + 5 · 263 − 52 · 262 = 158860, as before. (d) At least one consonant? ¯ = 264 −54 = 456351. Solution: This is a classic complement problem: |U |−|A| (e) Exactly one vowel? Solution: I would count this by the following multistep approach: Figure out where you want the vowel to be, decide which vowel to put there, and then fill the remaining 3 positions with consonants. This leads to the answer 4·5·21·21·21 = 20 · 213 = 185220. (f) No vowels in consecutive positions? (‘have’ is OK, ‘beat’ is not) Solution: This is hard. One approach is to use cases: How many vowels are there in the string? The possibilities are no vowels, one, or two vowels. No vowels gives 214 , one vowel gives 4 · 5 · 213 (the answer to part (e).) With two vowels, we have to figure out how many ways to place them. The possibilities are vcvc, vccv, cvcv, for a total of three ways. Next, we pick two vowels and two consonants. The count for this case is 3 · 52 · 212 . All totaled, we have 214 + 4 · 5 · 213 + 3 · 52 · 212 = 412776.

2. Suppose Minnesota Pick 3 became Minnesota Pick 4 instead (you select four numbers, with order counting, each number between 0 and 9, inclusive). (a) How many combinations are possible? Solution: 104 = 10, 000

Page 2

(b) How many combinations don’t contain a 5? Solution: 94 = 6561 (c) How many combinations contain a 5? Solution: Complement problem: (answer to (a) - answer to (b)) = 10, 000 − 6561 = 3439.

(d) How many combinations contain exactly two 5’s?  Solution: There are 42 = 6 ways to place the fives, and 9 · 9 ways to fill the other position, so the total is 6 · 81 = 486. (e) How many combinations contain at least two 5’s? Solution: Another complement problem, but care must be used. The complement has two cases: no fives or one five. If no fives, we get 6561, as in (b). If one five, we have 4 · 93 = 2916 ways. Our answer is 10,000 - 6561 - 2916 = 523 combinations. An alternative is to add up cases with two, three, or four fives. There are 486 ways with two fives, 43 · 9 ways with three fives, and one way with four fives, for a total of 486 + 36 + 1 = 523.

3. How many bit strings of length 6 are there containing: (a) Exactly two 1’s? Solution:

6 2



=

6·5 2

= 15.

(b) At least two 1’s? Solution: Count the complement: 26 −

Page 3

6 1





6 0



= 64 − 6 − 1 = 57.

(c) Exactly two 1’s, with the 1’s in nonconsecutive positions? Solution: Fastest might be to just list all the possibilities: 101000, 100100, 100010, 100001 010100, 010010, 010001, 001010, 001001, 000101, for a total of 10. An alternative is to count the complement: Of the 15 strings with two ones, 110000, 011000, 001100, 000110, 000011 have the ones in consecutive positions, giving a total of 15 - 5 = 10. (d) At least two 1’s with no 1’s in consecutive positions? Solution: Again, it might be fastest to just count the possibilities. We have done the case with exactly two ones. If we have three ones, there are four more cases: 101010, 101001, 100101, 010101, and you can’t do it with more than three ones, so we have a total of 10 + 4 = 14 cases.

4. (a) Find the coefficient of x17 in (2x − 3)40 . 40

40   X 40

(2x)40−k (−3)k . We k k=0 17 want the stuff that multiplies x . This means we want 40 − k = 17, or k = 23.  17  40 17 23 23 The answer we seek is 40 2 (−3) , or − 2 3 . 23 23

Solution: By the Binomial Theorem, (2x − 3)

=

50   X 50 50−k k (b) Evaluate 2 5 . k k=0

Solution: By a direct application of the Binomial Theorem, this will be (2 + 5)50 = 750 . 50   X 50 (c) Evaluate . k k=0

Solution: This is also a Binomial Theorem question, with x = 1, y = 1, giving (1 + 1)50 = 250 .

Page 4

        50    X 50 50 50 50 50 (d) Evaluate k =0 +1 +2 + · · · + 50 . k 0 1 2 50 k=0 Solution: One way, as mentioned in class, is that n(1 + x)

n−1

n   n   d d X n k X n n = (1 + x) = x = k xk−1 . dx dx k=0 k k k=0

50   X 50 Setting x = 1 and n = 50 gives k = 50(1 + 1)49 = 50 · 249 . k k=0

This is  couldalso be  done without calculus. A binomial  coefficient  identity  n n−1 50 49 k =n . In the given problem, this says k = 50 . If we k k−1 k k−1 do things without summation notation (so the pattern might be more obvious) this goes as follows:         50 50 50 50 0 +1 +2 + · · · + 50 0 1 2 50       50 50 50 =1 +2 + · · · + 50 1 2 50       49 49 49 = 50 + 50 + · · · + 50 0 1 49       49 49 49 = 50 + + ··· + 0 1 49 49 = 50 · 2 .

5. Consider the word SIZIGIES. (a) How many arrangements are there of the word? Solution: There are 8 letters: an E, a G, three I’s, two S’s and a Z. The number 8! 8! of arrangements is = , or 3360. 1!1!3!2!1! 3!2! (b) How many arrangements have the three I’s together? Solution: There are 6 ways to place the I’s (the first I can be in any of positions 1 through 6). This leaves 5 additional positions. We still have to pay attention 5! 6! to identical letters (the two S’s) so the total is 6 · = = 360. 1!1!2!1! 2

Page 5

(c) How many don’t have the three I’s together? Solution: We count the complement, the answer being the difference of the previous two answers: 3360 - 360 = 3000. (d) How many don’t have any I’s together? Solution: Another hard problem. One could enumerate the possible positions of the I’s: In positions 1, 3, 5 or 1, 3, 6 or . . . . I get 20 possible ways to place the I’s. One way to be systematic: First place an i in position 1. If the second i is in position 3, there are 4 places for the next i. If the second i is in position 4, there are 3 ways and so on, leading to 4 + 3 + 2 + 1 = 10 ways to have an i in position 1. You might now be able to guess there are 3 + 2 + 1 = 6 ways for the first i to be in position 2, 2 + 1 = 3 ways for the first i to be in position 3, and 1 way if it is in position 4 for a total of 10 + 6 + 3 + 1 = 20 ways. We still 5! = 60 have to arrange the other letters. As in part b, this happens in 1!1!2!1! ways. The total is 20 · 60 = 1200.

6. This problem deals with solutions to x + y + z = 50 in integers. Since I did not get this far in class, this material will NOT be on the exam. 7. The US Senate has 100 members, two from each of the 50 states. (a) How many committees can be formed from the 100 senators? Solution: This question asks how many subsets a 100-element set can have. The answer: 2100 . (b) How many committees are there with exactly one senator from each state? Solution: For each state, pick a senator. The answer: 250 . (c) How many committees of size 5 are there?   100 Solution: We need five people from the 100 senators, so . 5

Page 6

(d) How many committees of size 5 are there if you are not allowed two senators from the same state? Solution: Select   which of the five states to use, and then pick a senator from 50 5 each state: 2. 5 (e) How many committees of size 5 are there if you are not allowed two senators from the same state, but one of the senators must be from Minnesota? Solution: Pick a Minnesota senator, then pick four of the remaining   states,  49 4 49 5 and last, a senator from each of those states. The count is 2 2 = 2. 4 4

8. Give a combinatorial proof for each of the following. (a) n3 = (n − 1)3 + 3(n − 1)2 + 3(n − 1) + 1 Hint: Count strings xyz where each of x, y, z is an integer between 1 and n. For the right hand side, break into cases based on how many 1’s there are in the string. Solution: We count in two ways, as suggested by the hint. The direct approach is that each of x, y, z has n choices for a total of n3 possibilities. For the more complicated count, we consider how many 1’s there are in the string, with four cases: no ones, one 1, two 1’s, three 1’s or four 1’s. With no ones, there are n − 1 choices for each of x, y, x leading to a count of (n − 1)3 . If there is one 1, pick one of x, y, z to be 1, and the others have n − 1 choices for a total of 3(n − 1)2 . If we have two 1’s, select which two (three ways), and the third variable has n − 1 choices, giving 3(n − 1), and there is only one string, 1 1 1, with three 1’s. The total from this method is (n−1)3 +3(n−1)2 +3(n−1)+1. Since both methods are legitimate approaches, they must give the same answer, so n3 = (n − 1)3 + 3(n − 1)2 + 3(n − 1) + 1.       3n n 2n 2 (b) = + 2n + Hint: Pick two numbers between 1 and 3n. For the 2 2 2 right hand side, use cases based on how many of the numbers are divisible by 3. If you like committee models, you could count how many committees of size 2 could be formed from n men and 2n women. Solution:   If we follow the first hint (numbers between 1 and 3n) then there 3n are ways to pick two numbers (this was the easy count.) The more 2

Page 7

complicated approach is based on how many of the numbers are divisible by 3, there being three cases: Both are divisible by three, one of them is, or none of them is divisible by 3. Now exactly n integers between 1 and 3n are divisible by 3, meaning that 2n  of  them are not. For the first case, we select two of n the n multiples of 3 in ways. If only one of the numbers is divisible by 2 3, pick that number (n ways) and then pick a second that is not divisible by 3 (2n ways). All totaled, this gives (n)(2n) = 2n2 combinations. Finally, if   2n we want two of the 2n numbers not divisible by 3, we can pick them in     2 n 2n ways. All totaled, this method gives a count of + 2n2 + . Since 2 2 both count  these  methods   the  same thing, they must give the same answer, so 3n n 2n = + 2n2 + . 2 2 2 9. Which nonnegative integers can be written as sums of 5’s and 6’s? Prove your answer is correct, both with regular induction and by strong induction. Solution: We start with a list of possible numbers: 5, 6, 10, 11, 12, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, . . . . The first 9 numbers on the list are “incidental” or “accidents of mathematics.” What is to be proved is that all integers from 20 on can be written as sums of 5’s and 6’s. First, the strong induction proof. To be careful, we again verify the base cases. In this problem, there are five of them (getting 5 in a row). They are: 20 = 4 · 5 + 0 · 6, 21 = 3 · 5 + 1 · 6, 22 = 2 · 5 + 2 · 6, 23 = 1 · 5 + 3 · 6, and 24 = 0 · 5 + 4 · 6. Let P (n) be the statement that n is the sum of 5’s and 6’s. Having verified the base case, the inductive hypothesis is that P (k) is true for all k with 20 ≤ k ≤ n, where n is some integer with n ≥ 24. The goal is to prove that P (n + 1) is also true. That is, we have to show that n + 1 is the sum of 5’s and 6’s. Intuitively, the reason things work is that once we have five things in a row, we should be able to just at 5’s to previous things. Since this is a class related to proving things, we should be more rigorous. What should we add 5 to in order to get n + 1? The answer is n − 4. So here is the proof that n + 1 is the sum of 5’s and 6’s: Since n ≥ 24, n − 4 ≥ 20. By our inductive hypothesis, anything between 20 and n can be written as the sum of 5’s and 6’s, so there are integers j and k for which n − 4 = 5j + 6k. Adding 5 to this, n + 1 = 5(j + 1) + 6k, so n + 1 is also the sum of 5’s and 6’s. I think the standard induction argument is trickier. We need to be able to get from n to n + 1 rather than from n − 4 to n + 1. To increase by 1, we look for ways to

Page 8

convert 5’s to 6’s so as to increase the total by 1, and ways to convert 6’s to 5’s to do the same. It is easy to convert 5’s to 6’s, of course: If we have even a single 5, replacing it by a 6 increases the sum by 1. The other direction is slightly harder: we can trade four 6’s for five 5’s to increase the sum by 1. Said differently, suppose that n = 5m + 6k for some integers m and k. Then n + 1 = 5(m − 1) + 6(k + 1), and n + 1 = 5(m + 5) + 6(k − 4). This means we can go from n to n + 1 if we have at least one 5 or four 6’s. The cases where we can’t get from n to n + 1 must be when we have fewer than one 5 and fewer than four 6’s. But 0 · 5 + 3 · 6 = 18, so if n > 18 and n is the sum of 5’s and 6’s, then we must have at least one 5 or at least four 6’s. What this means is that as soon as we find an n > 18 which is a sum of 5’s and 6’s, all larger numbers should be sums of 5’s and 6’s as well. The smallest number n > 18 which is the sum of 5’s and 6’s is n = 20. (If 19 were the sum of 5’s and 6’s we could have started there, but it isn’t.) With all this preparation, here is the actual proof by regular induction. We prove that each n ≥ 20 is the sum of 5’s and 6’s. The base case is n = 20, and since 20 = 4 · 5 + 0 · 6, the base case is true. So let n ≥ 20, and suppose that n is the sum of 5’s and 6’s, say n = 5m + 6k. Since n > 20, either m ≥ 1 or k ≥ 4. If m ≥ 1, then n + 1 = 5(m − 1) + 6(k + 1). If k ≥ 4, then n + 1 = 5(m + 5) + 6(k − 4). Either way, n + 1 is the sum of 5’s and 6’s. By the principle of (regular) induction, all numbers n ≥ 20 are sums of 5’s and 6’s.

10. Here are two more strong induction problems. (a) If x + x1 is an integer, prove that for all n ≥ 1, xn + x1n is also an integer. Hint: one 1 approach is to multiply: (xn + x1n )(x + x1 ) and solve for xn+1 + xn+1 . 1 1 Solution: Following the hint, (xn + x1n )(x + x1 ) = xn+1 + xn+1 + xn−1 + xn−1 , so 1 1 1 1 n+1 n n−1 + xn−1 ). Since there are terms involving x + xn+1 = (x + xn )(x + x ) − (x n and n − 1, we need two base cases. We can let one of the base cases be n = 0, for which xn + x1n = 1 + 1 = 2 is always an integer. The other base case is n = 1, which is our assumption. So let x + x1 be an integer, and suppose that xk + x1k 1 is an integer for all k with 0 ≤ k ≤ n. Then by hypothesis, xn + x1n , xn−1 + xn−1 , 1 1 1 1 1 n n+1 n−1 and x + x are all integers, so x + xn+1 = (x + xn )(x + x ) − (x + xn−1 ) is also an integer. By the principle of (strong) induction, it follows that xn + x1n is an integer for all positive integers n.

Page 9

(b) If a0 = 1, a1 = 2, a2 = 4, and if an = an−1 + an−2 + an−3 for all n ≥ 3, prove that an ≤ 2n for all n ≥ 0. Solution: Since an depends on three previous things, we need three base cases, which we already have (a0 = 1 = 20 , a1 = 2 = 21 , a2 = 4 = 22 .) Suppose that ak ≤ 2k for all k with 0 ≤ k ≤ n. Then an+1 = an + an−1 + an−2 ≤ 2n + 2n−1 + 2n−2 = 2n+1 ( 21 + 14 + 81 ) = 78 2n+1 ≤ 2n+1 . That is, an+1 ≤ 2n+1 . By the principle of (strong) mathematical induction, an ≤ 2n for all n ≥ 0.

11. Find the recurrence relations, with initial conditions, for each of the following problems. (a) Ternary strings of length n without 3 consecutive 0’s. (b) Ternary strings of length n WITH 3 consecutive 0’s. (c) Ternary strings of length n without 3 consecutive even numbers. (d) ternary strings of length n WITH 3 consecutive even numbers. There will be nothing like question 11 on the exam.

Page 10