CMPSCI 190DM: A Mathematical Foundation for Informatics

Solutions to Practice Second Exam

David Mix Barrington

20 October 2015

Directions:

Question text is in black, solutions in blue.

  Q1: 15 points
  Q2: 15 points
  Q3: 20 points
  Q4: 20 points
  Q5: 30 points
Total: 100 points

  • Question 1 (15): Briefly identify the following terms or concepts (3 points each):

  • Question 2 (15): Determine whether each of these five statements is true or false. No explanation is needed or wanted, and there is no penalty for guessing.

  • Question 3 (20): Prove that if k is any integer, the number 7k + 5 is not a perfect square. (Hint: Argue the contrapositive, and apply the Division Theorem with m = 7 to the number you are squaring.)

    We will show that if n is any integer, then n2 is not of the form 7k + 5 because it has a remainder mod 7 of other than 5. Any integer n can be written as 7q + r where r is 0, 1, 2, 3, 4, 5, or 6. If r = 0, n2 = 49q2 which is a multiple of 7 and hence not of the form 7k + 5. If r = 1, m2 = 49q2 + 14q + 1, which has remainder 1, not 5, when divided by 7. In each of the other five cases, n2 = 49q2 + 14qr + r2. This number, when divided by 7, has the same remainder as does r2 because the other two terms are divisible by 7. With r = 2 this remainder is 4, with r = 3 it is 2 because (9 mod 7) = 2, with r = 4 it is (16 mod 7) = 2, with r = 5 it is (25 mod 7) = 4, and with r = 6 it is (36 mod 7) = 1. So it is never 5 for any perfect square.

  • Question 4 (20): Define a number sequence so that a1 = 3 and for all k with k > 1, ak = ak-1 + 4k - 7. Prove by induction that for any positive integer n, an = 2n2 - 5n + 6.

    For our base case, we must prove P(1), which says that a1 = 2(1)2 - 5(1) + 6. Since 2 - 5 + 6 = 3, this matches the given value of a1.

    For the inductive case, we assume that ak-1 = 2(n-1)2 -5(n-1) + 6, which is 2n2 - 4n + 2 - 5n + 5 + 6 = 2n2 -9n + 13. Then, by the rule, an = an-1 + 4n - 7 = 2n2 -9n + 13 + 4n - 7 = 2n2 -5n + 6. This is exactly what the statement P(n) says that it should be.

  • Question 5 (30): Define a number sequence so that b1 = 2, b2 = 3, and for all k with k > 2, bk = bk-1 - bk-2 + 1.

    Last modified 20 October 2015