CMPSCI 250: Introduction to Computation

First Midterm Exam Spring 2020

David Mix Barrington and Hia Ghosh

25 February 2020

Directions:

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

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.

Question 2 deals with the following scenario. Every day, Duncan monitors all visitors to the house and evaluates which ones (in his judgment) pose a threat. One day there were exactly five visitors, arriving at five distinct times. In alphabetical order, they were an Amazon driver (ad), the house cleaner (hc), the mail person (mp). a political canvasser (pc), and a UPS driver (ud).

Let V be the set {ad, hc, mp, pc, ud}. Let PT and DA be two unary relations on V, such that PT(x) means "visitor x posed a threat" and DA(x) means "visitor x was driven away by Duncan". Let AB be a binary relation on V, such that AB(x, y) means "visitor x arrived before visitor y", or equivalently "visitor y arrived after visitor x". We assume that AB is a strict total order, so that it is antireflexive, antisymmetric, transitive, and total.

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

The operator "%" on naturals, as in Java, refers to integer division, so that "x % y" is the remainder on dividing x by y.

Last modified 2 March 2020