CSI2101-Mid-term-2019- Solution

publicité
CSI 2101 (W19) - MIDTERM TEST
SOLUTION
(For questions 1 and 2 you do not need to show your work, it will not be marked,
even if you do show it)
Question 1. [4 points] Suppose P(x, y) is a predicate and the universe for the variables x
and y is {1, 2, 3}. Suppose P(1, 3), P(2, 1), P(2, 2), P(2, 3), P(3, 1), P(3, 2) are true, and
P(x, y) is false otherwise. Determine the truth value of the statements:
¬xy (P(x, y) ˄ ¬P(y, x))
FALSE
It is equivalent to xy ¬ (P(x, y) ˄ ¬P(y, x)) = xy (¬ P(x, y) ˅ P(y, x))
And this is not true when x= 2 and y=1
yx (P(x, y) → P(y, x))
TRUE
It is equivalent to yx (¬ (P(x, y) ˅ P(y, x)). Easy to check for y=1, 2 and 3
yx (x  y ˄ P(x, y))
FALSE
For y=1 the only x where x  y is x=1. But P(1, 1) is false.
xy (x = y ˄ P(x, y))
x=2 and y=2 satisfy the formula.
TRUE
Question 2. [2 points] (Circle the correct answer)
The formula 5 “ y x M(x, y)“ corresponds to 'Everybody has a mother'?
Question 3 [6 marks] Determine whether the following argument is valid (write clearly
your proof):
p→r
q→r
¬ (p ˅ q)
⸫ ¬r
Not valid, enough to consider the counter example p=F, q=F and r=T. All hypothesis are
true but not the conclusion.
Question 4 [6 marks] Prove or disprove the following:
If p and q are prime numbers, then p + q is not a prime number.
Disprove: enough to consider the counter example p=2 and q=3, both are primes but
p+q=5 is also prime.
Question 5. [7 points] Prove the following theorem:
Let n be an integer. If n2 – 2n +3 is even, then n is odd.
(Indicate clearly which type of proof you are using)
Proof by contrapositive:
Suppose n is even thus n= 2k. Therefore n2 – 2n +3 = (2k)2 – 2(2k) +3 = 2(2k2 – 2k +1) +1.
Thus n2 – 2n +3 is odd.
2
Téléchargement
Flashcards connexes
Créer des cartes mémoire