# First Midterm Exam

### Directions:

• Answer the problems on the exam pages.
• There are six problems on pages 2-6, for 100 total points. Probable scale is A=93, C=69.
• If you need extra space use the back of a page.
• No books, notes, calculators, or collaboration.

```  Q1: 15 points
Q2: 15 points
Q3: 15 points
Q4: 20 points
Q5: 20 points
Q6: 15 points
Total: 100 points
```

• Note for Questions 1-4: These questions deal with a set of dogs D = {Chinook, Ebony, Hadley}, a set of breeds B = {Husky, Labrador, Poodle}, and a binary predicate M defined so that M(d,b) means "dog d is a member of breed b''.

• Question 1 (15): Translate each of the following English statements into symbolic notation:

• (a,5) If Hadley is a Labrador, then Chinook is not a Husky.

• (b,5) Hadley is either a Labrador or a Poodle, but not both, and if Chinook is either a Husky or a Poodle, but not both, then Hadley is not a Poodle.

• (c,5) Every dog is a member of some breed.

• Question 2 (15): Translate each of the following symbolic statements into English. (The type of variables b, b1, and b2 is "breed", and the type of d, d1, and d2 is "dog".)

• (e,5) ∀ d1:∀ d2: ∀ b: [M(d1,b)∧ M(d2,b)∧ (d1≠d2)]→ (b = Labrador)

• (f,5) ∀ b1:¬∃ d:∃ b2: M(d,b2)∧ (b1≠b2)∧ M(d,b1).

• Question 3 (15): Assume that statements (a) through (f) from Questions 1 and 2 are true, and further assume that Ebony is a Labrador. You may find it useful to solve parts of Question 4 first, or otherwise determine the breeds of the various dogs.

• (g,5) Prove, using the definition of a function, that the relation M is a function from the given set of dogs to the given set of breeds.
• (h,5) Is M a one-to-one function? Prove your answer using the given assumptions.
• (i,5) Is M an onto function? Prove your answer using the given assumptions.

• Question 4 (20): This question deals with some of the propositions obtained by substituting specific values into M.

• (j,5) Using a truth table, determine the truth value of M (Chinook, Husky) and M (Hadley, Labrador) from statements (a) and (d) only.

• (k,10) Using only information about the propositions M (Chinook, Husky), M (Chinook, Poodle), M (Hadley, Labrador), and M (Hadley, Poodle) from statements (a), (b), (d), and (e), determine the value of these four propositions and prove your answer from the statements using propositional proof rules. If you are sure that a rule is valid but can't remember its name, just state it and use it.

• (l,5) Verify that your conclusion is consistent with statement (f).

• Question 5 (20): The binary relation Pre on strings is defined so that Pre(u,v) means ∃w:uw=v. If this is true we say that u is a prefix of v. Prove carefully that Pre is a partial order on the set of all strings over any alphabet. State the three properties of a partial order, and use the definition of Pre and quantifier proof rules to show that each of the three properties holds. (Hint: You may assume that every string has a length, and that the length of xy is the length of x plus the length of y. You may also assume well-known properties of the naturals.)

• Question 6 (15): Recall that we may define two naturals a and b to be congruent modulo a natural r if there exists a natural q such that either a=qr+b or b=qr+a. We write this "a≡b (mod r)". Recall also that a natural c divides a natural d (written "D(c,d)") if and only if ∃ e:ce=d. Prove carefully, using exactly these definitions, that: ∀a:∀b:∀c:∀d:[D(a,b)∧ (c ≡ d (mod b))]→ (c ≡ d (mod a))