CMPSCI 250: Introduction to Computation
First Midterm Exam Fall 2018
David Mix Barrington and Marius Minea
10 October 2018
Directions:
- Answer the problems on the exam pages.
- There are four problems, each with multiple parts, for 100 total
points plus 10 extra credit. Actual scale A = 93, C = 63.
- Some useful definitions precede the questions below.
- No books, notes, calculators, or collaboration.
- In case of a numerical answer, an arithmetic expression like
"217 - 4" need not be reduced to a single integer.
Q1: 20 points
Q2: 30 points
Q3: 30 points
Q4: 20+10 points
Total: 100+10 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. One day Cardie and Duncan
were joined on their morning walk by several other dogs. The set S of dogs
on this group walk included Bingley (b), Cardie (c), Duncan (d), Guinness (g),
Whistle (w), and perhaps others.
Let the binary predicate JB on S be defined so that JB(x, y) means "dog
x joined the walk before dog y". Assume that the relation corresponding to
JB is antireflexive, antisymmetric, and transitive.
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.
- Question 1 (20):
Translate each statement as indicated, using the set of dogs S which
includes the dogs Bingley (b), Cardie (c), Duncan (d), Guinness (g),
and Whistle (w), and possibly other dogs as well. All variables should
be of type "dog". The predicate JB is defined so that JB(x, y) means
"dog x joined the walk before dog y".
- (a, 3) (to English) (Statement I)
∀x: JB(c, x) ↔ JB(d, x)
- (b, 3) (to symbols)
(Statement II)
If Bingley joined the walk before Whistle, then Cardie joined
before Guinness and Guinness joined before Bingley.
- (c, 3) (to English) (Statement III)
JB(g, b) ∧ (JB(b, w) ⊕ JB(c, g))
- (d, 4) (to symbols) (Statement IV)
Whistle joined the walk before at least two distince other dogs.
- (e, 4) (to symbols) (Statement V)
Every dog, except for Bingley himself, joined the walk before Bingley.
- (f, 3) (to English) (Statement VI)
¬(∀y: JB(y, w) ∨ JB(b, y))
- Question 2 (30): These questions use the definitions,
predicates, and premises above.
- (a, 10)
Assume that Statements II and III are true. Using only those
statements, determine the truth values of the three propositions
JB(c, g), JB(b, w), and JB(g, b). You may use a truth table or a
deductive sequence proof. You may find it useful to abbreviate the
three propositions involved as p, q, and r.
- (b, 20)
Asssuming that Statements I-V are all true, and assuming that the
relation JB is antireflexive, antisymmetric, and transitive, prove
that Statement VI is true. You may use either English or symbols,
but make it clear each time you use a quantifier proof rule.
- Question 3 (30):
The following are fifteen true/false questions, with no explanation
needed or wanted, no partial credit for wrong answers, and no penalty
for guessing. Some use the sets, relations, and functions defined
above, but you should assume the truth of Statements I-VI only if
explicitly told to. Two points for each correct answer.
- (a) If Statements I-VI are all true, and the relation JB has
the specified properties, then there must be at least six dogs in the
set S.
- (b) If Statements I-VI are all true, and the relation JB has
the specified properties, then the negation of the relation JB is
not a partial order.
- (c) If Statements I-VI are all true, and the relation JB has
the specified properties, then the relation R, defined so that R(x,
y) is true if and only if JB(x, y) and JB (y, x) are both false, is
an equivalence relation.
- (d) Ignoring all the other statements, Statement II is true
in exactly five of the eight possible settings of its three atomic variables.
- (e) The following is a tautology: (p → (q → r))
↔ ((p → q) → r)
- (f) (A ∩ B) Δ C = (A ∩ C) Δ (B ∩ C)
is a set identity.
- (g) For any predicates P and Q we have [∀x: P(x) ∨
Q(x)] ↔ [(∀y: P(y)) ∨ (∀z: Q(z))].
- (h) If a binary relation R on some set is symmetric, then
its complement Rc(x, y) = ¬R(x, y) may fail to be symmetric.
- (i) For any functions f and g, if g ∘ f is bijective
and f is onto, then g is one-to-one.
- (j) If X is any set and P is a predicate over X, then from
∀x: P(x) we can conclude by Specification that there exists
some value v ∈ X for which P(v) holds.
- (k) If X is any language that contains no strings of odd
length, then the language XX (the concatenation product of X with
itself) also contains no strings of odd length.
- (l) If u and v are nonempty strings, vu is a suffix of w,
and u is not a suffix of v, then v is not a suffix of w.
- (m) If n is a positive natural, the relation R(x, y) defined
as x = y ∨ xy ≡ 1 (mod n) is not an equivalence relation.
- (n) The numbers 97, 115, and 119 can each be written in the
form piqj where p and q are prime numbers and
i and j are positive naturals.
- (o) Let x and y be two naturals such that neither
is divisible by 119. Then it is possible that xy is divisible by 119.
- Question 4 (30):
Here are some straightforward number theory questions.
- (a, 10)
Prove that the three naturals 97, 115, and 119 are pairwise
relatively prime, by using the Euclidean Algorithm on each of
the three pairs.
- (b, 10)
Find an inverse of 97, modulo 119, and an inverse of 119, modulo
97. Show your calculations. Be sure to make clear which is which.
- (c, 10XC)
Mr. Lear, an elderly man with three daughters, is making
arrangements for his retirement. His bank account is accessed
by a four-digit PIN number, which we may think of as a natural
number x that is less than 10000.
He gives each of his daughters partial information about x, so
that none of them can determine x on her own. He tells Cordelia
the remainder x % 97 from dividing x by 97. He tells Goneril
the number x % 115, and Regan the number x % 119.
Explain why any two of the daughters, by combining their
information, can determine x. You may quote the Chinese
Remainder Theorem without proof if you do so accurately.
Last modified 18 October 2018