chapter 1 - foundations · 2016. 8. 31. · chapter 1 - foundations introduction suppose that:...

29
Chapter 1 - Foundations Introduction Suppose that: 1. Babies are illogical. 2. Nobody is despised who can manage a crocodile. 3. Illogical persons are despised. What conclusion may be reached using all of these premises? 1 Which is better, eternal happiness or a ham sandwich? It would appear that eternal happiness is better, but this is really not so! After all, nothing is better than eternal happiness, and a ham sandwich is certainly better than nothing. Therefore a ham sandwich is better than eternal happiness. 2 And one of my favorite Lewis Carroll quotes: . . . “Seven years and six months!” Humpty Dumpty repeated thoughtfully. “An uncomfortable sort of age. Now if you’d asked my advice, I’d have said ‘Leave off at seven’ but it’s too late now.” “I never ask advice about growing,” Alice said indignantly. “Too proud?” the other enquired. Alice felt even more indignant at this suggestion. “I mean,” she said, “that one can’t help growing older.” One can’t, perhaps,” said Humpty Dumpty; “but two can. With proper assistance, you might have left off at seven.” 1.1 - Propositional Logic Definitions and Notation Logic Proposition Notation Negation 1 Taken from Lewis Carroll 2 Raymond Smullyan 1

Upload: others

Post on 31-Mar-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Chapter 1 - Foundations

Introduction

Suppose that:

1. Babies are illogical.

2. Nobody is despised who can manage a crocodile.

3. Illogical persons are despised.

What conclusion may be reached using all of these premises?1

Which is better, eternal happiness or a ham sandwich? It would appear that eternal happiness is better,but this is really not so! After all, nothing is better than eternal happiness, and a ham sandwich is certainlybetter than nothing. Therefore a ham sandwich is better than eternal happiness.2

And one of my favorite Lewis Carroll quotes:

. . . “Seven years and six months!” Humpty Dumpty repeated thoughtfully. “An uncomfortable sort of age.Now if you’d asked my advice, I’d have said ‘Leave off at seven’ but it’s too late now.”

“I never ask advice about growing,” Alice said indignantly.

“Too proud?” the other enquired.

Alice felt even more indignant at this suggestion. “I mean,” she said, “that one can’t help growing older.”

“One can’t, perhaps,” said Humpty Dumpty; “but two can. With proper assistance, you might have leftoff at seven.”

1.1 - Propositional Logic

Definitions and Notation

• Logic

• Proposition

• Notation

• Negation

1Taken from Lewis Carroll2Raymond Smullyan

1

Page 2: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Truth Tables

p q ¬p ¬q

Conjunction and Disjunction

Conjunction of p and q:

p q p ∧ q

T T

T F

F T

F F

Disjunction of p and q:

p q p ∨ q

T T

T F

F T

F F

Other Definitions

• Exclusive Or (notation: ⊕)

• Implication / Conditional (notation: → or =⇒ )

• Biconditional (notation: ↔ or ⇐⇒ )

p q p⊕ q p→ q p↔ q

T T

T F

F T

F F

2

Page 3: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Other Operations on Implications

• Converse

• Contrapositive

• Inverse

Precedence

Operator Precedence

() 0

¬ 1

∧ 2

∨ 3

→ 4

↔ 5

We will follow the book’s convention and [almost] always use parentheses to group operators in order to avoid confusion.One exception to this is when negating a proposition, e.g., ¬p ∧ q is equivalent to (¬p) ∧ q, as opposed to ¬(p ∧ q)

Compound Propositions in Truth Tables

Example 1.

p q ¬p p→ q ¬p ∧ q (p→ q) ∨ (¬p ∧ q)

T T

T F

F T

F F

3

Page 4: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Logic and Bit Operators

1.2 - Applications of Propositional Logic

Example 2. Suppose that:

1. Babies are illogical.

2. Nobody is despised who can manage a crocodile.

3. Illogical persons are despised.

What conclusion may be reached using all of these premises?

1.3 - Propositional Equivalences

Definitions

• Compound Proposition

• Tautology

• Contradiction

• Contingency

4

Page 5: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Logical Equivalence

Definition 1.

Notation: ≡

Truth tables can be used to show that compound propositions are logically equivalent.

Example 3. Show that p ≡ p ∨ (p ∧ q):

p q p ∧ q p ∨ (p ∧ q)

T T

T F

F T

F F

A Larger Example. . .

Show that (p→ q) ∧ (p→ r) ≡ p→ (q ∧ r):

p q r p→ q p→ r (p→ q) ∧ (p→ r) q ∧ r p→ (q ∧ r)

T T T

T T F

T F T

T F F

F T T

F T F

F F T

F F F

5

Page 6: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Table of Logical Equivalences

(The abbreviations are not universal, but you may use them in your homework or on tests if you wish.)

Equivalence Name Abbr.

p ∧ T ≡ p Identity / Idempotent(Conjunction)

IdC

p ∨ F ≡ p Identity / Idempotent(Disjunction)

IdD

p ∧ F ≡ F Domination (Conjunction) DomC

p ∨ T ≡ T Domination (Disjunction) DomD

¬(¬p) ≡ p Double Negation DN

p ∧ q ≡ q ∧ p Commutative (Conjunction) CC

p ∨ q ≡ q ∨ p Commutative (Disjunction) CD

(p ∧ q) ∧ r ≡ p ∧ (q ∧ r) Associative (Conjunction) AC

(p ∨ q) ∨ r ≡ p ∨ (q ∨ r) Associative (Disjunction) AD

p ∧ (q ∨ r) ≡ (p ∧ q) ∨ (p ∧ r) Distributive (Conjunction) DC

p ∨ (q ∧ r) ≡ (p ∨ q) ∧ (p ∨ r) Distributive (Disjunction) DD

¬(p ∧ q) ≡ ¬p ∨ ¬q DeMorgan’s Law(Conjunction)

DMC

¬(p ∨ q) ≡ ¬p ∧ ¬q DeMorgan’s Law(Disjunction)

DMD

p ∧ (p ∨ q) ≡ p Absorption (Conjunction) AbC

p ∨ (p ∧ q) ≡ p Absorption (Disjunction) AbD

p ∧ ¬p ≡ F Negation (Conjunction)

p ∨ ¬p ≡ T Negation (Disjunction)

Table 1: Table of Logical Equivalences

6

Page 7: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Equivalence Name Abbr

¬(p→ q) ≡ p ∧ ¬q Negation of Implication NI

p→ q ≡ ¬p ∨ q Implication to Disjunction ID

p→ q ≡ ¬q → ¬p Contrapositive C

p ∨ q ≡ ¬p→ q

p ∧ q ≡ ¬(p→ ¬q)

(p→ q) ∧ (p→ r) ≡ p→ (q ∧ r)

(p→ r) ∧ (q → r) ≡ (p ∨ q)→ r

(p→ q) ∨ (p→ r) ≡ p→ (q ∨ r)

(p→ r) ∨ (q → r) ≡ (p ∧ q)→ r

Table 2: Logical Equivalences Involving Implications

Equivalence Name Abbr.

¬(p↔ q) ≡ ¬p↔ q Negation of Biconditional NB

¬(p↔ q) ≡ p↔ ¬q Negation of Biconditional(alternative)

NB

p↔ q ≡ (p→ q) ∧ (q → p) Biconditional B

p↔ q ≡ ¬p↔ ¬q

p↔ q ≡ (p ∧ q) ∨ (¬p ∧ ¬q)

Table 3: Logical Equivalences Involving Biconditionals

Additional Tautologies

(Remember, ‘tautology’ these will always be true for any values of p, q, r, and s.)

Tautology Name Abbr.

p ∨ ¬p Excluded Middle EM

(p ∧ q)→ p Simplification S

p→ (p ∨ q) Addition A

[p ∧ (p→ q)]→ q Modus Ponens MP

[(p→ q) ∧ (q → r)]→ (p→ r) Hypothetical Syllogism HS

[(p ∨ q) ∧ ¬q]→ p Disjunctive Syllogism DS

[¬q ∧ (p→ q)]→ ¬p Modus Tollens MT

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

Constructive Dilemma CDL

[(¬q ∨ ¬s) ∧ [(p→ q) ∧ (r → s)]]→ (¬p ∨ ¬r)

Destructive Dilemma DDL

(p ∨ p)→ p Idempotent IM

Table 4: Additional Tautologies

7

Page 8: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

De Morgan’s Laws

Example 4. Suppose there is an island populated solely by knights and knaves, and that knights always tell the truthbut knaves always lie. While on this island, we encounter two people, A and B. A says “I am a knave or B is a knight”,while B says nothing. Determine, if possible, what A and B are.

Arguments Using Logical Equivalence

Example 5. Prove that ¬(p→ q)→ ¬q is a tautology.

Example 6. Use equivalences from the tables to prove that (p→ q)∧ (p→ r) and p→ (q ∧ r) are logically equivalent.

8

Page 9: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Practicality of Using Tables

How many rows does a truth table need for a compound proposition containing 2 variables? 3 variables? 5 variable?100 variables? in general?

Propositional Satisfiability

Definition 2.

1.4 - Predicates and Quantifiers

Introduciton

Is “x > 3” a proposition?

Definition 3 (Predicates (or ‘Propositional Functions’)).

9

Page 10: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Note that if x has no meaning, then P (x) is just a form.

Definition 4 (Domain of Discourse). The domain of discourse (or the universe of discourse or simply domain) of xis. . .

There are two ways to give meaning to a predicate P (x):

1.

2.

The Universal Quantifier

Definition 5. The universal quantification of the predicate P (x) is the statement . . .

In symbols,

Note:

Example 7. (Let the domain of discourse be all real numbers.)

10

Page 11: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

The Existential Quantifier

Definition 6. The existential quantification of the predicate P (x) is the statement . . .

In symbols,

Note:

Example 8. (Let the domain of discourse be all Grove City students and faculty.)

Definition 7 (Free and Bound variables).

Definition 8 (Scope).

11

Page 12: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Quantifiers with Conjunction and Disjunction

Negating Quantified Expressions

Translating Into English

Example 9. Let P (x) be the statement “x likes to fly kites”, Q(x, y) be the statement “x knows y”, and L(x, y) thestatement “x likes y”. Translate the following logical expressions into conversational English statements:

1. ∀x (Q(Amy, x)→ P (x))

2. ∀x (L(Alice, x)→ ¬L(x,Bob))

Translating From English

Example 10. Translate the following statements into logical expressions. Be sure to state the domain of discourse.

1. “All cats are gray.”

2. “There are pigs which can fly.”

12

Page 13: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

1.5 - Nested Quantifiers

Example 11.

1. ∀x (x 6= 0→ ∃y(xy = 1))

2. ∀x∀y(x + y = y)

Note: The order of quantification matters!

Example 12. Let M(x, y) = “x is y’s mother”. Translate the following into English:

• ∀y∃xM(x, y)

• ∃x∀yM(x, y)

Example 13. Translated each of the following in to English, where M is as in the previous example and S(x) =“x is a student”.

1. ∀y (S(y)→ ∃xM(x, y))

2. ∀y∃x (S(y) ∧M(x, y))

13

Page 14: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Example 14. Let L(x, y) = “x loves3 y” and S as in the previous example. Translate the following into logicalexpressions:

1. Everybody loves somebody.

2. There are people who love everybody.

3. All students love each other.

Negating Nested Quantifiers

Example 15. ¬(∀x∃y xy = 1)

We move the negation through each level of quantification, using De Morgan’s rules for quantifiers at each step:

Example 16. Let I(x) = “x has an internet connection”, F (x, y) = “x and y have Facebook messaged”, and thedomain be students in this class. Translate the following into logical expressions:

1. Someone in your class has an internet connection but has not Facebook messaged anyone else in the class.

2. There are two students in the class who, between them, have messaged everyone else in the class.

3In a 1 John 4 sort of way.

14

Page 15: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Example 17. Let C(x, y) = “student x is enrolled in class y” and the domain of x be GCC students. Translate thefollowing into English sentences:

1. ¬ (∃x∀y C(x, y))

2. ∃x∃y∀z ((x 6= y) ∧ (C(x, z)↔ C(y, z)))

1.6 - Rules of Inference

Definitions

• Argument

• Conclusion

• Premises

• Valid [Argument]

• Fallacy

15

Page 16: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Standard Rules of Inference

Each of the following is based on a tautology.

• Modus Ponenspp→ q

∴ q

• Modus Tollens¬qp→ q

∴ ¬p

• Hypothetical Syllogismp→ qq → r

∴ p→ r

• Disjunctive Syllogismp ∨ q¬p

∴ q

• Additionp

∴ p ∨ q

• Simplificationp ∧ q

∴ p

• Conjunctionpq

∴ p ∧ q

• Resolutionp ∨ q¬p ∨ r

∴ q ∨ r

Example 18. Identify the rules of inference used in each of the following arguments.

1. Alice is a math major. Therefore, Alice is either a math major or a c.s. major.

2. If it snows today, the college will close. The college is not closed today. Therefore it did not snow today.

3. If I go swimming, then I will stay in the sun too long. If I stay in the sun too long, then I will sunburn. Therefore,if I go swimming, then I will get sunburn.

16

Page 17: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Example 19. Use rule of inference to show that the premises “Henry works hard”, “If Henry works hard then he is adull boy”, and “If Henry is a dull boy then he will not get the job” imply the conclusion “Henry will not get the job.”

Standard Rules of Inference

Each of the following is based on a tautology.

• Universal Instantiation∀xP (x)

∴ P (c) for any fixed c

• Universal GeneralizationP (c) for an arbitrary c

∴ ∀xP (x)

• Existential Instantiation∃xP (x)

∴ P (c) for some c

• Existential GeneralizationP (c) for some c

∴ ∃xP (x)

• Universal Modus Ponens∀x (P (x)→ Q(x))P (c)

∴ Q(c)

• Universal Modus Tollens∀x (P (x)→ Q(x))¬Q(c)

∴ ¬P (c)

Example 20. What can you conclude about Henry, Jack, and Jill, given the following premises?

1. Every c.s. major has an iPad.

2. Henry does not have an iPad.

3. Jill has an iPad.

4. Jack is a c.s. major.

17

Page 18: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Fallacies

• Affirming the Conclusionp→ qq

∴ p

• Denying the Hypothesisp→ q¬p

∴ ¬q

• Begging the Questionp

∴ p

Valid or Fallacy?

Do the following represent valid arguments, or fallacies?

1. All students in this class understand logic. Pascal is a student in this class. Therefore, Pascal understands logic.(Let P (x) = “x is in this class” and Q(x) = “x understands logic”.)

2. Every c.s. major takes discrete mathematics. Esther is taking discrete mathematics. Therefore, Esther is a c.s.major. (Let P (x) = “x is a c.s. major” and Q(x) = “x takes discrete”.)

3. All parrots like fruit. My pet bird is not a parrot. Therefore, my pet bird does not like fruit. (Let P (x) =“x is a parrot” and Q(x) = “x like fruit”.)

4. Everyone who eats granola every day is healthy. John is not healthy. Therefore John does not eat granola everyday. (Let P (x) = “x eats granola every day” and Q(x) = “x is healthy”.)

18

Page 19: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

1.7 - Introduction to Proofs

Terms that arise in Formal Proofs

• Proof

• Undefined Term

• Theorem

• Proposition

• Lemma

• Corollary

• Conjecture

• Axiom / Postulate

Quantifiers

When no quantifier is given, then a universal quantification is assumed.

Example 21. If xy > 0, then either x and y are both positive or x and y are both negative.

19

Page 20: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Basic Facts/Definitions/Postulates

• An integer n is even iff there exists an integer k such that n = 2k.

• An integer n is odd iff there exists an integer k such that n = 2k + 1.

• An integer a is a perfect square iff there exists an integer b such that a = b2.

• For a and b are integers such that a 6= 0, we say that a divides b iff there exists an integer c such that b = ac.

• A real number r is rational iff there exists integers p and q with q 6= 0 such that r = pq . A real number is irrational

if it is not rational.

Methods of Proving Theorems

Definition 9 (Direct Proof). To prove a statement of the form p→ q using a direct proof, we assume that p (the “if”)is true and then show by a direct argument (which may take many steps) that q (the “then”) must also be true. Thisis the most common form of proof, and we’ll almost always start by trying this approach.

Example 22. Prove the statement: “If a person likes math, then he is cool.”

Example 23.

Proposition 1. If n is a perfect square then n is either odd or divisible by 4.

Proof.

Q.E.D.

20

Page 21: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Methods of Proving Theorems

Definition 10 (Proof by Contraposition). A proof by contraposition is an indirect proof in which we prove thecontrapositive of the original statement, i.e., we prove that ¬q → ¬p (recall that the contrapositive has the same truthvalues as the original implication).

Example 24. Prove the statement: “If a person likes math, then he is cool.”

Example 25.

Proposition 2. If n and m are integers and mn is even, then either m or n must be even.

Proof.

Q.E.D.

21

Page 22: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Proving a Biconditional Statement

To prove a statement of the form p↔ q we prove both

• p→ q and

• q → p

Example 26. Prove the statement: “A person likes math if and only if he is cool.”

Proving Multiple Equivalences

To prove that three or more statements are equivalent (all connected with “if and only if”s), it is enough to show that achain of “if. . . then. . . ” statements are true, as long as we can get from any statement to any other statement throughthe chain.

Example 27. Prove that the following are equivalent [shorthand abbr. “TFAE”; might also see “TAE” for “these areequivalent”] for any a, b ∈ R:

1. a < b

2.a + b

2> a

3.a + b

2< b

22

Page 23: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Other Methods of Proof

Proof by Contradiction Assume the opposite of what you want to show and then show that this leads to a contra-diction. Can be useful, but usually does not yield a very ‘enlightening’ proof. As far as it is practical, try to avoidproof by contradiction.

Vacuous Proof Show that p→ q is true by showing that p is false.

Trivial Proof Show that p→ q is true by showing that q is true (without using p).

Example 28.

Proposition 3. The product of a non-zero rational number and an irrational number is irrational.

Proof.

Q.E.D.

23

Page 24: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Finding Mistakes in Proofs

1. a = b Given.2. a2 = ab Multiply both sides by a.3. a2 − b2 = ab− b2 Subtract b2 from both sides.4. (a− b)(a + b) = b(a− b) Factor.5. a + b = b Cancel a− b on both sides.6. 2b = b Substitute a for b since a = b.7. 2 = 1 Divide both sides by b.

Where is the mistake in this proof?

Other Errors in Proofs

Begging the Question This occurs when the part of the proof is based on the truth of the statement being proved(we saw this in the previous section).

Circular Reasoning Occurs when you use a statement to prove itself.

1.8 - Proof Methods and Strategy

Proof Methods

Proof by Cases Logically, it has a form similar to:

p ∨ q ∨ rp→ sq → sr → s

∴ s

We can use this method when there are finitely many possibilities and show that each possible case leads to thedesired result.

Exhaustive Proof Similar to a proof by cases. Generally used when looking at a relatively small number of exampleswill exhaust all possibilities.

24

Page 25: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Something so important it gets its own subsubsection.

Note Neither a Proof by Cases nor an Exhaustive Proof will constitute a valid proof unless all cases or possibilitieshave been examined! “Proof by M&Ms” (a.k.a., “Proof by doing a couple of examples”) is not a valid form of proof!

Example 29.

Theorem 1 (Triangle Inequality). For any two real numbers x and y, |x + y| ≤ |x|+ |y|.

Proof.

Q.E.D.

Existence Proofs

A proof of a proposition of the form ∃xP (x) is called an existence proof. There are two types of existence proofs:

1. Constructive:

2. Nonconstructive:

Example 30 (Constructive Example). Show that there is a positive integer that can be written as the sum of cubesin two different ways.

Example 31 (Nonconstructive Example). Show that there exists two irrational numbers x and y such that xy isrational.

25

Page 26: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Uniqueness

Definition 11 (The Uniqueness Quantifier). ∃!xP (x) means

Example 32. ∀y ∈ R (y 6= 0→ ∃!x(xy = 1))

Counterexamples

To show that ∀xP (x) is false it is sufficient to find one value of x for which P (x) is false.

Example 33. Every positive integer is the sum of three squares.

26

Page 27: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Open Problems

Example 34 (The 3x + 1 Conjecture). Starting with any positive integer and repeatedly applying the transformationwhereby an even integer gets divided by 2, and an odd integer gets multiplied by 3 and incremented by 1, we willultimately generate the integer 1.

Example 35 (Goldbach’s Conjecture). Every positive even integer n ≥ 4 can be written as the sum of two primenumbers.

27

Page 28: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

Additional Logic Puzzles

1. Use all of the following premises to reach a conclusion:

• The only books in this library, that I do not recommend for reading, are unhealthy in tone.

• The bound books are all well written.

• All the romances are healthy in tone.

• I do not recommend you to read any of the unbound books.

2. 4Use all of the following premises to reach a conclusion:

• All my sons are slim.

• No child of mine is healthy who takes no exercise.

• All gluttons, who are children of mine, are fat.

• No daughter of mine takes any exercise.

3. Let us assume that there are five houses of different colors next to each other on the same road. In each houselives a man of a different nationality. Every man has his favorite drink, his favorite brand of cigarettes, and keepspets of a particular kind.

• The Englishman lives in the red house.

• The Swede keeps dogs.

• The Dane drinks tea.

• The green house is just to the left of the white one.

• The owner of the green house drinks coffee.

• The Pall Mall smoker keeps birds.

• The owner of the yellow house smokes Dunhills.

• The man in the center house drinks milk.

• The Norwegian lives in the first house.

• The Blend smoker has a neighbor who keeps cats.

• The man who smokes Blue Masters drinks bier.

• The man who keeps horses lives next to the Dunhill smoker.

• The German smokes Prince.

• The Norwegian lives next to the blue house.

• The Blend smoker has a neighbor who drinks water.

Who keeps fish as his pet?5

4Puzzles 1 and 2 are attributed to Lewis Carroll5Commonly attributed to Albert Einstein.

28

Page 29: Chapter 1 - Foundations · 2016. 8. 31. · Chapter 1 - Foundations Introduction Suppose that: 1.Babies are illogical. 2.Nobody is despised who can manage a crocodile. 3.Illogical

4. The Lady or the Tiger.6 A certain king likes to entertain himself by making his prisoners play a game todecide their fate. The prisoners are presented with two doors. In a room behind each door is either a lady whomthe prisoner may marry, or a tiger whom may eat the prisoner. A clue is written on each door and the prisonerdecides which door to open based on these clues. The clues provided to three prisoners brought before the kingare below. Try to figure out which door each prisoner should open.

Prisoner 1 is told that exactly one of the following clues is true and exactly one is false.

Door 1: There is a lady behind this door and a tiger behind the other.

Door 2: There is a lady behind one of the doors and a tiger behind the other.

Prisoner 2 is told that either both clues are true or both are false.

Door 1: Either there is a tiger behind this door or a lady behind the second door.

Door 2: There is a lady behind this door.

Prisoner 3 receives directions which are a bit tricker since the first two escaped. This prisoner is told that if alady is behind door 1 then the clue on door 1 is true, but if a tiger is behind door 1 then the clue on that dooris false. Door 2 follows the opposite rule: if a lady is behind door 2 the clue on door 2 is false, but if a tiger isbehind door 2 the clue on that door is true.

Door 1: A lady is waiting behind at least one of the doors.

Door 2: A lady is waiting behind the other door.

6Commonly attributed to Raymond Smullyan.

29