CMPSCI 250: Introduction to Computation

Solutions to First Midterm Exam Spring 2018

David Mix Barrington

Exam given 26 February 2018

Solutions posted 7 March 2018


  Q1: 20 points
  Q2: 30 points
  Q3: 30 points
  Q4: 20+10 points
Total: 100+10 points

Question text is in black, solutions in blue.

Here are definitions of sets, predicates, and statements used on this exam.

Remember that the score of any quantifier is always to the end of the statement it is in.

Let S be a finite set of dogs consisting of exactly the six distinct dogs Cardie (c), Duncan (d), Guinness (g), Maya (m), Nina (n), and Rio (c).

Let B be a finite set of breeds consisting of exactly the six breeds Collie (C), Mastiff (M), Poodle (P), Retriever (R), Terrier (T), and Weimeraner (W).

Let NL be the binary relation on S defined so that NL(x, y) means "dog x is no larger than dog y". We will also sometimes translate NL(x, y) as "dog y is no smaller than dog x". Although I didn't say this on the actual test, I should have encouraged you to translate ¬NL(x, y) as "dog x is larger than dog y" or "dog y is smaller than dog x".

Let f be the function from S to B defined so that "f(x) = b" means "the breed of dog x is b".

Let N be the set of natural numbers {0, 1, 2, 3,...}.

If a, b, and m are naturals, with m > 0, the notation "a ≡ b (mod m)" means "a is congruent to b, modulo m".

Last modified 7 March 2018