INFO 150: A Mathematical Foundation for Informatics

Solutions to First Midterm Exam

David Mix Barrington

15 October 2017

Directions:

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

Question text is in black, solutions in blue.

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

  • Question 2 (25): Translate these five statements as indicated. We have a set of dogs D including (among others) the named dogs Cardie, Duncan, Mia and Whistle who are denoted symbolically by c, d, m and w respectively. If x is a dog, the predicate PB(x) means "x belongs to Professor Barrington" and PG(x) means "x belongs to Professor Gill". We also have a set B of breeds, a predicate I(x, y) meaning "dog x is of breed y", and a predicate SB(x, y) meaning "dog x and dog y are of the same breed". Variables in quantifiers are of type "dog" or of type "breed" -- you can tell which by how they are used in predicates.

  • Question 3 (20): Prove the following using truth tables:

    
         (q and (p or not r)) --> (p or (q and not r))
          0  0   0  1  1  0    1   0  0  0  0   1  0
          0  0   0  0  0  1    1   0  0  0  0   0  1
          1  1   0  1  1  0    1   0  1  1  1   1  0
          1  0   0  0  0  1    1   0  0  1  0   0  1
          0  0   1  1  1  0    1   1  1  0  0   1  0
          0  0   1  1  0  1    1   1  1  0  0   0  1
          1  1   1  1  1  0    1   1  1  1  1   1  0
          1  1   1  1  0  1    1   1  1  1  0   0  1
    

    Since the column under the implication (the last operation to be executed in evaluating the statement) is all ones, the statement is true in all eight cases and it thus a tautology.

  • Question 4 (20): Prove the following statement:

    Let z be the number n3 + n2 + n + 1. By the Division Theorem, we know that n can be written as 5q + r where 0 ≤ r < 5. We are interested in how the remainder, when 5 is divided by 5, depends on the value of r.

    Following one student's example, we will save calculation by computing z in terms of q and r before breaking into cases. Writing n as 5q + r, we get z = (5q + r)3 + (5q + r)2 + (5q + r) + 1. Expanding the powers, we get a lot of terms, but nearly all of them are clearly divisible by 5. The exceptions are the terms r3, r2, r, and 1.

    Now we break into five cases:

  • Question 5 (20):

    We prove this by induction.

    For the base case, we are given that a1 = 1, and we want to prove that a1 = 5 - 23-1. Since 1 = 5 - 4, this is true.

    For the inductive case, we asssume that an-1 = 5 - 23-(n-1) = 5 - 24 - n is true. Our inductive goal is an = 5 - 23-n. Using the rule, we compute that an = (an-1 + 5)/2 = (by the IH) (5 - 24-n + 5)/2 = (10 - 24-n)/2 = 5 - 23-n. This satisfies the inductive goal and completes the proof.

    Last modified 22 October 2017