0% found this document useful (0 votes)
67 views3 pages

CS 103X: Discrete Structures Homework Assignment 5 - Solutions

The document contains the solutions to homework exercises on discrete structures. Exercise 1 requires formulating statements in English as logical propositions. Exercise 2 requires negating the propositions from Exercise 1. Exercise 3 formulates the Barber Paradox logically. Exercise 4 identifies statements as tautologies, contradictions, or neither. Exercise 5 provides a proof that a given logical statement implies the proposition "¬r".

Uploaded by

Michel Magna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views3 pages

CS 103X: Discrete Structures Homework Assignment 5 - Solutions

The document contains the solutions to homework exercises on discrete structures. Exercise 1 requires formulating statements in English as logical propositions. Exercise 2 requires negating the propositions from Exercise 1. Exercise 3 formulates the Barber Paradox logically. Exercise 4 identifies statements as tautologies, contradictions, or neither. Exercise 5 provides a proof that a given logical statement implies the proposition "¬r".

Uploaded by

Michel Magna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CS 103X: Discrete Structures

Homework Assignment 5 — Solutions

Exercise 1 (25 points). Formulate each of the below as a single statement (proposition or predicate), using only
mathematical and logical notation that has been defined in class. For example, the use of logical quantifiers and
connectives, and arithmetic, number-theoretic, and set-theoretic operations is allowed, as is the use of operators like
gcd or sets like Q, R, etc., but not the use of English-language words or informal shorthand like {1, 2, . . . , n}.

(a) Every integer multiple of 4 can be expressed as the difference of two perfect squares.

(b) Bernoulli’s inequality (see Homework 2) holds.


(c) Two integers are coprime if and only if every integer can be expressed as their linear combination.
(d) The principle of induction.
(e) Goldbach’s conjecture. (“Every even integer greater than 2 can be written as the sum of two primes.” You
should not rely on an externally defined set P of primes.)

Solution

(a) ∀x ∈ Z : (4 | x) → ∃y, z ∈ Z : (x = y 2 − z 2 )

(b) ∀x ∈ R ∀n ∈ N : (x > −1) → ((1 + x)n ≥ 1 + nx)

(c) ∀a, b ∈ Z : gcd(a, b) = 1 ↔ ∀c ∈ Z ∃u, v ∈ Z : c = au + bv

(d) ∀A ⊆ N+ : (1 ∈ A) ∧ (∀k ∈ A : (k ∈ A) → (k + 1 ∈ A)) → (A = N+ )
   
 
(e) ∀n ∈ N : (n > 2)∧(2 | n) → ∃p, q ∈ N+ \{1} : n = p+q ∧ ∀a ∈ N+ \{1} : (a = p ∨ a/| p)∧(a = q ∨ a/| q)

Exercise 2 (25 points). After completing the previous exercise, write the negation of each of your logical statements,
such that the symbol ¬ does not appear in your statements. (That is, eliminate negated quantifiers and negated
compounds as you have learned in class, and then replace statements such as ¬(a | b) by statements like a/| b.) Read
the negations out in natural language and check for yourself that you understand why these are the right negations
for the statements in the previous exercise.

Solution
(a) We’ll work this one out from scratch. Notice how we move the negation symbol progressively further into the
expression, changing quantifiers as we go:

¬(∀x ∈ Z : (4 | x → ∃y, z ∈ Z : (x = y 2 − z 2 ))) ⇔


∃x ∈ Z : ¬(4 | x → ∃y, z ∈ Z : (x = y 2 − z 2 )) ⇔
∃x ∈ Z : (4 | x ∧ ¬(∃y, z ∈ Z : (x = y 2 − z 2 ))) ⇔
∃x ∈ Z : (4 | x ∧ (∀y, z ∈ Z : ¬(x = y 2 − z 2 ))) ⇔
∃x ∈ Z : (4 | x ∧ (∀y, z ∈ Z : x 6= y 2 − z 2 ))

This of course says that there is some integer x which is a multiple of 4 yet is not the difference of any two
perfect squares, which is precisely what we want.
(b) ∃x ∈ R∃n ∈ N : ((x > −1) ∧ ((1 + x)n < 1 + nx))
(c) ∃a, b ∈ Z : (gcd(a, b) 6= 1 ↔ ∀c ∈ Z, ∃u, v ∈ Z : c = au + bv) (The negation of a ↔ b can be either of the
equivalent statements ¬a ↔ b and a ↔ ¬b. We avoid a lot of manipulations by using the first statement.)

1
  
(d) ∃A ⊆ N+ : 1 ∈ A ∧ ∀k ∈ A : (k ∈ A) → (k + 1 ∈ A) ∧ A 6= N+
   
+
 +

(e) ∃n ∈ N : (n > 2) ∧ (2 | n) ∧ ∀p, q ∈ N \ {1} : n 6= p + q ∨ ∃a ∈ N \ {1} : (a 6= p ∧ a | p) ∨ (a 6= q ∧ a | q)

Exercise 3 (10 points). Let’s formulate the famous “Barber of Seville” paradox in the notation of first-order logic
(i.e. the sort of logic described in the lecture notes). In English, the paradox may be stated as:

“The barber of Seville shaves precisely those residents of Seville who do not shave themselves.”
(Convince yourself that this is indeed a paradox.) Assume S is the set of all residents of Seville, which includes the
barber. We have the following predicates over elements of the set S:
• Shaves(x, y): true if x shaves y, false otherwise.

• Barber(x): true if x is the barber of Seville (you may assume that Seville has just one barber), false otherwise.
Rewrite the statement of the paradox using only these predicates, along with the notation of mathematical logic.

Solution The given statement doesn’t look very easy to translate directly into logical formalism, so let’s rephrase
it in a more logic-friendly form:
“The Barber of Seville shaves every resident of Seville if and only if the latter does not shave himself.”
(We will prudently assume that Seville has only male residents.) This seems easier to translate. Here’s a first
attempt: 
∀x ∈ S : Shaves(Barber-of-Seville, x) ↔ ¬Shaves(x, x)
But what is this mysterious “Barber-of-Seville” object? We have no constants like this given to us, so we must think
of a clever way to introduce the barber. We rephrase the statement again:
“There is a barber of Seville, and he shaves every resident of Seville if and only if the latter does not
shave himself.”
This can be translated as:
 

∃y ∈ S : Barber(y) ∧ ∀x ∈ S : Shaves(y, x) ↔ ¬Shaves(x, x)

Notice how the existential quantifier and the Barber predicate are used to identify the barber (the universal quantifier
and an → instead of the ∧ are not appropriate here — why?). The paradox occurs, of course, because we allow
x = y, in which case we have Shaves(y, y) ↔ ¬Shaves(y, y), which is patently false, so the condition on y can never
be satisfied and this contradicts the existence of such a y. Note that the Barber(y) term is actually completely
unnecessary for the paradox itself.

Exercise 4 (20 points). Assuming P , Q and R are logical propositions, which of the following statements are
tautologies, which are contradictions, and which are neither? No proof is necessary, but for every statement that you
think is neither a tautology nor a contradiction you should provide one set of truth assignments to its variables that
makes it true, and another set that makes it false.
(a) (P ∨ Q) → (P ∧ Q)
(b) (P ∨ ¬Q) ∧ (¬P ∧ Q)

(c) ((P ∨ Q) ∧ R) ↔ ((P ∧ R) ∨ (Q ∧ R))


(d) (P ↔ Q) ∧ (Q ↔ R) ∧ ¬(P ↔ R)

2
Solution
(a) Neither. If P and Q are both true, both sides are true and the implication holds. If P is true and Q false, the
left side is true and the right side false, then the implication fails.
(b) Contradiction. (¬P ∧ Q) holds only when P is false and Q true. With these values, (P ∨ ¬Q) is false, so there
are no values of P and Q that satisfy the whole statement.
(c) Tautology. For the left side to hold, at least one of P or Q is true and R must be true. For the right side,
either (P ∧ R) or (Q ∧ R) must hold; in either case R must be true and then at least one of P or Q must be
true. Thus both sides will always have the same truth value and the bidirectional implication holds.
(d) Contradiction. For (P ↔ Q) to hold P and Q must have the same truth values. Thus the statement implies
that P and Q have the same value, and Q and R have the same value (together these mean P and R have the
same truth value), while the last part of the conjunction means that P and R have different truth values. Thus
no values of P , Q, R will satisfy the statement.

Exercise 5 (20 points). You are given the following (all letters are logical propositions):

(t → (r ∨ p)) → ((¬r ∨ k) ∧ ¬k).

Prove that this implies ¬r. Write down a proof using inference rules like we did in class. Manufacture inference rules
from tautologies as needed.

Solution We proceed as follows:

(t → (r ∨ p)) → ((¬r ∨ k) ∧ ¬k) ⇔


¬(t → (r ∨ p)) ∨ ((¬r ∨ k) ∧ ¬k) ⇔
¬(t → (r ∨ p)) ∨ ((¬r ∧ ¬k) ∨ (k ∧ ¬k)) ⇔
¬(t → (r ∨ p)) ∨ ((¬r ∧ ¬k) ∨ F) ⇔
¬(t → (r ∨ p)) ∨ (¬r ∧ ¬k) ⇔
(t ∧ ¬(r ∨ p)) ∨ (¬r ∧ ¬k) ⇔
(t ∧ (¬r ∧ ¬p)) ∨ (¬r ∧ ¬k) ⇔
(t ∧ (¬p ∧ ¬r)) ∨ (¬r ∧ ¬k) ⇔
((t ∧ ¬p) ∧ ¬r) ∨ (¬r ∧ ¬k) ⇔
((t ∧ ¬p) ∧ ¬r) ∨ (¬k ∧ ¬r) ⇔
((t ∧ ¬p) ∨ ¬k) ∧ ¬r ⇒
¬r

The inference rules we use are, in order:

a→b ⇔ ¬a ∨ b
(a ∨ b) ∧ c ⇔ (a ∧ c) ∨ (b ∧ c)
a ∧ ¬a ⇔ F
a∨F ⇔ a
¬(a → b) ⇔ a ∧ ¬b
¬(a ∨ b) ⇔ ¬a ∧ ¬b
a∧b ⇔ b∧a
a ∧ (b ∧ c) ⇔ (a ∧ b) ∧ c
a∧b ⇔ b∧a
(a ∨ b) ∧ c ⇔ (a ∧ c) ∨ (b ∧ c)
a∧b ⇒ b

These should all be familiar to you.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy