You are on page 1of 9

UNIVERSITY OF ALBERTA

CMPUT 272

Term Test 1 Sample Questions

Last Name:

First Name:

Do not turn this page until you have received the signal to start.
(In the meantime, please fill out the identification section above.)

Aids allowed: None.

Good Luck! PLEASE HAND IN

Total Pages = 9 Page 1 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
The symbol ⊕ denotes exclusive or, meaning that for any two statements p and q, p ⊕ q is true if
and only if exactly one of p and q is true.

a) Draw the truth table for ⊕;

b) Write down an equivalent expression of p ⊕ q using only connectives ∼, ∧, ∨.

c) Prove the equivalence between p ⊕ q and your proposed expression in b).

d) Is (p ⊕ q) ⊕ r ≡ p ⊕ (q ⊕ r)? Justify your answer.

e) Is (p ⊕ q) ∧ r ≡ (p ∧ r) ⊕ (q ∧ r)? Justify your answer without using truth tables.

Total Pages = 9 Page 2 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Given a statement p: “If compound X is boiling, then its temperature must be at least 150o ”

a) State the contrapositive.

b) Assuming p is true, is “If compound X is not boiling, then its temperature is less than 150o ”
true?

c) Assuming p is true, is “compound X’s temperature is at least 150o ” a sufficient condition for
compound X to boil?

Total Pages = 9 Page 3 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Prove that the following argument is valid:

(1) ∼p∨q →r
(2) s∨ ∼ q
(3) ∼t
(4) p→t
(5) ∼ p ∧ r →∼ s
∴ ∼q

At each step of reasoning you need to provide the rule and line numbers that you use.

Total Pages = 9 Page 4 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Write a negation of the following statement:

If x is a solution to x10 + 100x9 − 3x − 300 = 0, then x is an integer.

Prove or disprove the correctness of the above statement.

Total Pages = 9 Page 5 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Simplify the following statements as much as you can using the logical equivalences studied in class.
Part (a) [7 marks]
∼ [(∼ p →∼ (q →∼ r)) → (p ∨ r)]

Part (b) [8 marks]


[(p → q) ∧ (q → r)] → (p → r)

Total Pages = 9 Page 6 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Suppose that P and Q are predicates with the same domain. For each statement below, indicate
whether it is true or false. Justify your answers.

∃xP (x) ∧ ∃x ∼ P (x) ≡ ∃x(P (x)∧ ∼ P (x))

∃x(P (x) →∼ Q(x)) ≡∼ ∀x(P (x) ∧ Q(x))

Total Pages = 9 Page 7 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
Below are some English statements and some statements in formal logical notation. The domain
is the set of natural numbers, N = {0, 1, 2, . . .}. The predicates are defined as follows:
G(x, y) means x > y.
B(x, y, z) means x is between y and z, that is, either y < x < z or z < x < y.

Match each English statement with the statement in formal logic that most closely translates it.
Indicate the pairs in the box below.

English Statement E1 E2 E3 E4 E5 E6 E7 E8

Logic Statement

E1 There is a natural number that is greater than all natural numbers.

E2 There are three (not necessarily distinct) natural numbers such that one is between the other
two.

E3 Every natural number other than zero is between two natural numbers.

E4 Every natural number is greater than some natural number.

E5 Every natural number is between two natural numbers.

E6 There is a natural number such that every other natural number is greater than it.

E7 There is a natural number that is greater than any natural number except itself.

E8 For every natural number, there is a natural number that is greater than it.

L1 ∀x ∃y G(y, x)

L2 ∀x ∃y G(x, y)

L3 ∃y ∀x G(y, x)

L4 ∃y ∀x (y 6= x → G(y, x))

L5 ∃x ∀y (y 6= x → G(y, x))

L6 ∀x ∃y ∃z B(x, y, z)

L7 ∀x (x 6= 0 → (∃ y, z such thatB(x, y, z)))

L8 ∃x, y, z such that B(x, y, z)

Total Pages = 9 Page 8 cont’d. . .


Last Name: Student ID:

Question 0. (continued)
For each statement below, state whether it is true or false. Prove the statement directly from the
definitions if it is true, and give a counterexample if it is false.

a) The sum of any three consecutive integers is divisible by 3.

b) For all even integers a and b, 4|ab.

c) For all integers a, b, and c, if a|b and a|c then a|(2b − 3c).

d) For all integers a, b, and c, if ab|c then a|c and b|c.

e) For all integers a, b, and c, if a|(b + c) then (a|b or a|c).

Total Marks = 0

Total Pages = 9 Page 9 End of Examination

You might also like