MATH CSE20 Homework 5 Due Monday November 4 Assigned reading: NT Section 1 (1) Prove the statement if true, otherwise find a counterexample. (a) For all natural numbers x and y, x + y is odd if one of x and y even and the other is odd. TRUE; Proof: Let x, y be natural numbers. Assume, without loss of generality, that x is even and y is odd. The argument is symmetric if x is odd and y is even. WTS: x + y is odd. x = 2k, for some k Z by the definition of even y = 2j + 1, for some j Z by the definition of odd x + y = 2k + 2j + 1 = 2(k + j) + 1 = 2l + 1 for some l = k + j and l Z because integers are closed under addition. Thus, by the definition of odd, x + y is odd and the statement is true. (b) For all natural numbers x and y, if x + y is odd then one of x and y even and the other is odd. TRUE; Proof: Let x, y be natural numbers. By contrapositive, we will prove that if it s not the case that one of x and y is even and the other is odd, then x + y is even. There are two cases to this proof: Case 1: Given: Assume x and y are odd. WTS: x + y is even. x = 2k + 1, for some k Z y = 2j + 1, for some j Z x + y = 2(k + j + 1) = 2l for some l = k + j + 1 and l Z because integers are closed under addition. Thus, by the definition of even, x + y is even. Case 2: Given: Assume x and y are even. WTS: x + y is even. x = 2k, for some k Z
2 y = 2j, for some j Z x + y = 2(k + j) = 2l for some l = k + j and l Z because integers are closed under addition. Thus, by the definition of even, x + y is even. Because both cases result in x + y being even, the statement is true. (2) Prove the statement if true, otherwise find a counterexample. (a) The difference of any two odd integers is odd. False: Counterexample: 5-3 = 2. (b) If the sum of two integers is even, one of them must be even. False: Counterexample: 1 + 3 = 4. (3) Prove the statement if true, otherwise find a counterexample. (a) The product of two integers is even if and only if at least one of them is even. Negating both A and B in A if and only B gives an equivalent statement. (It s the contrapositive.) In this case, the result of this negation is The product of two integers is odd if and only if neither of them is even. Since neither of them is even is the same thing as both of them are odd, this is the closure property mentioned in Example 1. We can also formally show that this statement is true by proving the if part, then proving the only if. Proof (direct) of if : Given: Assume x and y Z and x = 2k is even, for some k Z. WTS: xy is even. xy = 2ky = 2(ky) = 2z for some integer z = ky and z Z because integers are closed under multiplication. By the definition of even, xy is even. Proof (contrapositive) of only if : If x and y are both odd, their product is odd. Given: Assume for x and y Z, x = 2k + 1 and y = 2j + 1 are odd, for some k, j Z. WTS: xy is odd. xy = (2k + 1)(2j + 1) = 2kj + 2k + 2j + 1 = 2(kj + k + j) + 1 = 2l + 1
3 for some integer l = kj + k + j and l Z because integers are closed under multiplication and addition. By the definition of even, xy is odd. Because we have proven both parts of the statement, it is true. (b) The product of two integers is odd if and only if at least one of them is odd. False: Counterexample: 3 x 2 = 6. (4) Prove the statement if true, otherwise find a counterexample. (a) For any integers m and n, m 3 n 3 is even if and only if m n is even. True. Once can write out various proofs, breaking things down into cases depending on whether m and n are even or odd. Alternatively, one can construct a table with four cases: m n m n m 3 n 3 m 3 n 3 even even even even even even even odd odd even odd odd odd even odd odd even odd odd odd even odd odd even By comparing the m n and m 3 n 3 columns, we see that the result is true. An alternative proof can be obtained by doing calculations modulo 2. We ll see more of this in the next week. This is because even corresponds to 0 (mod 2) and odd to 1 (mod 2). We have m 3 = m (mod 2) and n 3 = n (mod 2). Therefore m 3 n 3 = m n (mod 2). (b) For any integers m and n, m 3 n 3 is odd if and only if m n is odd. True. In fact, this is equivalent to (a) because A B is true if and only if A B is true. (5) Prove the statement if true, otherwise find a counterexample. (a) For all integers n > 2, n 3 8 is composite. False. Try n = 3. (What is the answer for n > 3?) (b) For all integers n, ( 1) n = 1 if and only if n is odd. We will prove this in the same way that we proved problem 3a. Proof (direct) of if : Given: Assume n Z and is odd. By the definition of odd, n = 2k + 1, for k Z. ( 1) n = ( 1) 2k+1 = ( 1) 2k = 1 Thus, for all integers n, ( 1) n = 1 if n is odd. Proof (by contrapositive) of only if : Given: Assume n Z is even. WTS: ( 1) n = 1
4 By the definition of even, n = 2k for k Z. ( 1) n = ( 1) 2k = (( 1) 2 ) k = 1 k = 1 Thus, for all integers n, ( 1) n = 1 if n is even. Because we have proven both parts of the statement, it is true. (6) Prove the statement if true, otherwise find a counterexample. We provide proof sketches for each of the true statements. (a) n Z, n 2 + n + 5 is odd. True: One of n and n + 1 is even. Therefore, n(n + 1) = n 2 + n is even and since 5 is odd, (n 2 + n) + 5 is odd. (b) n Z, (6(n 2 + n + 1) (5n 2 3) is a perfect square). True: With some algebra, we can conclude that 6(n 2 + n + 1) (5n 2 3) = (n + 3) 2. (c) M > 0, n > M, (n 2 n + 11 is prime). False: For every M > 0, let n = 11M > M. Note that n 2 n + 11 = 11(11M 2 M + 1), which is composite because 11M 2 M + 1 M(11M 1) > 1. (d) There is a unique prime p of the form n 2 + 2n 3. True: Factor n 2 + 2n 3 to get (n + 3)(n 1). For this to be a prime, we must choose n so that one factor is ±1 and the other is ±p, where p is a prime and both factors have the same sign. Thus either n + 3 = p and n 1 = 1 or n + 3 = 1 and n 1 = p. The first pair of equations give n = 2 and p = 5, which is a prime. The second pair of equations give n = 4 and p = 5, which is the same prime. You may ask about the choices n + 3 = 1 and n 1 = p or n + 3 = 1 and n 1 = p. They lead to negative values for p and primes must be positive by definition. (7) Prove the statement if true, otherwise find a counterexample. (a) For all integers n > 0, either n is a perfect square or, n = x + y where x and y are perfect squares or, n = x + y + z where x, y, and z perfect squares. False: 7 is a counterexample since the only possible perfect square values for x, y and z are 0, 1, and 4. (b) The product of four consecutive positive integers is never a perfect square. True: We can write such a product as N(k) = k(k + 1)(k + 2)(k + 3). Let s look at some values: N(1) = 24 = 5 2 1, N(2) = 120 = 11 2 1, N(3) = 360 = 19 2 1. It looks like N is always one less than a square. Since squares are not very close together this would mean that N is not a square. We have a plan. Let s write a
5 proof. Since k(k + 3) and (k + 1)(k + 2) are close together, we rewrite the product as N = (k(k + 3))((k + 1)(k + 2)) = (k(k + 3))(k(k + 3) + 2) = n(n + 2) > n 2, where n = k(k + 3). Now n(n + 2) = (n + 1) 2 = 1 one less than a square as we conjectured. Thus N < (n + 1) 2. We ve shown that N lies between two consecutive squares; that is, n 2 < N < (n + 1) 2. Hence N cannot be a square. (8) Prove the statement if true, otherwise find a counterexample. (a) For all distinct positive integers m and n, either m 1/2 +n 1/2 and m 1/2 n 1/2 are both rational or both irrational. Hint: Consider (m 1/2 + n 1/2 )(m 1/2 n 1/2 ). True: Let x = m 1/2 + n 1/2 and y = m 1/2 n 1/2. Then xy = m n is a nonzero integer. Hence x and y are either both rational or both irrational. (See discussion in Example 3). (b) For all distinct positive integers, if either m 1/2 + n 1/2 or m 1/2 n 1/2 are rational then both m and n are perfect squares. True: Define x and y as in (a). Since at least one is rational, they are both rational by (a). Thus (x + y)/2 = m 1/2 is rational and so m is a perfect square by Theorem 3. Likewise, (x y)/2 = n 1/2 shows that n is also a perfect square. (c) For all distinct positive integers m and n, both m and n are perfect squares if and only if m + 2m 1/2 n 1/2 + n is a perfect square. True: Note that m + 2m 1/2 n 1/2 + n = (m 1/2 + n 1/2 ) 2. This is a perfect square if m and n are perfect squares. Conversely, suppose this is a perfect square. Then m 1/2 + n 1/2 is rational and so m and n are perfect squares by (b). (d) Which of (a), (b), and (c) are true if m n is changed to m = n? (a) and (b) are false whenever m = n is not a perfect square. If m = n, m + 2m 1/2 n 1/2 +n = 4m and hence is a perfect square if and only if m is a perfect square. Thus (c) is true.