1-18 and 15-151 problem sheet 7 Solutions to the following five exercises and optional bonus problem are to be submitted through gradescope by 11:30PM on Friday nd November 018. Problem 1 Let A N + and B N + be nonempty sets of positive integers. Define A + B def = {a + b : a A, b B}. Show that A + B is finite if and only if both A and B are finite. Solution. We proceed in both directions. ( ) Suppose A + B is finite. We show that A is finite; showing that B is finite is analogous. Fix b B. Define ϕ : A A + B via ϕ(a) = a + b for all a A. We claim that ϕ is an injection. To prove this, suppose ϕ(a 1 ) = ϕ(a ) for a 1, a A. Then a 1 + b = a + b a 1 = a. So, indeed, ϕ is an injection. We have thus found an injection from A into a finite set, and so by Proposition..1 A must be finite. ( ) Suppose A and B are finite. By Lemma.1., A and B must both have greatest elements. Let m A denote the greatest element in A, and define m B similarly. We claim that A + B [m A + m B ]. This implies that A + B is a subset of a finite set and thus must be finite. To prove this, let x A + B be arbitrary. By definition, there exist a A and b B such that x = a + b. Then 1 a m A and 1 b m B, so 1 < a + b m A + m B a + b [m A + m B ]. Since x was arbitrary, we deduce that A + B [m A + m B ], as desired.
Problem How many ways are there to pick two cards from a standard 5-card deck, such that the first card is a spade and the second card is not an ace? Solution. We partition the set of such -card hands. Let S be the set of such -card hands in which the first card is an ace. Let T be the set of such -card hands in which the first card is not an ace. By the addition principle, the number of hands we seek is S + T. If the first card is an ace, then it must be the ace of spades, so there is 1 choice. There are 8 non-ace cards remaining, so there are 8 choices of second card. Thus, S = 8. If the first card is not an ace, then there are 1 choices for its rank. There are then 7 non-ace cards remaining, so there are 7 choices for the second card. By the multiplication principle, T = 1 7. Hence there are 8 + 1 7 ways of picking two cards from a standard 5-card deck, such that the first card is a spade and the second card is not an ace. Problem 3 Count the number of hands of six cards from a standard deck of 5 cards that contain at least one card of every suit. Solution. Consider a hand with at least one card of each suit. Setting aside one card from each suit, either the remaining two cards have the same suit, or they have different suits. In the first case, the hand contains three cards of one suit, and one card of each of the remaining three; in the second case, the hand contains two cards each of two suits, and one card of each of the remaining two suits. Call the sets of card hands corresponding to these two cases, S and T, respectively. These two sets are mutually exclusive and every desired card hand is a member of one of the sets, so by the addition principle, we may count the number of hands of each type separately and add the results. If there are three cards of one suit and one card of each of the remaining three suits. Consider the following multi-step process. Pick the tripled suit; there are ( 1) choices. Pick the ranks of the cards in that suit; there are ( ) 3 choices. The remaining cards are ranked by their suits and may be picked in order in 3 steps, with ( ) 1 choices of rank for each step. Hence, by the multiplication principle, there are ( )( ) 3 1)( 3 1 card hands in S.
If there are two cards of two suits and one card of each of the remaining two suits. Consider the following multi-step process. Pick the doubled suits; there are ( ) choices. Pick the ranks for the lower doubled suit and then pick the ranks for the higher doubled suit; there are ( ) ways to perform each of these steps. Pick the rank for the lower singled suit and then pick the rank for the higher singled suit; there are ( ) 1 ways to perform each of these steps. So there are ( ) ( ) )( 1 card hands in T. Thus the total number of such hands is ( )( )( ) 3 + 1 3 1 ( )( ) ( 1 ) Problem Consider a set of 1 1 squares and 1 dominoes. The 1 1 squares are colored either red or blue; the 1 dominoes are colored green, yellow, or black. Let A n denote the number of ways to tile a 1 n board of unit squares with these squares and dominoes such that no two pieces overlap. 1. Show that A n = A n 1 + 3A n for all n.. Deduce that A n = 3n+1 + ( 1) n for all n 1. Solution. 1. Fix n and let T n denote the set of all tilings of a 1 n board with the given set of 1 1 and 1 tiles. Define the auxiliary sets S n = {t T n : t ends with a square} and D n = {t T n : t ends with a domino}. Note that T n = S n D n, since every tiling must end with one of those two pieces and no single tiling can end with both. As a result, T n = S n D n = S n + D n. It suffices to compute S n and D n. To compute S n, note that every tiling s S n consists of an arbitrary tiling of the first n 1 squares of the board followed by a 1 1 square. There are A n 1 possibilities for the former case and possibilities for the latter. By the 3
multiplication principle, this yields S n = A n 1. Similar reasoning yields D n = 3A n, where in the case that n = we utilize A 0 = 1. As a result, we obtain as desired. A n = A n 1 + 3A n,. Let P (n) = A n = 3n+1 + ( 1) n. We prove that P (n) is true for all positive integers n, by induction. Base case. First suppose that n = 1. The only way that one can tile a 1 1 board is with one of the two 1 1 squares; this gives A 1 =. We also have 3 1+1 + ( 1) 1 = 9 1 so P (1) is true. Now suppose that n =. There are two ways to tile a 1 board: either with one domino or with two squares. The former case has = possibilities; the latter has 3. This implies A = + 3 = 7. Once again, this checks, as Thus P () is also true. 3 +1 + ( 1) =, = 8 = 7. Induction step. Let n be a positive integer, and assume that P (k) holds for all 1 k n. We wish to show that P (n + 1) is true. If n = 1 then we refer to the base case where the truth of P () was established. If n > 1, we may use the recursion relation as follows: A n+1 = A n + 3A n 1 ( IH 3 n+1 + ( 1) n ) ( 3 n + ( 1) n 1 ) = + 3 = 3n+1 + ( 1) n + 3 n+1 + 3( 1) n = 3n+ + ( 1) n+1. Hence P (n + 1) is true, and the induction step is complete.
Problem 5 How many nine-digit integers consisting of each of the digits 1-9 exactly once are divisible by 36? Solution. Let N be such an integer. Note that since each of the digits 1 through 9 is used once, we have N 1 + + + 9 5 0 (mod 9). So N is divisible by 9 and N = 9j for for some integer j. Since and 9 are coprime, we see that N j 36 N. Thus, it remains only to compute the number of such integers N which are divisible by. Recall that an integer N is divisible by if and only if the number formed by the last two digits of N is divisible by (since the N minus its last digits is a multiple of 100 and is congruent to zero mod ). Such an ending cannot have any zeroes or use the same digit twice. There are 5 possible endings (of the form n for 0 n ). Seven of them include a zero (00, 0, 08, 0, 0, 60, 80), and two others have the same digit repeated twice (, 88). This gives a count of 5 7 = 16 -digit endings that are divisible by. Note that there are 7! ways to arrange each of the remaining seven digits, giving an answer of 16 7! = 8060, by the multiplication principle. Bonus Problem - ( points) Tram tickets have six-digit numbers (from 000000 to 999999). A ticket is called lucky if the sum of its first three digits is equal to the sum of its last three digits. A ticket is called medium if the sum of all its digits is 7. Let A and B denote the numbers of lucky tickets and medium tickets respectively. Prove that A = B. Solution. Let L and M be the sets of lucky and medium tickets, respectively. Define f : L M via f(abcdef) = abc(9 d)(9 e)(9 f). This specification is valid since abcdef lucky means that a + b + c = d + e + f, so a + b + c + (9 d) + (9 e) + (9 f) = (a + b + c d e f) + 7 = 7 and abc(9 d)(9 e)(9 f) is medium. Similarly, the function g : M L defined via g(abcdef) = abc(9 d)(9 e)(9 f) is well-defined, and we see that g and f compose to the identity in both orders, and are hence inverses of one another. Thus, g and f are both bijections and L = A = B = M. 5