CMPSCI 250: Introduction to Computation

Solutions to First Midterm Exam Fall 2017

David Mix Barrington

Exam given 11 October 2017

Solutions posted 20 October 2017

Directions:

  Q1: 15 points
  Q2: 30 points
  Q3: 30 points
  Q4: 25+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 animals consisting of exactly the five distinct animals Cardie (c), Duncan (d), Floyd (f), Scout (s), Whistle (w).

Let D be the unary relation on A defined so that D(x) means "x is a dog".

Let F be the unary relation on A defined so that F(x) means "x lives on the farm".

Let R be the unary relation on A defined so that R(x) means "x is a retriever".

Let M be the binary relation on A defined so that M(x, y) means "animal x met animal y during the morning walk". Note that two animals could be together on the walk without meeting during it.

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".

Let Σ be the alphabet {0, 1}, so that Σ* is the set of binary strings.

Let f be the function from Σ* to Σ* defined so that f(w) = ww (the concatenation of the string w with itself). For example, f(011) = 011011.

Let g be the function from Σ* to Σ* defined so that g(λ) = λ and for any letter a in Σ and any string w, g(aw) = w. (So g deletes the first letter of its input if there is one.) For example, g(011) = 11.

Last modified 20 October 2017