CMPSCI 250: Introduction to Computation
First Midterm Exam
David Mix Barrington
23 February 2011
Directions:
- Answer the problems on the exam pages.
- There are six problems
for 100 total points plus 10 extra credit.
Actual scale is A=96, C=64.
- If you need extra space use the back of a page.
- No books, notes, calculators, or collaboration.
Q1: 10 points
Q2: 15 points
Q3: 15 points
Q4: 15 points
Q5: 20+10 points
Q6: 25 points
Total: 100+10 points
- Questions 1-5 all deal with a dog play group G, consisting of
exactly the four dogs Ace, Biscuit, Cardie, and Duncan, denoted by
the constants a, b, c, and d respectively. The variables g,
g1, g2, etc., are of type "dog in G". There
is also a set of playthings P, which includes a Rope chew r, a
Stuffed chicken s, and a Tennis ball t, possibly with other items as
well. The variables p, p1, p2, etc., are of
type "plaything in P". The predicate H(g, p) means "dog g has
plaything p". Unless otherwise indicated, there are no restrictions
on a dog having more than one plaything, or more than one dog having
the same plaything.
- Question 1 (10):
Translate the following three statements as indicated:
- Statement (a) (to symbols) It is not the case that if Cardie
has the tennis ball, then Duncan has the tennis ball.
- Statement (b) (to English) H(c, t) → (H(a, t) ↔
H(b, t))
- Statement (c) (to symbols) It is not the case that Duncan
has the tennis ball and that Ace does not have the tennis ball.
- Question 2 (15): Using propositional logic on the three
statements (a), (b), and (c), which involve the four propositions
H(a, t), H(b, t), H(c, t), and H(d, t), determine which of the
dogs have the tennis ball and which do not. (That is, you are to
determine the truth values of those four propositions.) It turns
out that there are exactly two ways to set the four
variables to satisfy all three statements -- find out what they
are and prove that there cannot be any others. (You may use
either truth tables or a propositional proof -- the propositional
proof is shorter.)
- Question 3 (15): Translate the following four statements
as indicated:
- Statement (a) (to English) ∃g1:
∃g2: ∀p: (g1 ≠
g2) ∧ (H(g1, p) ∨ H(g2,
p))
- Statement (b) (to symbols) There is a dog that has all
of the playthings.
- Statement (c) (to English) ∃p: ∀g: H(g, p)
- Statement (d) (to symbols) Given any two different
playthings, if Ace has one then he also has the other.
- Question 4 (15): Given the four statements from Question
3 (but not the statements from Question 1), prove that Ace has
the stuffed chicken. Use the quantifier rules of Instantiation,
Existence, Specification, and Generalization. (You may not need
all four rules, and you may not need all four premises.)
- Question 5 (20+10): For this question only,
assume that the relation H is a function form G to P.
- (a,10) Which of the four statements from Question 3 could
still be true, and which could not? Justify your answers.
- (b,5) If H is onto but not one-to-one, what can we
conclude about the set P?
- (c,5) If H is one-to-one but not onto, what can we
conclude about the set P?
- (d,5XC) At least one of the four statements from
Question 3 is possible if H is a function, but impossible if H
is an injection (a one-to-one function). Which statement, and why?
- (e,5XC) At least one of the four statements from
Question 3 is possible if H is a function, but impossible if H
is a surjection (an onto function). Which statement, and why?
- Question 6 (25): This question deals with some
number-theoretic properties of the naturals 18 and 25.
- (a,5) Run the Euclidean Algorithm on these two numbers and thus
show that they are relatively prime.
- (b,10) Using your calculations from (a) or otherwise,
find two integers x and y such that 18x + 25y = 1.
- (c,5) Consider the number 18·25 + 1 = 451.
Explain why any prime number that divides 451 cannot be a
divisor of either 18 or 25.
- (d,5) Find an integer z such that z ≡ 7 (mod 18)
and z ≡ 13 (mod 25). You may find the answer to part (b)
useful. You may express your answer as an arithmetic
expression without evaluating it.
Last modified 27 February 2011