INFO 150: A Mathematical Foundation for Informatics

Solutions to Practice First Midterm Exam

David Mix Barrington

6 October 2016

Directions:

Question text is in black, solutions in blue

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

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

  • Question 2 (25): Translate the following statements as indicated. The dogs Cardie, Duncan, and Mia are denoted symbolically by c, d, and m respectively. If x is a dog, the predicate B(x) means "x is barking". If is a dog and y is a number, the predicate A(x, y) means "dog x is age y". The symbols "<", "≤", "=", "≥", and ">" on numbers have their usual meaning.

  • Question 3 (20): Establish the following fact with truth tables:

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

  • Question 4 (20): Prove that for any number n, if n is the square of an even number and n > 10, then n - 1 is not a prime number.

    Let n be (2k)2 since it is the square of an even number. So n = 1 = 4k2 - 1, which factors as (2k + 1) times (2k - 1). We may take k to be a positive number, since 2k and -2k have the same square. But k cannot be 1, since otherwise n would be 4, and we are told that n > 10. Since k > 1, we know that 2k + 1 > 3 and 2k - 1 > 1. In particular, both the factors of n - 1 are greater than one, so by definition n - 1 is not a prime number.

  • Question 5 (20): Prove by induction on n that the number 7n - 1 is divisible by 6.

    For the base case, we observe that 71 - 1 = 6, which is divisible by 6.

    For the inductive case, we assume that 7n-1 - 1 is divisible by 6, and prove that 7n - 1 is divisible by 6. There are at least two ways to do this.

    The first is to note that 7n - 1 = (7n-1 - 1) + (7n - 7n-1). The second term factors as 7n-1(7 - 1), which is divisible by 6. The sum of two numbers, each divisible by 6, must be divisibe by 6. The second way is to note that if 7n-1 - 1 is divisible by 6, it remains divisible by 6 if we multiply it by 7 to get 7n - 7. It then again remains divisible by 6 if we add 6 to it to get 7n - 1.

    Last modified 6 October 2016/small>