CMPSCI 250: Introduction to Computation
First Midterm Exam
David Mix Barrington
8 October 2013
Directions:
- Answer the problems on the exam pages.
- There are six problems, some with multiple parts, for 100 total
points plus 10 extra credit. Estimated scale A = 93, C = 69, but
may
be adjusted.
- 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: 15 points
Q2: 15 points
Q3: 15 points
Q4: 15 points
Q5: 10 points
Q6: 30+10 points
Total: 100+10 points
Correction in orange made 25 Feb 2014.
- Question 1 (15):
Translate each statement as indicated, using the set of dogs {Cardie,
Duncan, Nala} (denoted by c, d, and n, with no two equal to one
another),
and the two predicates R(x, y) meaning "dog x is equal to or faster
than dog y" and G(x, y) meaning "dog x's favorite dog is dog y".
- (a, 3) (to English) (Statement I)
∀x: R(n, x)
- (b, 3) (to symbols)
(Statement II) There is a dog that Nala is equal to or
faster than, and that dog is Nala's favorite dog.
- (c, 3) (to symbols) (Statement III) Given any two dogs,
if the second dog is not Cardie, then the first dog is equal to or
faster than the second dog if and only if the first dog's favorite
dog is not the second dog.
- (d, 3) (to English) (Statement IV)
¬∃u:∃v:∃w:G(u, v) ∧ G(u, w)
∧ (v
≠ w)
- (e, 3) (to symbols) (Statement V) It is not the case that if
Cardie's favorite dog is Nala, then Duncan is equal to or faster
than Nala.
- Question 2 (15):
This question uses the definitions premises, and predicates from
Question 1.
Prove from the premises that Nala's favorite dog is not
Duncan. Use only the premises, not any inferences from the English
meaning of the predicates. (Hint: This can be done by using
Specification
on Statements I and III, then just propositional logic.)
- Question 3 (15): This question also uses the
definitions, predicates, and premises from Question 1. Again, do not
make any inferences from the English meaning of the predicates.
Prove from the premises that the relation G is a function from S
to S.
- Question 4 (15): This question uses the definitions from
Question 1, but not the premises. For this question only, you may
use
the normal English meaning of "equal to or faster than". In
addition,
you may assume that given any two different dogs, one is
faster
than the other.
- (a, 2) Is R reflexive? Explain your answer.
- (b, 2) Is R symmetric? Explain your answer.
- (c, 2) Is R antisymmetric? Explain your answer.
- (d, 3) Is R transitive? Explain your answer.
- (e, 3) Is R an equivalence relation? Explain your answer.
- (f, 3) Is R a partial order? Explain your answer.
- Question 5 (10): This question uses the definitions,
predicates, and premises of Question 1. Do not use any inferences
from the English meaning of the predicates. Assume the result of
Question 3, so that G is a function. Given what you can determine
from the premises:
- (a, 5) Is G a one-to-one function (an injection)?
Explain your answer.
- (b, 5) Is G an onto function (a surjection)? Explain
your answer.
- Question 6 (30+10): These four questions involve the
natural numbers 24 and 35, which are unfortunately the same pair of
numbers I chose for the Spring 2012 exam.
- (a, 10) Use the Euclidean Algorithm to show that 24 and 35
are relatively prime.
- (b, 10) Find integers x and y so such that 24x + 35y = 1.
Once you have found those integers, give a multiplicative inverse
of 24 (modulo 35) and a multiplicative inverse of 35 (modulo 24).
- (c, 10) Suppose that I know, for some integer x, that
x ≡ 2 (mod 35) and that x ≡ 3 (mod 24). State clearly
what
the Simple Form of the Chinese Remainder Theorem tells us about x.
- (d, 10XC) Find an integer x such that
x ≡ 2 (mod 35) and that x ≡ 3 (mod 24). (Hint: Your
answer to part (b) should be useful, though if you have time you
might be able to find the number by trial and error.
Last modified 25 February 2014