CMPSCI 190DM: A Mathematical Foundation for Informatics

Solutions to Second Midterm Exam

David Mix Barrington

23 October 2015

Directions:

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

Question text is in black, solutions in blue.

  • Question 1 (20): Briefly identify the following terms or concepts (4 points each):

  • Question 2 (15): Identify each of the following statements as true or false. No explanation is needed or wanted, and there is no penalty for guessing. (3 points each)

  • Question 3 (20): Prove that if an integer n is not divisible by 4, then n3 is also not divisible by 4. (Hint: Use Proof by Cases and the Division Theorem on n, with m = 4.)

    Following the hint, we write n as 4q + r and consider the four cases for the four possible values of r.

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

    Our P(n) is the statement "an = n3 + 2".

    Our base case P(1) = "a1 = 13 + 2", which is true because a1 is defined to be 3 and the right-hand side evaluates to 3.

    For the inductive step, we assume an-1 = (n-1)2 + 2 and try to prove that an = n3 + 2.

    Using the rule for the sequence, an is equal to an-1 + 3n2 - 3n + 1 which is equal to (n-1)3 + 2 + 3n2 - 3n + 1. Expanding the first term, this is n3 - 3n2 + 3n - 1 + 2 + 3n2 - 3n + 1, which simplifies to n3 + 2.

    We have completed the base case and the inductive step, and thus proved that P(n) is true for all positive integers n.

  • Question 5 (25): The Tribonacci sequence is defined by the rules T1 = 1, T2 = 1, T3 = 1, and for all n with n > 3, Tn = Tn-1 + Tn-2 + Tn-3.

    Last modified 25 October 2015