Sie sind auf Seite 1von 9

University of Ottawa

Faculté de génie Faculty of Engineering

École de science School of Electrical


informatique et de génie Engineering and Computer
électrique (SIGE) Science (EECS)

CSI 2101AB, Winter 2018


Prof. WonSook Lee

Name:_________________________________________________

Student ID: ____________________________________________

Mid-term

Monday, February 28, 2018

IMPORTANT:
1) This is a closed book test
2) No cell phone is allowed.
3) The answers are to be written in the spaces provided.

GOOD LUCK!
Q1. (8 points) Suppose P(x, y) is a predicate and the domain for the variables x and y is
{1, 2}. Suppose P(1, 1), P(1, 2) are true, and P(x, y) is false otherwise. Determine
the truth value of the statements:

(a) y x (x P(x, y)) TRUE FALSE

y = 1, x = 1
y = 2, x = 1

(b) x P(x, y)) TRUE FALSE

There is an example (x = 1, y = 1)

(c) ¬ x TRUE FALSE

There is a counter example (x = 1, y = 1)

(d) y x (P(x, y) P(y, x)) TRUE FALSE

y = 1, x = 1
y = 2, x = 2

2
Q2. (4 points) We express
using quantifiers as follows:
Let C(x, y) mean that person x has chatted with person y. The given statement is
x y (y x (z = y C(x,z ))))

Then form the negation of the statement so that no negation is to the left of a
quantifier. Next, express the negation in simple English. (Do not simply use the

<Answer> The negation is therefore

x ¬ (z = y C(x,z ))))

In English, everybody in this class has either chatted with no one else or has
chatted with two or more others.

3
(6 points) Express each of these statements using quantifiers. Then form the
negation of the statement so that no negation is to the left of a quantifier. Next,

Let S(x, y) mean that


student x has solved exercise y.

<Answer> The statement is x y S(x, y). The negation is x y ¬S (x, y). In


English, for every student in this class, there is some exercise that he or she has not
solved.

Let
S (x, y) mean that student x has solved exercise y, and let B(y, z )
mean that exercise y is in section z of the book.

<Answer> The statement is ¬ x z y (B (y, z) S (x, y )). The negation is x z y


(B (y, z) S (x, y)). In English, some student has solved at least one exercise in
every section of this book.

Q4. (4 points) Show that the premises (p q)


s r.

<Answer> We can rewrite the premises (p q) r as two clauses, p r and q


r s. Using the two
clauses p r and ¬ r s, we can use resolution to have p s. By adding r, we
conclude p s r

4
Q5. (2 points) Determine whether the argument is correct or incorrect and explain why.

Q6. (2 points) Suppose that the domain of the propositional function P(x) consists of 1,
2, 3, 5, 7 and 9. Express the following statement without using quantifiers, instead
using only negations, disjunctions, and conjunctions.

<Answer> P(1) P(9)

5
Q7. (2 points) Find a counterexample, if possible, to these universally
quantified statements, where the domain for all variables consists of all integers.

x y(y2 = x)

<Answer> x = -1

(6 points) Use rules of inference to show that if x(P(x) (Q(x) S(x))) and
x(P(x) R(x)) are true, then x(R(x) S(x)) is true.

(1) x(P(x) R(x)) Premise


(2) _____________ Universal instantiation from (1)
(3) P(a) Simplification from (2)
(4) x(P(x) (Q(x) S(x))) Premise
(5) _____________ Universal modus ponens from (3) and (4)
(6) S(a) Simplification from (5)
(7) _____________ Simplification from (2)
(8) R(a) S(a) Conjunction from (7) and (6)
(9) x(R(x) S(x)) Universal generalization from (5)

<Answer>
x(P(x) R(x)) Premise
P(a) R(a) Universal instantiation from (1)
P(a) Simplification from (2)
x(P(x) (Q(x) S(x))) Premise
Q(a) S(a) Universal modus ponens from (3) and (4)
S(a) Simplification from (5)
R(a) Simplification from (2)
R(a) S(a) Conjunction from (7) and (6)
x(R(x) S(x)) Universal generalization from (5)

6
(6 points) +

(a) Give a proof by contradiction

<Answer> Let P : 3n + 1 is odd and Q : n is odd


P Q means ¬ P Q. Assume ¬ (¬ P Q). ¬ (¬ P Q) is equivalent to P ¬ Q
meaning 3n + 2 is odd and n is even.
As n is even, there is k such that n = 2k. Therefore, 3n + 2 can be rewritten as 3
(2k) + 2, which means 3n + 2 is expressed as 2 (3k+1), which means is is even.
There is a contradiction to the assumption 3n+ 2. Therefore

(b) Give a proof by contraposition

<Answer> We prove ¬Q ¬P.


Prove if n is even, then 3n + 2 is even.
As n is even, there is k such that n = 2k.
Therefore 3n + 2 = 3(2k) + 2 = 2 (2k +1) which is even.

(4 points) Prove or disprove that if and are rational numbers, then is also
rational.

<Answer> An assertion like this one is implicitly universally quantified: it means


that for all rational numbers and , is rational . To disprove such a statement it
suffices to provide one counterexample. Take = 2 and = 1/2. Then = 21/2 =
.

7
Q11. (8 points) Prove that is irrational by giving a proof by contradiction. If
required, use <Lemma: is even, and so is even>.

<Answer> Let To start a proof by


contradiction, we suppose that ¬ p is true. Note that ¬
the case that
says that is rational. We will show that assuming that
¬ p is true leads to a contradiction.
If is rational, there exist integers a and b with = a/b, where b = 0 and a
and b have no common factors (so that the fraction a/b is in lowest terms.) (Here,
we are using the fact that every rational number can be written in lowest terms.)
Because = a/b, when both sides of this equation are squared, it follows that
2 = a2 / b2. Hence, 2 b2 = a2.
By the definition of an even integer it follows that a2 is even. We next use the given
Lemma that if a2 is even, a must also be even. Furthermore, because a is even, by
the definition of an even integer, a = 2c for some integer c. Thus,
2 b2 = (2c)2 = 4c2.
Dividing both sides of this equation by 2 gives b2 = 2c2.
By the definition of even, this means that b2 is even. Again using the lemma, we
conclude that b must be even as well.
We have now shown that the assumption of ¬ p leads to the equation
= a/b, where a and b have no common factors, but both a and b are even, that
is, 2 divides both a and b. Note that the statement that = a/b, where a and b
have no common factors, means, in particular, that 2 does not divide both a and b.
Because our assumption of ¬ p leads to the contradiction that 2 divides both a and b
and 2 does not divide both a and b, ¬ p
is i is irrational.

8
Q12. (4 points) 280 = 2 (mod 139) and 4203 = 33 (mod 139). Find a.

(a)

<Answer> a = 66

(b)

<Answer> a = 35

Q13. (4 points) Determine if the following statement is True or False

(a) (2, 9) are relative prime TRUE FALSE

(b) (15, 240) are relative prime TRUE FALSE

Q14. (4 points)
(a) What is LCM (15876, 432) where 15876 = 223472, 432=2433 ?

<Answer> 243472

(b) What is GCD (15876, 432) where 15876 = 223472, 432=2433 ?

<Answer> 2233

Das könnte Ihnen auch gefallen