A1 Sol

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

CSI 2101 Discrete Structures Winter 2012

Prof. Lucia Moura University of Ottawa

Homework Assignment #1 (100 points, weight 5%)


Due: Thursday Feb 9, at 1:00 p.m. (in lecture);
assignments with lateness between 1min-24hs will have a discount of 10%; after 24hs, not accepted;
please drop off late assignments under my office door (STE5027).

Propositional Logic

1. (12 points) Use logical equivalences to show that [(p ∨ q) ∧ (p → r) ∧ (q → r)] → r


is a tautology.

It is sufficient to show that if we assume the premise (p ∨ q) ∧ (p → r) ∧ (q → r), then


we can derive the conclusion r. Here is such an argument:

1. p∨q Simplification
2. p → r ≡ ¬p ∨ r Simplification
3. q → r ≡ ¬q ∨ r Simplification
4. q∨r Resolution (1) and (2)
5. r∨r ≡r Resolution (3) and (4)

Thus, the statement is a tautology.

2. (12 points; each 2+2+2 points=truth table+DNF+CNF)


For each of the following compound propositions give its truth table and derive an
equivalent compound proposition in disjunctive normal formal (DNF) and in conjunc-
tive normal form (CNF).

(a) (p → q) → r

We write out the truth table:


p q r p→q (p → q) → r
T T T T T
T T F T F
T F T F T
T F F F T
F T T T T
F T F T F
F F T T T
F F F T F

1
To get disjunctive normal form, we take the conjunction of the values for p, q, and
r for each row where the final evaluation is T, and then take their disjunction:

(p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ r)

To get conjunctive normal form, we take the conjunction of the values for p, q,
and r for each row where the final evaluation is F, and then take their disjunction:

(p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ ¬r)

Now we take the negation of this entire expression, and repeatedly using DeMor-
gan’s, we derive:

(¬p ∨ ¬q ∨ r) ∧ (p ∨ ¬q ∨ r) ∧ (p ∨ q ∨ r)

(b) (p ∧ ¬q) ∨ (p ↔ r)

We write out the truth table:


p q r p ∧ ¬qq p↔r (p ∧ ¬q) ∨ (p ↔ r)
T T T F T T
T T F F F F
T F T T T T
T F F T F T
F T T F F F
F T F F T T
F F T F F F
F F F F T T

To get disjunctive normal form, we take the conjunction of the values for p, q, and
r for each row where the final evaluation is T, and then take their disjunction:

(p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ q ∧ ¬r) ∨ (¬p ∧ ¬q ∧ ¬r)

To get conjunctive normal form, we take the conjunction of the values for p, q,
and r for each row where the final evaluation is F, and then take their disjunction:

(p ∧ q ∧ ¬r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ r)

Now we take the negation of this entire expression, and repeatedly using DeMor-
gan’s, we derive:

(¬p ∨ ¬q ∨ r) ∧ (p ∨ ¬q ∨ ¬r) ∧ (p ∨ q ∨ ¬r)

2
Predicate Logic

3. (15 points) For each of the given statements:


1 - Express each of the statements using quantifiers and propositional functions.
2 - Form the negation of the statement so that no negation is to the left of the quantifier.
3 - Express the negation in simple English. (Do not simply use the words “it is not
the case that...”).

(a) Some drivers do not obey the speed limit.

Let the domain be the domain of drivers, and let S(x) be the predicate “x obeys
the speed limit.” Then the statement can be written ∃x¬S(x), and the negation
is ¬∃x¬S(x) ≡ ∀xS(x), or, in English, all drivers obey the speed limit.

(b) All Swedish movies are serious.

Let the domain be the domain of Swedish movies, and let M (x) be the predicate
“x is serious.” Then the statement can be written ∀xM (x), and the negation is
¬∀xM (x) ≡ ∃x¬M (x), or, in English, some Swedish movie is not serious.

(c) No one can keep a secret.

Let the domain be the domain of all people, and let K(x) be the predicate “x
can keep a secret.” The statement can be written ¬∃xK(x) ≡ ∀x¬K(x). The
negation is ∃xK(x), or, in English, someone can keep a secret.

(d) No monkey can speak French.

Let the domain be the domain of all monkeys, and let F (x) be the predicate “x
can speak French.” The statement can be written ¬∃xF (x) ≡ ∀x¬F (x). The
negation is ∃xF (x), or, in English, some monkey can speak French.

(e) There is someone in the class who does not have a good attitude.

Let the domain be everyone in the class, and let A(x) be the predicate “x has a
good attitude’.” The statement can then be written ∃x¬A(x). The negation is
¬∃x¬A(x) ≡ ∀xA(x), or, in English, everyone in the class has a good attitude.

4. (10 points) Translate these system specifications into English where the predicate
S(x, y) is “x is in state y” and where the domain for x and y consists of all systems
and all possible states, respectively.

3
(a) ∃S(x, open)

Some system is open.

(b) ∀x(S(x, malf unctioning) ∨ S(x, diagnostic))

Every system is either malfunctioning or in diagnostic mode.

(c) ∃xS(x, open) ∨ ∃xS(x, diagnostic)

Either some system is open, or some system is in diagnostic mode.

(d) ∃x¬S(x, available)

Some system is not available.

(e) ∀x¬S(x, working)

No system is working.

5. (3+3+3+3=12 marks) Rewrite the following statments statements so that all negation
symbols immediately precede predicates (that is, no negation is outside a quantifier or
an expression involving logical connectives). Show al the steps in your derivation.

(a) ¬∀x∃yP (x, y)


¬∀x∃yP (x, y) ≡ ∃x∀y¬P (x, y)

(b) ¬∃y(Q(y) ∧ ∀x¬R(x, y))

¬∃y(Q(y) ∧ ∀x¬R(x, y)) ≡ ∀y¬(Q(y) ∧ ∀x¬R(x, y))


≡ ∀y(¬Q(y) ∨ ∃xR(x, y))

(c) ¬∃y(∃xR(x, y) ∨ ∀xS(x, y))

¬∃y(∃xR(x, y) ∨ ∀xS(x, y)) ≡ ∀y¬(∃xR(x, y) ∨ ∀xS(x, y))


≡ ∀y(¬∃xR(x, y) ∧ ¬∀xS(x, y))
≡ ∀y(∀x¬R(x, y) ∧ ∃x¬S(x, y))

4
(d) ¬∃y(∀x∃zT (x, y, z) ∨ ∃x∀zU (x, y, z))
¬∃y(∀x∃zT (x, y, z) ∨ ∃x∀zU (x, y, z)) ≡ ∀y¬(∀x∃zT (x, y, z) ∨ ∃x∀zU (x, y, z))
≡ ∀y(¬∀x∃zT (x, y, z) ∧ ¬∃x∀zU (x, y, z))
≡ ∀y(∃x∀z¬T (x, y, z) ∧ ∀x∃z¬U (x, y, z))

6. (10 points) Prove these logical equivalences, assuming that the domain is nonempty.
You will probably have to use a proof by cases on the two possible values of proposition
∀yQ(y) and ∃yQ(y) respectively. This proof will use word arguments (not symbolic
formula manipulation).
(a) ∀x(∀yQ(y) → P (x)) ≡ ∀yQ(y) → ∀xP (x)

We break into two cases depending on the truth value of ∀xQ(x).


If ∀xQ(x) is true, we have that:
∀x (T → P (x))
≡ ∀x (¬T ∨ P (x)) Table 7
≡ ∀x (F ∨ P (x))
≡ ∀x P (x) domination

T → ∀x P (x)
≡ ¬T ∨ ∀x P (x) Table 7
≡ F ∨ ∀x P (x)
≡ ∀x P (x) domination
Thus, if ∀xQ(x) is true, the statements are equivalent.
If ∀xQ(x) is false, we have that:
∀x (F → P (x))
≡ ∀x (¬F ∨ P (x)) Table 7
≡ ∀x (T ∨ P (x))
≡ ∀x T domination
≡T

F → ∀x P (x)
≡ ¬F ∨ ∀x P (x) Table 7
≡ T ∨ ∀x P (x)
≡T domination
Thus, if ∀xQ(x) is false, both statements are true, and thus equivalent.
As they are equivalent regardless of the value of ∀xQ(x), the two statements are
logically equivalent.

5
(b) ∃x(∃yQ(y) → P (x)) ≡ ∃yQ(y) → ∃xP (x)

We break into two cases depending on the truth value of ∃xQ(x).


If ∃xQ(x) is true, we have that:

∃x (T → P (x))
≡ ∃x (¬T ∨ P (x)) Table 7
≡ ∃x (F ∨ P (x))
≡ ∃x P (x) domination

T → ∃x P (x)
≡ ¬T ∨ ∃x P (x) Table 7
≡ F ∨ ∃x P (x)
≡ ∃x P (x) domination
Thus, if ∃xQ(x) is true, the statements are equivalent.
If ∃xQ(x) is false, we have that:

∃x (F → P (x))
≡ ∃x (¬F ∨ P (x)) Table 7
≡ ∃x (T ∨ P (x))
≡ ∃x T domination
≡T

F → ∃x P (x)
≡ ¬F ∨ ∃x P (x) Table 7
≡ T ∨ ∃x P (x)
≡T domination
Thus, if ∃xQ(x) is false, both statements are true, and thus equivalent.
As they are equivalent regardless of the value of ∃xQ(x), the two statements are
logically equivalent.

7. (10 points) A statement is in prenex normal form (PNF) if and only if all quantifiers
occur at the beginning of the statement (without negations), followed by a predicate
involving no quantifiers. Put the following statement in prenex normal form:
(Hint: your first step should rename one of the two x’s as y; check useful valid equiv-
alences in exercises 48,49 page 62 of 6th edition)

(a) ∃xP (x) ∨ ∃xQ(x) ∨ A, where A is a proposition not involving any quantifiers.

We rewrite the statement ∃xP (x) ∨ ∃yQ(y) ∨ A. Now, by 49(b), we can write
(∃x∃y(P (x) ∨ Q(y)) ∨ A. Since A does not contain either the variable x or y,
we can move it inside the parentheses and write: ∃x∃y(P (x) ∨ Q(y) ∨ A). This

6
statement is in PNF. Note that changing the name of the variable is not necessary,
as ∃xP (x) ∨ ∃xQ(x) ≡ ∃x(P (x) ∨ Q(x)), as per S1.3 exercise 45. Thus, the final
answer could also be ∃x(P (x) ∨ Q(x) ∨ A).

(b) ∃xP (x) → ∃xQ(x)

We first rename the variable on the right hand side as y to get ∃xP (x) → ∃yQ(y).
We rewrite the statement by reinterpreting implication as ¬∃xP (x) ∨ ∃yQ(y)).
Then by moving the negation in front of the predicate P (x) gives us ∀x¬P (x) ∨
∃yQ(y). Now by 49(b), we can rewrite this as ∀x∃y(¬P (x) ∨ Q(y)), which is in
PNF as required.

Rules of Inference

8. (9 points) For each of these arguments, determine whether the argument is correct or
incorrect and explain why.

(a) Everyone born in Ottawa has eaten a beaver tail. Susan has never eaten a beaver
tail. Therefore Susan was not born in Ottawa.

If we let B(x) be the predicate “x was born in Ottawa”, and E(x) be the predicate
“x has eaten a beaver tail”, and the domain be the domain of all people, then
the argument as given is (∀x(B(x) → E(x)) ∧ ¬E(Susan)) → ¬B(Susan). This
is just an application of modus tollens, and thus, the argument is correct.

(b) A convertible car is fun to drive. Joe’s car is not a convertible. Therefore, Joe’s
car is not fun to drive.

Let the domain be the domain of all cars, and let C(x) be the predicate “x is a
convertible” and F (x) be the predicate “x is fun to drive.” Then the argument as
stated is (∀x(C(x) → F (x)) ∧ ¬C(Joe’s car)) → ¬F (Joe’s car). This argument
is not true, and it is the fallacy of denying the antecedent: being a covertible is
a sufficient condition for being fun to drive, but it is not a necessary condition.
Thus, we cannot derive any information about whether or not Joe’s car is fun to
drive from the premises.

(c) Emma likes all fine restaurants. Emma likes the restaurant “Le Cordon Bleu”.
Therefore, “Le Cordon Bleu” is a fine restaurant.

Let the domain be the domain of all restaurants, and let F (x) be the predicate “x
is a fine restaurant” and L(x) be the predicate “Emma likes x.” Then the argu-
ment as stated is (∀x(F (x) → L(x))∧F (Le Cordon Bleu)) → L(Le Cordon Bleu).

7
This argument is not true, and is the fallacy of confirming the consequent: Emma
liking a restaurant is a necessary condition for a restaurant to be a fine restaurant,
but it is not sufficient. Thus, we cannot conclude from the premises whether or
not Le Cordon Bleu is a fine restaurant.

9. (10 points) Give a formal proof, using known rules of inference, to establish the conclu-
sion of the argument (3rd statement) using the first 2 statements as premises, where
the domain of all quantifiers is the same.
Remember that a formal proof is a sequence of steps, each with a reason noted beside
it; each step is either a premise, or is obtained from previous steps using inference
rules.

• premise: ∀x(P (x) ∨ Q(x))


• premise: ∀x((¬P (x) ∧ Q(x)) → R(x))
• conclusion: ∀x(¬R(x) → P (x))

Here is one possible formal proof:


1. ∀x(P (x) ∨ Q(x)) premise
2. ∀x((¬P (x) ∧ Q(x)) → R(x)) premise
3. P (a) ∨ Q(a) for arbitrary a universal instantiation (1)
4. (¬P (a) ∧ Q(a)) → R(a) universal instantiation (2)
5. ¬(¬P (a) ∧ Q(a)) ∨ R(a) logical equivalence (4)
6. (P (a) ∨ ¬Q(a)) ∨ R(a) DeMorgan (5)
7. ¬Q(a) ∨ (P (a) ∨ R(a)) logical equivalence (6)
8. P (a) ∨ (P (a) ∨ R(a)) resolution (3) and (7)
9. P (a) ∨ R(a) idempotency (8)
10. R(a) ∨ P (a) logical equivalence (9)
11. ¬R(a) → P (a) for arbitrary a logical equivalence (10)
12. ∀x(¬R(x) → P (x)) universal generalization (11)

You might also like