Lecture Notes in Discrete Mathematics

             Marcel B. Finan
         Arkansas Tech University
           c All Rig...
2
Preface

This book is designed for a one semester course in discrete mathematics
for sophomore or junior level students. T...
4   PREFACE
Contents

Preface                                                                                                3

Fundam...
6                                                                                  CONTENTS

    20   Functions: Definition...
Fundamentals of Mathematical
Logic

Logic is commonly known as the science of reasoning. The emphasis here
will be on logi...
8                       FUNDAMENTALS OF MATHEMATICAL LOGIC

1 Propositions and Related Concepts
A proposition is any meani...
1 PROPOSITIONS AND RELATED CONCEPTS                                         9

d. Not a proposition

New propositions call...
10                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
The conjunction of the propositions p and q is the ...
1 PROPOSITIONS AND RELATED CONCEPTS                                      11

                       p   q      r     p⊕q  ...
12                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Example 1.7
Find the negation of the proposition p : −5 < x ≤ ...
1 PROPOSITIONS AND RELATED CONCEPTS                                           13

Solution.
a.
              p    q   ∼p  ...
14                             FUNDAMENTALS OF MATHEMATICAL LOGIC

b.


             p       q    r    p∨q    q∨r   (p ∨ q...
1 PROPOSITIONS AND RELATED CONCEPTS                                      15

    p   q    r   p∨q   p∧r      q∧r    (p ∨ q...
16                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 1.1
Indicate which of the following se...
1 PROPOSITIONS AND RELATED CONCEPTS                                        17

Problem 1.9
Use De Morgan’s laws to write t...
18                        FUNDAMENTALS OF MATHEMATICAL LOGIC

2 Conditional and Biconditional Propositions
Let p and q be ...
2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS                              19

Example 2.3
Use the if-then form to rewrite ...
20                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
We use De Morgan’s laws as follows.
               ...
2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS                               21

The biconditional proposition of p and q, d...
22                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 2.1
Rewrite the following proposition...
2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS                              23

Problem 2.9
Use the contrapositive to rewrit...
24                      FUNDAMENTALS OF MATHEMATICAL LOGIC

3 Rules of Inferential Logic
The main concern of logic is how ...
3 RULES OF INFERENTIAL LOGIC                                             25

conclusion may be either true or false. When ...
26                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
a. The truth table is as follows.

                 ...
3 RULES OF INFERENTIAL LOGIC                                            27

Solution.
The truth table is as follows.
     ...
28                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
a. The truth table is as follows.
                  ...
3 RULES OF INFERENTIAL LOGIC                                            29

is valid.
b. Show that the argument
          ...
30                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Example 3.12 (Rule of contradiction)
Show that if c is a contr...
3 RULES OF INFERENTIAL LOGIC                                           31

Review Problems
Problem 3.1
Use modus ponens or...
32                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 3.6
Use symbols to write the logical form of the give...
4 PROPOSITIONS AND QUANTIFIERS                                              33

4 Propositions and Quantifiers
Statements s...
34                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Example 4.3
Let D = IR. Consider the two predicates P (x) : −...
4 PROPOSITIONS AND QUANTIFIERS                                            35

Example 4.6
Let P (x) denote the statement ”...
36                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Solution.
a. ∀x ∈ D, if ∼ Q(x) then ∼ P (x).
b. ∀x ∈ D, if Q(x...
4 PROPOSITIONS AND QUANTIFIERS                                        37

Solution.
a. ∃x∀y, ∼ P (x, y).
b. ∀x∃y, ∼ P (x, ...
38                       FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 4.1
By finding a counterexample, show ...
4 PROPOSITIONS AND QUANTIFIERS                                               39

Problem 4.6
Which of the following is a n...
40                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 4.12
Given the proposition: ∀x ∈ IR, ∃ a real number y...
5 ARGUMENTS WITH QUANTIFIED PREMISES                                       41

5 Arguments with Quantified Premises
In this...
42                      FUNDAMENTALS OF MATHEMATICAL LOGIC

0 = 2.0
..0 is even
 ˙

• Universal Modus Tollens:
           ...
5 ARGUMENTS WITH QUANTIFIED PREMISES                              43


• The rule of inverse error:
                      ...
44                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Review Problems
Problem 5.1
Use the rule of universal modus po...
6 PROJECT I: DIGITAL LOGIC DESIGN                                             45

6 Project I: Digital Logic Design
In thi...
46                      FUNDAMENTALS OF MATHEMATICAL LOGIC




Problem 6.1
Construct the truth tables of the gates discuss...
6 PROJECT I: DIGITAL LOGIC DESIGN                                          47

Problem 6.4
Find the Boolean expression tha...
48                     FUNDAMENTALS OF MATHEMATICAL LOGIC




Let P and Q be single binary digits and P + Q = RS. Complete...
6 PROJECT I: DIGITAL LOGIC DESIGN                                     49

Problem 6.9
Express the numbers 104 and −104 in ...
50                          FUNDAMENTALS OF MATHEMATICAL LOGIC

7 Project II: Number Systems
In this section we consider t...
7 PROJECT II: NUMBER SYSTEMS                                                51

To convert a positive integer n from base ...
52                      FUNDAMENTALS OF MATHEMATICAL LOGIC

Problem 7.5
Convert the number B53DF 816 to base 2.

To conver...
Fundamentals of Mathematical
Proofs

In this chapter we discuss some common methods of proof and the standard
terminology ...
54                    FUNDAMENTALS OF MATHEMATICAL PROOFS

First we discuss methods for proving a theorem of the form ”∃x ...
8 METHODS OF DIRECT PROOF I                                                 55

then P (n)” where P (n) = n2 − n + 11. Usi...
56                     FUNDAMENTALS OF MATHEMATICAL PROOFS

Solution.
                                                    ...
8 METHODS OF DIRECT PROOF I                                            57

conclusion.

• Begging the question. By that we...
58                    FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
A real number r is called rational if there exi...
9 MORE METHODS OF PROOF                                                     59

9 More Methods of Proof
A vacuous proof is...
60                    FUNDAMENTALS OF MATHEMATICAL PROOFS

Example 9.4
Use the proof by cases to prove the triangle inequa...
9 MORE METHODS OF PROOF                                                 61

Proof.
Let n be any integer. Then we consider ...
62                     FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 9.1
Prove that for any integer n the p...
9 MORE METHODS OF PROOF                                                 63

It remains to show that 0 ≤ r < d. By the defin...
64                    FUNDAMENTALS OF MATHEMATICAL PROOFS

10 Methods of Indirect Proofs: Contradiction
and Contraposition...
10 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION65

Proof.
Suppose not. That is, suppose that the set of pr...
66                    FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 10.1
Use the proof by contradiction to ...
11 METHOD OF PROOF BY INDUCTION                                                 67

11 Method of Proof by Induction
With t...
68                    FUNDAMENTALS OF MATHEMATICAL PROOFS

                                                               ...
11 METHOD OF PROOF BY INDUCTION                                                69


(i) (Basis of induction) S(1) = a = 1 ...
70                    FUNDAMENTALS OF MATHEMATICAL PROOFS

n ≥ 0. By the method of mathematical induction we have
(i) (Bas...
11 METHOD OF PROOF BY INDUCTION                                          71

(iii) (Induction step) We must show that S(n ...
72                        FUNDAMENTALS OF MATHEMATICAL PROOFS

Review Problems
Problem 11.1
Use the method of induction to...
11 METHOD OF PROOF BY INDUCTION                                               73

Problem 11.6
Use the formula
           ...
74                    FUNDAMENTALS OF MATHEMATICAL PROOFS

12 Project III: Elementary Number Theory
and Mathematical Proof...
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Note1
Upcoming SlideShare
Loading in …5
×

Note1

2,687
-1

Published on

Published in: Education, Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
2,687
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
60
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Note1

  1. 1. Lecture Notes in Discrete Mathematics Marcel B. Finan Arkansas Tech University c All Rights Reserved
  2. 2. 2
  3. 3. Preface This book is designed for a one semester course in discrete mathematics for sophomore or junior level students. The text covers the mathematical concepts that students will encounter in many disciplines such as computer science, engineering, Business, and the sciences. Besides reading the book, students are strongly encouraged to do all the excercises. Mathematics is a discipline in which working the problems is es- sential to the understanding of the material contained in this book. Students are encouraged first to do the problems without referring to the solutions. Solutions to problems found at the end of this book can only be used when you are stuck. Exert a reasonable amount of efforts towards solving a prob- lem before you look up the answer, and rework any problem you miss. Students are strongly encouraged to keep up with the exercises and the se- quel of concepts as they are going along, for mathematics builds on itself. Solution Manual for the text can be requested from the author through email:mfinan@atu.edu Marcel B. Finan May 2001 3
  4. 4. 4 PREFACE
  5. 5. Contents Preface 3 Fundamentals of Mathematical Logic 7 1 Propositions and Related Concepts . . . . . . . . . . . . . . . . . 8 2 Conditional and Biconditional Propositions . . . . . . . . . . . . 18 3 Rules of Inferential Logic . . . . . . . . . . . . . . . . . . . . . . . 24 4 Propositions and Quantifiers . . . . . . . . . . . . . . . . . . . . . 33 5 Arguments with Quantified Premises . . . . . . . . . . . . . . . . 41 6 Project I: Digital Logic Design . . . . . . . . . . . . . . . . . . . 45 7 Project II: Number Systems . . . . . . . . . . . . . . . . . . . . . 50 Fundamentals of Mathematical Proofs 53 8 Methods of Direct Proof I . . . . . . . . . . . . . . . . . . . . . . 53 9 More Methods of Proof . . . . . . . . . . . . . . . . . . . . . . . 59 10 Methods of Indirect Proofs: Contradiction and Contraposition . 64 11 Method of Proof by Induction . . . . . . . . . . . . . . . . . . . 67 12 Project III: Elementary Number Theory and Mathematical Proofs 74 13 Project IV: The Euclidean Algorithm . . . . . . . . . . . . . . . 76 14 Project V: Induction and the Algebra of Matrices . . . . . . . . 78 Fundamentals of Set Theory 81 15 Basic Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . 81 16 Properties of Sets . . . . . . . . . . . . . . . . . . . . . . . . . . 90 17 Project VI: Boolean Algebra . . . . . . . . . . . . . . . . . . . . 98 Relations and Functions 99 18 Equivalence Relations . . . . . . . . . . . . . . . . . . . . . . . . 99 19 Partial Order Relations . . . . . . . . . . . . . . . . . . . . . . . 110 5
  6. 6. 6 CONTENTS 20 Functions: Definitions and Examples . . . . . . . . . . . . . . . 116 21 Bijective and Inverse Functions . . . . . . . . . . . . . . . . . . . 124 22 Recursion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130 23 Project VII: Applications to Relations . . . . . . . . . . . . . . . 145 24 Project VIII: Well-Ordered Sets and Lattices . . . . . . . . . . . 148 25 Project IX: The Pigeonhole Principle . . . . . . . . . . . . . . . 149 26 Project X: Countable Sets . . . . . . . . . . . . . . . . . . . . . 150 27 Project XI: Finite-State Automaton . . . . . . . . . . . . . . . . 152 Introduction to the Analysis of Algorithms 157 28 Time Complexity and O-Notation . . . . . . . . . . . . . . . . . 157 29 Logarithmic and Exponential Complexities . . . . . . . . . . . . 165 30 Θ- and Ω-Notations . . . . . . . . . . . . . . . . . . . . . . . . . 169 Fundamentals of Counting and Probability Theory 173 31 Elements of Counting . . . . . . . . . . . . . . . . . . . . . . . . 173 32 Basic Probability Terms and Rules . . . . . . . . . . . . . . . . . 180 33 Binomial Random Variables . . . . . . . . . . . . . . . . . . . . 191 Elements of Graph Theory 197 34 Graphs, Paths, and Circuits . . . . . . . . . . . . . . . . . . . . 197 35 Trees . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
  7. 7. Fundamentals of Mathematical Logic Logic is commonly known as the science of reasoning. The emphasis here will be on logic as a working tool. We will develop some of the symbolic techniques required for computer logic. Some of the reasons to study logic are the following: • At the hardware level the design of ’logic’ circuits to implement in- structions is greatly simplified by the use of symbolic logic. • At the software level a knowledge of symbolic logic is helpful in the design of programs. 7
  8. 8. 8 FUNDAMENTALS OF MATHEMATICAL LOGIC 1 Propositions and Related Concepts A proposition is any meaningful statement that is either true or false, but not both. We will use lowercase letters, such as p, q, r, · · · , to represent propositions. We will also use the notation p:1+1=3 to define p to be the proposition 1 + 1 = 3. The truth value of a proposition is true, denoted by T, if it is a true statement and false, denoted by F, if it is a false statement. Statements that are not propositions include questions and commands. Example 1.1 Which of the following are propositions? Give the truth value of the propo- sitions. a. 2 + 3 = 7. b. Julius Ceasar was president of the United States. c. What time is it? d. Be quiet ! Solution. a. A proposition with truth value (F). b. A proposition wiht truth value (F). c. Not a proposition since no truth value can be assigned to this statement. d. Not a proposition Example 1.2 Which of the following are propositions? Give the truth value of the propo- sitions. a. The difference of two primes. b. 2 + 2 = 4. c. Washington D.C. is the capital of New York. d. How are you? Solution. a. Not a proposition. b. A proposition with truth value (T). c. A proposition with truth value (F).
  9. 9. 1 PROPOSITIONS AND RELATED CONCEPTS 9 d. Not a proposition New propositions called compound propositions or propositional func- tions can be obtained from old ones by using symbolic connectives which we discuss next. The propositions that form a propositional function are called the propositional variables. Let p and q be propositions. The conjunction of p and q, denoted p ∧ q, is the proposition: p and q. This proposition is defined to be true only when both p and q are true and it is false otherwise. The disjunction of p and q, denoted p ∨ q, is the proposition: p or q. The ’or’ is used in an inclusive way. This proposition is false only when both p and q are false, otherwise it is true. Example 1.3 Let p: 5<9 q : 9 < 7. Construct the propositions p ∧ q and p ∨ q. Solution. The conjunction of the propositions p and q is the proposition p ∧ q : 5 < 9 and 9 < 7. The disjunction of the propositions p and q is the proposition p ∨ q : 5 < 9 or 9 < 7 Example 1.4 Consider the following propositions p: It is Friday q: It is raining. Construct the propositions p ∧ q and p ∨ q.
  10. 10. 10 FUNDAMENTALS OF MATHEMATICAL LOGIC Solution. The conjunction of the propositions p and q is the proposition p ∧ q : It is F riday and it is raining. The disjunction of the propositions p and q is the proposition p ∨ q : It is F riday or It is raining A truth table displays the relationships between the truth values of propo- sitions. Next, we display the truth tables of p ∧ q and p ∨ q. p q p∧q T T T T F F F T F F F F p q p∨q T T T T F T F T T F F F Let p and q be two propositions. The exclusive or of p and q, denoted p ⊕ q, is the proposition that is true when exactly one of p and q is true and is false otherwise. The truth table of the exclusive ’or’ is displayed below p q p⊕q T T F T F T F T T F F F Example 1.5 a. Construct a truth table for (p ⊕ q) ⊕ r. b. Construct a truth table for p ⊕ p. Solution. a.
  11. 11. 1 PROPOSITIONS AND RELATED CONCEPTS 11 p q r p⊕q (p ⊕ q) ⊕ r T T T F T T T F F F T F T T F T F F T T F T T T F F T F T T F F T F T F F F F F b. p p⊕p T F F F The final operation on a proposition p that we discuss is the negation of p. The negation of p, denoted ∼ p, is the proposition not p. The truth table of ∼ p is displayed below p ∼p T F F T Example 1.6 Consider the following propositions: p: Today is Thursday. q: 2 + 1 = 3. r: There is no pollution in New Jersey. Construct the truth table of [∼ (p ∧ q)] ∨ r. Solution. p q r p ∧q ∼ (p ∧ q) [∼ (p ∧ q)] ∨ r T T T T F T T T F T F F F T T F T T F T F F T T
  12. 12. 12 FUNDAMENTALS OF MATHEMATICAL LOGIC Example 1.7 Find the negation of the proposition p : −5 < x ≤ 0. Solution. The negation of p is the proposition ∼ p : x > 0 or x ≤ −5 A compound proposition is called a tautology if it is always true, regardless of the truth values of the basic propositions which comprise it. Example 1.8 a. Construct the truth table of the proposition (p∧q)∨(∼ p∨ ∼ q). Determine if this proposition is a tautology. b. Show that p∨ ∼ p is a tautology. Solution. a. p q ∼p ∼q ∼ p∨ ∼ q p∧q (p ∧ q) ∨ (∼ p∧ ∼ q) T T F F F T T T F F T T F T F T T F T F T F F T T T F T Thus, the given proposition is a tautology. b. p ∼p p∨ ∼ p T F T F T T Again, this proposition is a tautology. Two propositions are equivalent if they have exactly the same truth values under all circumstances. We write p ≡ q. Example 1.9 a. Show that ∼ (p ∨ q) ≡∼ p∧ ∼ q. b. Show that ∼ (p ∧ q) ≡∼ p∨ ∼ q. c. Show that ∼ (∼ p) ≡ p. a. and b. are known as DeMorgan’s laws.
  13. 13. 1 PROPOSITIONS AND RELATED CONCEPTS 13 Solution. a. p q ∼p ∼q p∨q ∼ (p ∨ q) ∼ p∧ ∼ q T T F F T F F T F F T T F F F T T F T F F F F T T F T T b. p q ∼p ∼q p∧q ∼ (p ∧ q) ∼ p∨ ∼ q T T F F T F F T F F T F T T F T T F F T T F F T T F T T c. p ∼p ∼ (∼ p) T F T F T F Example 1.10 a. Show that p ∧ q ≡ q ∧ p and p ∨ q ≡ q ∨ p. b. Show that (p ∨ q) ∨ r ≡ p ∨ (q ∨ r) and (p ∧ q) ∧ r ≡ p ∧ (q ∧ r). c. Show that (p ∧ q) ∨ r ≡ (p ∨ r) ∧ (q ∨ r) and (p ∨ q) ∧ r ≡ (p ∧ r) ∨ (q ∧ r). Solution. a. p q p∧q q∧p T T T T T F F F F T F F F F F F p q p∨q q∨p T T T T T F T T F T T T F F F F
  14. 14. 14 FUNDAMENTALS OF MATHEMATICAL LOGIC b. p q r p∨q q∨r (p ∨ q) ∨ r p ∨ (q ∨ r) T T T T T T T T T F T T T T T F T T T T T T F F T F T T F T T T T T T F T F T T T T F F T F T T T F F F F F F F p q r p∧q q∧r (p ∧ q) ∧ r p ∧ (q ∧ r) T T T T T T T T T F T F F F T F T F F F F T F F F F F F F T T F T F F F T F F F F F F F T F F F F F F F F F F F c. p q r p∧q p∨r q∨r (p ∧ q) ∨ r (p ∨ r) ∧ (q ∨ r) T T T T T T T T T T F T T T T T T F T F T T T T T F F F T F F F F T T F T T T T F T F F F T F F F F T F T T T T F F F F F F F F
  15. 15. 1 PROPOSITIONS AND RELATED CONCEPTS 15 p q r p∨q p∧r q∧r (p ∨ q) ∧ r (p ∧ r) ∨ (q ∧ r) T T T T T T T T T T F T F F F F T F T T T F T T T F F T F F F F F T T T F T T T F T F T F F F F F F T F F F F F F F F F F F F F Example 1.11 Show that ∼ (p ∧ q) ≡∼ p∧ ∼ q Solution. We will use truth tables to prove the claim. p q ∼p ∼q p∧q ∼ (p ∧ q) ∼ p∧ ∼ q T T F F T F F T F F T F T = F F T T F F T = F F F T T F T T A compound proposition that has the value F for all possible values of the propositions in it is called a contradiction. Example 1.12 Show that the proposition p∧ ∼ p is a contradiction. Solution. p ∼p p∧ ∼ p T F F F T F In propositional functions, the order of operations is that ∼ is performed first. The operations ∨ and ∧ are executed in any order.
  16. 16. 16 FUNDAMENTALS OF MATHEMATICAL LOGIC Review Problems Problem 1.1 Indicate which of the following sentences are propositions. a. 1,024 is the smallest four-digit number that is perfect square. b. She is a mathematics major. c. 128 = 26 d. x = 26 . Problem 1.2 Consider the propositions: p: Juan is a math major. q: Juan is a computer science major. Use symbolic connectives to represent the proposition ”Juan is a math major but not a computer science major.” Problem 1.3 In the following sentence is the word ”or” used in its inclusive or exclusive sense? ”A team wins the playoffs if it wins two games in a row or a total of three games.” Problem 1.4 Write the truth table for the proposition: (p ∨ (∼ p ∨ q))∧ ∼ (q∧ ∼ r). Problem 1.5 Let t be a tautology. Show that p ∨ t ≡ t. Problem 1.6 Let c be a contradiction. Show that p ∨ c ≡ p. Problem 1.7 Show that (r ∨ p) ∧ [(∼ r ∨ (p ∧ q)) ∧ (r ∨ q)] ≡ p ∧ q. Problem 1.8 Use De Morgan’s laws to write the negation for the proposition:”This com- puter program has a logical error in the first ten lines or it is being run with an incomplete data set.”
  17. 17. 1 PROPOSITIONS AND RELATED CONCEPTS 17 Problem 1.9 Use De Morgan’s laws to write the negation for the proposition:”The dollar is at an all-time high and the stock market is at a record low.” Problem 1.10 Assume x ∈ IR. Use De Morgan’s laws to write the negation for the proposition:0 ≥ x > −5. Problem 1.11 Show that the proposition s = (p ∧ q) ∨ (∼ p ∨ (p∧ ∼ q)) is a tautology. Problem 1.12 Show that the proposition s = (p∧ ∼ q) ∧ (∼ p ∨ q) is a contradiction. Problem 1.13 a. Find simpler proposition forms that are logically equivalent to p ⊕ p and p ⊕ (p ⊕ p). b. Is (p ⊕ q) ⊕ r ≡ p ⊕ (q ⊕ r)? Justify your answer. c. Is (p ⊕ q) ∧ r ≡ (p ∧ r) ⊕ (q ∧ r)? Justify your answer. Problem 1.14 Show the following: a. p ∧ t ≡ p, where t is a tautology. b. p ∧ c ≡ c, where c is a contradiction. c. ∼ t ≡ c and ∼ c ≡ t. d. p ∨ p ≡ p and p ∧ p ≡ p.
  18. 18. 18 FUNDAMENTALS OF MATHEMATICAL LOGIC 2 Conditional and Biconditional Propositions Let p and q be propositions. The implication p → q is the the proposition that is false only when p is true and q is false; otherwise it is true. p is called the hypothesis and q is called the conclusion. The connective → is called the conditional connective. Example 2.1 Construct the truth table of the implication p → q. Solution. The truth table is p q p→q T T T T F F F T T F F T Example 2.2 Show that p → q ≡∼ p ∨ q. Solution. p q ∼p p→q ∼p∨q T T F T T T F F F F F T T T T F F T T T It follows from the previous example that the proposition p → q is always true if the hypothesis p is false, regardless of the truth value of q. We say that p → q is true by default or vacuously true. In terms of words the proposition p → q also reads: (a) if p then q. (b) p implies q. (c) p is a sufficient condition for q. (d) q is a necessary condition for p. (e) p only if q.
  19. 19. 2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 19 Example 2.3 Use the if-then form to rewrite the statement ”I am on time for work if I catch the 8:05 bus.” Solution. If I catch the 8:05 bus then I am on time for work In propositional functions that invlove the connectives ∼, ∧, ∨, and → the order of operations is that ∼ is performed first and → is performed last. Example 2.4 a. Show that ∼ (p → q) ≡ p∧ ∼ q. b. Find the negation of the statement ” If my car in the repair shop, then I cannot go to class.” Solution. a. We use De Morgan’s laws as follows. ∼ (p → q) ≡ ∼ (∼ p ∨ q) ≡ ∼ (∼ p)∧ ∼ q ≡ p∧ ∼ q. b. ”My car in the repair shop and I can get to class.” The converse of p → q is the proposition q → p. The opposite or in- verse of p → q is the proposition ∼ p →∼ q. The contrapositive of p → q is the proposition ∼ q →∼ p. Example 2.5 Find the converse, opposite, and the contrapositive of the implication: ” If today is Thursday, then I have a test today.” Solution. The converse: If I have a test today then today is Thursday. The opposite: If today is not Thursday then I don’t have a test today. The contrapositive: If I don’t have a test today then today in not Thursday Example 2.6 Show that p → q ≡∼ q →∼ p.
  20. 20. 20 FUNDAMENTALS OF MATHEMATICAL LOGIC Solution. We use De Morgan’s laws as follows. p→q ≡ ∼p∨q ≡ ∼ (p∧ ∼ q) ≡ ∼ (∼ q ∧ p) ≡ ∼∼ q∨ ∼ p ≡ q∨ ∼ p ≡ ∼ q →∼ p Example 2.7 Using truth tables show the following: a. p → q ≡ q → p b. p → q ≡∼ p →∼ q Solution. a. It suffices to show that ∼ p ∨ q ≡∼ q ∨ p. p q ∼p ∼q ∼p∨q ∼q∨p T T F F T T T F F T F = T F T T F T = F F F T T T T b. We will show that ∼ p ∨ q ≡ p∨ ∼ q. p q ∼p ∼q ∼p∨q p∨ ∼ q T T F F T T T F F T F = T F T T F T = F F F T T T T Example 2.8 Show that ∼ q →∼ p ≡ p → q Solution. We use De Morgan’s laws as follows. ∼ q →∼ p ≡ q∨ ∼ p ≡ ∼ (∼ q ∧ p) ≡ ∼ (p∧ ∼ q) ≡ ∼ p∨ ∼∼ q ≡ ∼p∨q ≡ p→q
  21. 21. 2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 21 The biconditional proposition of p and q, denoted by p ↔ q, is the propo- sitional function that is true when both p and q have the same truth values and false if p and q have opposite truth values. Also reads, ”p if and only if q” or ”p is a necessary and sufficient condition for q.” Example 2.9 Construct the truth table for p ↔ q. Solution. p q p↔q T T T T F F F T F F F T Example 2.10 Show that the biconditional proposition of p and q is logically equivalent to the conjunction of the conditional propositions p → q and q → p. Solution. p q p→q q→p p↔q (p → q) ∧ (q → p) T T T T T T T F F T F F F T T F F F F F T T T T The order of operations for the five logical connectives is as follows: 1. ∼ 2. ∧, ∨ in any order. 3. →, ↔ in any order.
  22. 22. 22 FUNDAMENTALS OF MATHEMATICAL LOGIC Review Problems Problem 2.1 Rewrite the following proposition in if-then form: ” This loop will repeat exactly N times if it does not contain a stop or a go to.” Problem 2.2 Construct the truth table for the proposition: ∼ p ∨ q → r. Problem 2.3 Construct the truth table for the proposition: (p → r) ↔ (q → r). Problem 2.4 Write negations for each of the following propositions. (Assume that all vari- ables represent fixed quantities or entities, as appropriate.) a. If P is a square, then P is a rectangle. b. If today is Thanksgiving, then tomorrow is Friday. c. If r is rational, then the decimal expansion of r is repeating. d. If n is prime, then n is odd or n is 2. e. If x ≥ 0, then x > 0 or x = 0. f. If Tom is Ann’s father, then Jim is her uncle and Sue is her aunt. g. If n is divisible by 6, then n is divisible by 2 and n is divisible by 3. Problem 2.5 Write the contrapositives for the propositions of Exercise 40. Problem 2.6 Write the converse and inverse for the propositions of Exercise 40. Problem 2.7 Use the contrapositive to rewrite the proposition ” The Cubs will win the penant only if they win tomorrow’s game” in if-then form in two ways. Problem 2.8 Rewrite the proposition :” Catching the 8:05 bus is sufficient condition for my being on time for work” in if-then form.
  23. 23. 2 CONDITIONAL AND BICONDITIONAL PROPOSITIONS 23 Problem 2.9 Use the contrapositive to rewrite the proposition ” being divisible by 3 is a necessary condition for this number to be divisible by 9” in if-then form in two ways. Problem 2.10 Rewrite the proposition ”A sufficient condition for Hal’s team to win the championship is that it wins the rest of the games” in if-then form. Problem 2.11 Rewrite the proposition ”A necessary condition for this computer program to be correct is that it not produce error messages during translation” in if-then form.
  24. 24. 24 FUNDAMENTALS OF MATHEMATICAL LOGIC 3 Rules of Inferential Logic The main concern of logic is how the truth of some propositions is connected with the truth of another. Thus, we will usually consider a group of related propositions. An argument is a set of two or more propositions related to each other in such a way that all but one of them (the premises) are supposed to provide support for the remaining one (the conclusion). The transition from premises to conclusion is the inference upon which the argument relies. Example 3.1 Show that the propositions ”The star is made of milk, and strawberries are red. My dog has fleas.” do not form an argument. Solution. Indeed, the truth or falsity of each of the propositions has no bearing on that of the others Example 3.2 Show that the propositions:”Mark is a lawyer. So Mark went to law school since all lawyers have gone to law school” form an argument. Solution. This is an argument. The truth of the conclusion, ”Mark went to law school,” is inferred or deduced from its premises, ”Mark is a lawyer” and ”all lawyers have gone to law school.” The above argument can be represented as follows: Let p: Mark is a lawyer. q: All lawyers have gone to law school. r: Mark went to law school. Then p∧q .. ˙ r The symbol .. is to indicate the inferrenced conclusion. ˙ Now, suppose that the premises of an argument are all true. Then the
  25. 25. 3 RULES OF INFERENTIAL LOGIC 25 conclusion may be either true or false. When the conclusion is true then the argument is said to be valid. When the conclusion is false then the argument is said to be invalid. To test an argument for validity one proceeds as follows: (1) Identify the premises and the conclusion of the argument. (2) Construct a truth table including the premises and the conclusion. (3) Find rows in which all premises are true. (4) In each row of Step (3), if the conclusion is true then the argument is valid; otherwise the argument is invalid. Example 3.3 Show that the argument p → q q → p .. p ∨ q ˙ is invalid Solution. We construct the truth table as follows. p q p→q q→p p∨q T T T T T T F F T T F T T F T F F T T F From the last row we see that the premises are true but the conclusion is false. The argument is then invalid Example 3.4 (Modus Ponens or the method of affirming) a. Show that the argument p → q p .. q ˙ is valid. b. Show that the argument ∼p∨q → r ∼p∨q .. ˙ r is valid.
  26. 26. 26 FUNDAMENTALS OF MATHEMATICAL LOGIC Solution. a. The truth table is as follows. p q p→q T T T T F F F T T F F T The first row shows that the argument is valid. b. Follows from by replacing p with ∼ ∨q and q with r Example 3.5 Show that the argument p → q q .. p ˙ is invalid. Solution. The truth table is as follows. p q p→q T T T T F F F T T F F T Because of the third row the argument is invalid. An argument of this form is referred to as converse error because the conclusion of the argument would follows from the premises if p → q is replaced by its converse q → p Example 3.6 (Modus Tollens or the method of denial) Show that the argument p → q ∼q .. ∼ p ˙ is valid.
  27. 27. 3 RULES OF INFERENTIAL LOGIC 27 Solution. The truth table is as follows. p q p→q ∼q ∼p T T T F F T F F T F F T T F T F F T T T The last row shows that the argument is valid Example 3.7 Show that the argument p → q ∼p .. ∼ q ˙ is invalid. Solution. The truth table is as follows. p q p→q ∼q ∼p T T T F F T F F T F F T T F T F F T T T The third row shows that the argument is invalid. This is known as inverse error because the conclusion of the argument would follow from the premises if p → q is replaced by the inverse q → p Example 3.8 (Disjunctive Addition) a. Show that the argument p .. p ∨ q ˙ is valid. b. Show that the argument q .. p ∨ q ˙ is valid.
  28. 28. 28 FUNDAMENTALS OF MATHEMATICAL LOGIC Solution. a. The truth table is as follows. p q p∨q T T T T F T F T T F F F The first and second rows show that the argument is valid. b. The first and third rows show that the argument is valid Example 3.9 (Conjunctive Simplification) a. Show that the argument p∧q .. ˙ p is valid. b. Show that the argument p∧q .. ˙ q is valid. Solution. a. The truth table is as follows. p q p∧q T T T T F F F T F F F F The first row shows that the argument is valid. b. The first row shows that the argument is valid Example 3.10 (Disjunctive Syllogism) a. Show that the argument p∨q ∼q .. ˙ p
  29. 29. 3 RULES OF INFERENTIAL LOGIC 29 is valid. b. Show that the argument p∨q ∼p .. ˙ q is valid. Solution. a. The truth table is as follows. p q ∼p ∼q p∨q T T F F T T F F T T F T T F T F F T T F The second row shows that the argument is valid. b. The third row shows that the argument is valid Example 3.11 (Hypothetical Syllogism) Show that the argument p→q q→r .. ˙ p→r is valid. Solution. The truth table is as follows. p q r p→q q→r p→r T T T T T T T T F T F F T F T F T T T F F F T F F T T T T T F T F T F T F F T T T T F F F T T T The first , fifth, seventh, and eighth rows show that the argument is valid
  30. 30. 30 FUNDAMENTALS OF MATHEMATICAL LOGIC Example 3.12 (Rule of contradiction) Show that if c is a contradiction then the following argument is valid for any p. ∼p→c .. ˙ p Solution. Constructing the truth table we find c p ∼p→c F T T F F F The first row shows that the argument is valid
  31. 31. 3 RULES OF INFERENTIAL LOGIC 31 Review Problems Problem 3.1 Use modus ponens or modus tollens to fill in the blanks in the argument below so as to produce valid inferences. √ √ If 2 is rational, then 2 = a for some integers a and b. √ b It is not true that 2 = a for some integers a and b. b .. ˙ Problem 3.2 Use modus ponens or modus tollens to fill in the blanks in the argument below so as to produce valid inferences. If logic is easy, then I am a monkey’s uncle. I am not a monkey’s uncle. .. ˙ Problem 3.3 Use truth table to determine whether the argument below is valid. p→q q→p .. p ∨ q ˙ Problem 3.4 Use truth table to determine whether the argument below is valid. p p→q ∼q∨r .. ˙ r Problem 3.5 Use symbols to write the logical form of the given argument and then use a truth table to test the argument for validity. If Tom is not on team A, then Hua is on team B. If Hua is not on team B, then Tom is on team A. .. Tom is not on team A or Hua is not on team B. ˙
  32. 32. 32 FUNDAMENTALS OF MATHEMATICAL LOGIC Problem 3.6 Use symbols to write the logical form of the given argument. If the argument is valid, identify the rule of inference that guarantees its validity. Otherwise state whether the converse or the inverse error is made. If Jules solved this problem correctly, then Jules obtained the answer 2. Jules obtained the answer 2. .. Jules solved this problem correctly. ˙ Problem 3.7 Use symbols to write the logical form of the given argument. If the argument is valid, identify the rule of inference that guarantees its validity. Otherwise state whether the converse or the inverse error is made. If this number is larger than 2, then its square is larger than 4. This number is not larger than 2. .. The square of this number is not larger than 4. ˙ Problem 3.8 Use the valid argument forms of this section to deduce the conclusion from the premises. ∼p∨q →r s∨ ∼ q ∼t p→t ∼ p ∧ r →∼ s .. ˙ ∼q Problem 3.9 Use the valid argument forms of this section to deduce the conclusion from the premises. ∼ p → r∧ ∼ s t→s u →∼ p ∼w u∨w .. ˙ ∼t∨w
  33. 33. 4 PROPOSITIONS AND QUANTIFIERS 33 4 Propositions and Quantifiers Statements such as ”x > 3” are often found in mathematical assertions and in computer programs. These statements are not propositions when the variables are not specified. However, one can produce propositions from such statements. A predicate is an expression involving one or more variables defined on some domain, called the domain of discourse. Substitution of a particular value for the variable(s) produces a proposition which is either true or false. For instance, P (n) : n is prime is a predicate on the natural numbers. Observe that P (1) is false, P (2) is true. In the expression P (x), x is called a free variable. As x varies the truth value of P (x) varies as well. The set of true values of a predicate P (x) is called the truth set and will be denoted by TP . Example 4.1 Let Q(x, y) : x = y+3 with domain the collection of natural numbers (i.e. the numbers 0, 1, 2, · · · ). What are the truth values of the propositions Q(1, 2) and Q(3, 0)? Solution. By substitution in the expression of Q we find: Q(1, 2) is false since 1 = x = y + 3 = 5. On the contrary, Q(3, 0) is true since x = 3 = 0 + 3 = y + 3 If P (x) and Q(x) are two predicates with a common domain D then the notation P (x) ⇒ Q(x) means that every element in the truth set of P (x) is also an element in the truth set of Q(x). Example 4.2 Consider the two predicates P (x) : x is a factor of 4 and Q(x) : x is a factor of 8. Show that P (x) ⇒ Q(x). Solution. Finding the truth set of each predicate we have: TP = {1, 2, 4} and TQ = {1, 2, 4, 8}. Since every number appearing in TP also appears in TQ then P (x) ⇒ Q(x) If two predicates P (x) and Q(x) with a common domain D are such that TP = TQ then we use the notation P (x) ⇔ Q(x).
  34. 34. 34 FUNDAMENTALS OF MATHEMATICAL LOGIC Example 4.3 Let D = IR. Consider the two predicates P (x) : −2 ≤ x ≤ 2 and Q(x) : |x| ≤ 2. Show that P (x) ⇔ Q(x). Solution. Indeed, if x in TP then the distance from x to the origin is at most 2. That is, |x| ≤ 2 and hence x belongs to TQ . Now, if x is an element in TQ then |x| ≤ 2,i.e. (x−2)(x+2) ≤ 0. Solving this inequality we find that −2 ≤ x ≤ 2. That is, x ∈ TP Another way to generate propositions is by means of quantifiers. For exam- ple ∀x ∈ D, P (x) is a proposition which is true if P (x) is true for all values of x in the domain D of P. For example, if k is an nonnegative integer, then the predicate P (k) : 2k is even is true for all k ∈ IN. We write, ∀k ∈ IN, (2k is even). The symbol ∀ is called the universal quantifier. The proposition ∀x ∈ D, P (x) is false if P (x) is false for at least one value of x. In this case x is called a counterexample. Example 4.4 1 Show that the proposition ∀x ∈ IR, x > x is false. Solution. A counterexample is x = 1 . Clearly, 2 1 2 < 2 = 1. 1 2 Example 4.5 Write in the form ∀x ∈ D, P (x) the proposition :” every real number is either positive, negative or 0.” Solution. ∀x ∈ IR, x > 0, x < 0, or x = 0. The notation ∃x ∈ D, P (x) is a proposition that is true if there is at least one value of x ∈ D where P (x) is true; otherwise it is false. The symbol ∃ is called the existential quantifier.
  35. 35. 4 PROPOSITIONS AND QUANTIFIERS 35 Example 4.6 Let P (x) denote the statement ”x > 3.” What is the truth value of the proposition ∃x ∈ IR, P (x). Solution. Since 4 ∈ IR and 4 > 3, the given proposition is true The proposition ∀x ∈ D, P (x) → Q(x) is called the universal conditional proposition. For example, the proposition ∀x ∈ IR, if x > 2 then x2 > 4 is a universal conditional proposition. Example 4.7 Rewrite the proposition ”if a real number is an integer then it is a rational number” as a universal conditional proposition. Solution. ∀x ∈ IR, if x is an interger then x is a rational number Example 4.8 a. What is the negation of the proposition ∀x ∈ D, P (x)? b. What is the negation of the proposition ∃x ∈ D, P (x)? c. What is the negation of the proposition ∀x ∈ D, P (x) → Q(x)? Solution. a. ∃x ∈ D, ∼ P (x). b. ∀x ∈ D, ∼ P (x). c. Since P (x) → Q(x) ≡ (∼ P (x)) ∨ Q(x) then ∼ (∀x ∈ D, P (x) → Q(x)) ≡ ∃x ∈ D, P (x) and ∼ Q(x) Example 4.9 Consider the universal conditional proposition ∀x ∈ D, if P (x) then Q(x). a. Find the contrapositive. b. Find the converse. c. Find the inverse.
  36. 36. 36 FUNDAMENTALS OF MATHEMATICAL LOGIC Solution. a. ∀x ∈ D, if ∼ Q(x) then ∼ P (x). b. ∀x ∈ D, if Q(x) then P (x). c. ∀x ∈ D, if ∼ P (x) then ∼ Q(x) Example 4.10 Write the negation of each of the following propositions: a. ∀x ∈ IR, x > 3 → x2 > 9. b. Every polynomial function is continuous. c. There exists a triangle with the property that the sum of angles is greater than 180◦ . Solution. a. ∃x ∈ IR, x > 3 and x2 ≤ 9. b. There exists a polynomial that is not continuous everywhere. c. For any triangle, the sum of the angles is less than or equal to 180◦ Next, we discuss predicates that contain multiple quantifiers. A typical ex- ample is the definition of a limit. We say that L = limx→a f (x) if and only if ∀ > 0, ∃ a positive number δ such that if |x − a| ≤ δ then |f (x) − L| < . Example 4.11 a. Let P (x, y) denote the statement ”x + y = y + x.” What is the truth value of the proposition (∀x ∈ IR)(∀y ∈ IR), P (x, y)? b. Let Q(x, y) denote the statement ”x + y = 0.” What is the truth value of the proposition (∃y ∈ IR)(∀x ∈ IR), Q(x, y)? Solution. a. The given proposition is always true. b. The proposition is false. For otherwise, one can choose x = −y to obtain 0 = x + y = 0 which is impossible Example 4.12 Find the negation of the following propositions: a. ∀x∃y, P (x, y). b. ∃x∀y, P (x, y).
  37. 37. 4 PROPOSITIONS AND QUANTIFIERS 37 Solution. a. ∃x∀y, ∼ P (x, y). b. ∀x∃y, ∼ P (x, y) Example 4.13 The symbol ∃! stands for the phrase ”there exists a unique”. Which of the following statements are true and which are false. a. ∃!x ∈ IR, ∀y ∈ IR, xy = y. 1 b. ∃! integer x such that x is an integer. Solution. a. True. Let x = 1. b. False since 1 and −1 are both integers with integer reciprocals
  38. 38. 38 FUNDAMENTALS OF MATHEMATICAL LOGIC Review Problems Problem 4.1 By finding a counterexample, show that the proposition:” For all positive integers n and m, m.n ≥ m + n” is false. Problem 4.2 Consider the statement ∃x ∈ IR such that x2 = 2. Which of the following are equivalent ways of expressing this statement? a. The square of each real number is 2. b. Some real numbers have square 2. c. The number x has square 2, for some real number x. d. If x is a real number, then x2 = 2. e. Some real number has square 2. f. There is at least one real number whose square is 2. Problem 4.3 Rewrite the following propositions informally in at least two different ways without using the symbols ∃ and ∀ : a. ∀ squares x, x is a rectangle. b. ∃ a set A such that A has 16 subsets. Problem 4.4 Rewrite each of the following statements in the form ”∃ x such that ”: a. Some exercises have answers. b. Some real numbers are rational. Problem 4.5 Rewrite each of the following statements in the form ”∀ , if then .”: a. All COBOL programs have at least 20 lines. b. Any valid argument with true premises has a true conclusion. c. The sum of any two even integers is even. d. The product of any two odd integers is odd.
  39. 39. 4 PROPOSITIONS AND QUANTIFIERS 39 Problem 4.6 Which of the following is a negation for ”Every polynomial function is con- tinuous”? a. No polynomial function is continuous. b. Some polynomial functions are continuous. c. Every polynomial function fails to be continuous. d. There is a noncontinuous polynomial function. Problem 4.7 Determine whether the proposed negation is correct. If it is not, write a correct negation. Proposition : For all integers n, if n2 is even then n is even. Proposed negation : For all integer n, if n2 is even then n is not even. Problem 4.8 Let D = {−48, −14, −8, 0, 1, 3, 16, 23, 26, 32, 36}. Determine which of the fol- lowing propositions are true and which are false. Provide counterexamples for those propositions that are false. a. ∀x ∈ D, if x is odd then x > 0. b. ∀x ∈ D, if x is less than 0 then x is even. c. ∀x ∈ D, if x is even then x ≤ 0. d. ∀x ∈ D, if the ones digit of x is 2, then the tens digit is 3 or 4. e. ∀x ∈ D, if the ones digit of x is 6, then the tens digit is 1 or 2 Problem 4.9 Write the negation of the proposition :∀x ∈ IR, if x(x + 1) > 0 then x > 0 or x < −1. Problem 4.10 Write the negation of the proposition : If an integer is divisible by 2, then it is even. Problem 4.11 Given the following true propostion:” ∀ real numbers x, ∃ an integer n such that n > x.” For each x given below, find an n to make the predicate n > x true. 10 a. x = 15.83 b. x = 108 c. x = 1010 .
  40. 40. 40 FUNDAMENTALS OF MATHEMATICAL LOGIC Problem 4.12 Given the proposition: ∀x ∈ IR, ∃ a real number y such that x + y = 0. a. Rewrite this proposition in English without the use of the quantifiers. b. Find the negation of the given proposition. Problem 4.13 Given the proposition: ∃x ∈ IR, ∀y ∈ IR, x + y = 0. a. Rewrite this proposition in English without the use of the quantifiers. b. Find the negation of the given proposition. Problem 4.14 Consider the proposition ”Somebody is older than everybody.” Rewrite this proposition in the form ”∃ a person x such that ∀ .” Problem 4.15 Given the proposition: There exists a program that gives the correct answer to every question that is posed to it.” a. Rewrite this proposition using quantifiers and variables. b. Find a negation for the given proposition. Problem 4.16 Given the proposition: ∀x ∈ IR, ∃y ∈ IR such that x < y. a. Write a proposition by interchanging the symbols ∀ and ∃. b. State which is true: the given proposition, the one in part (a), neither, or both. Problem 4.17 Find the contrapositive, converse, and inverse of the proposition ”∀x ∈ IR, if x(x + 1) > 0 then x > 0 or x < −1.” Problem 4.18 Rewrite the following proposition in if-then form :” Earning a grade of C − in this course is a sufficient condition for it to count toward graduation.” Problem 4.19 Rewrite the following proposition in if-then form :” Being on time each day is a necessary condition for keeping this job.” Problem 4.20 Rewrite the following proposition without using the words ”necessary” or ” sufficient” : ”Divisibility by 4 is not a necessary condition for divisibility by 2.”
  41. 41. 5 ARGUMENTS WITH QUANTIFIED PREMISES 41 5 Arguments with Quantified Premises In this section we discuss three types of valid arguments that involve the universal quantifier. • The rule of universal instantiation: ∀x ∈ D, P (x) a∈D .. ˙ P (a) Example 5.1 Use universal instantiation to fill in valid conclusion for the following argu- ment. All positive integers are greater than or equal to 1 3 is a positive integer .. ˙ Solution. All positive integers are greater than or equal to 1 3 is a positive integer .. 3 ≥ 1 ˙ • Universal Modus Ponen: ∀x ∈ D, if P (x) then Q(x) P (a) f or some a ∈ D .. ˙ Q(a) Example 5.2 Use the rule of the universal modus ponens to fill in valid conclusion for the following argument. ∀n ∈ IN, if n = 2k for some k ∈ IN then n is even. 0 = 2.0 .. ˙ Solution. ∀n ∈ IN, if n = 2k for some k ∈ IN then n is even.
  42. 42. 42 FUNDAMENTALS OF MATHEMATICAL LOGIC 0 = 2.0 ..0 is even ˙ • Universal Modus Tollens: ∀x ∈ D, if P (x) then Q(x) ∼ Q(a) f or some a ∈ D .. ˙ ∼ P (a) Example 5.3 Use the rule of the universal modus tonens to fill in valid conclusion for the following argument. All healthy people eat an apple a day. Harry does not eat an apple a day. .. ˙ Solution. All healthy people eat an apple a day. Harry does not eat an apple a day. .. Harry is not healthy ˙ Next, we discuss a couple of invalid arguments whose premises involve quan- tifiers. • The rule of converse error: ∀x ∈ D, if P (x) then Q(x) Q(a) f or some a ∈ D .. ˙ P (a) Example 5.4 What kind of error does the following invalid argument exhibit? All healthy people eat an apple a day. Helen eats an apple a day. .. Helen is healthy ˙ Solution. This invalid argument exhibits the converse error
  43. 43. 5 ARGUMENTS WITH QUANTIFIED PREMISES 43 • The rule of inverse error: ∀x ∈ D, if P (x) then Q(x) ∼ P (a) f or some a ∈ D .. ˙ ∼ Q(a) Example 5.5 What kind of error does the following invalid argument exhibit? All healthy people eat an apple a day. Hubert is not a healthy person. .. Hubert does not eat an apple a day. ˙ Solution. This invalid argument exhibits the inverse error
  44. 44. 44 FUNDAMENTALS OF MATHEMATICAL LOGIC Review Problems Problem 5.1 Use the rule of universal modus ponens to fill in valid conclusion for the ar- gument. For all real numbers a, b, c, and d, if b = 0 and d = 0 then a + d = ad+bc . b c bd a = 2, b = 3, c = 4, and d = 5 are particular real numbers such that b = 0 and d = 0. .. ˙ Problem 5.2 Use the rule of universal modus tonens to fill in valid conclusion for the ar- gument. If a computer is correct, then compilation of the program does not produce error messages. Compilation of this program produces error messages. .. ˙ Problem 5.3 Use the rule of universal modus ponens to fill in valid conclusion for the ar- gument. All freshmen must take writing. Caroline is a freshman. .. ˙ . Problem 5.4 What kind of error does the following invalid argument exhibit? All cheaters sit in the back row. George sits in the back row. .. George is a cheater. ˙ Problem 5.5 What kind of error does the following invalid argument exhibit? All honest people pay their taxes. Darth is not honest. .. Darth does not pay his taxes. ˙
  45. 45. 6 PROJECT I: DIGITAL LOGIC DESIGN 45 6 Project I: Digital Logic Design In this section we discuss the logic of digital circuits which are considered to be the basic components of most digital systems, such as electronic comput- ers, electronic phones, traffic light controls, etc. The purpose of digital systems is to manipulate discrete information which are represented by physical quantities such as voltages and current. The smallest representation unit is one bit, short for binary digit. Since electronic switches have two physical states, namely high voltage and low voltage we attribute the bit 1 to high voltage and the bit 0 for low voltage. A logic gate is the smallest processing unit in a digital system. It takes one or few bits as input and generates one bit as an output. A circuit is composed of a number of logic gates connected by wires. It takes a group of bits as input and generates one or more bits as output. The six basic logic gates are the following: (1) NOT gate (also called inverter): Takes an input of 0 to an output of 1 and an input of 1 to an output of 0. The corresponding logical symbol is ∼ P. (2) AND gate: Takes two bits, P and Q, and outputs 1 if P and Q are 1 and 0 otherwise. The logical symbol is P ∧ Q. (3) OR gate: outputs 1 if either P or Q is 1 and 0 otherwise. The logical symbol is P ∨ Q. (4) NAND gate: outputs a 0 if both P and Q are 1 and 1 otherwise. The symbol is ∼ (P ∧ Q). Also, denoted by P |Q, where | is called a Scheffer stroke. (5) NOR gate: output a 0 if at least one of P or Q is 1 and 1 otherwise. The symbol is ∼ (P ∨ Q) or P ↓ Q, where ↓ is a Pierce arrow The logic gates have the following graphical representations:
  46. 46. 46 FUNDAMENTALS OF MATHEMATICAL LOGIC Problem 6.1 Construct the truth tables of the gates discussed in this section. If you are given a set of input signals for a circuit, you can find its output by tracing through the circuit gate by gate. Problem 6.2 Give the output signal S for the following circuit, given that P = 0, Q = 1, and R = 0 : Problem 6.3 Write the input/output table for the circuit of the previous problem. A variable with exactly two possible values is called a Boolean variable. A Boolean expression is an expression composed of Boolean variables and connectives (which are the gates in this section).
  47. 47. 6 PROJECT I: DIGITAL LOGIC DESIGN 47 Problem 6.4 Find the Boolean expression that corresponds to the circuit of Problem 6.1. Problem 6.5 Construct the circuit corresponding to the Boolean expression: (P ∧ Q)∨ ∼ R. Problem 6.6 For the following input/output table, construct (a) the corresponding Boolean expression and (b) the corresponding circuit: P Q R S 1 1 1 0 1 1 0 1 1 0 1 0 1 0 0 0 0 1 1 1 0 1 0 0 0 0 1 0 0 0 0 0 Two digital logic circuits are equivalent if, and only if, their corresponding Boolean expressions are logically equivalent. Problem 6.7 Show that the following two circuits are equivalent: Problem 6.8 Consider the following circuit
  48. 48. 48 FUNDAMENTALS OF MATHEMATICAL LOGIC Let P and Q be single binary digits and P + Q = RS. Complete the fol- lowing table P Q R S 1 1 1 0 0 1 0 0 The given circuit is called a half-adder. It computes the sum of two single binary digits. Several methods have been used for expressing negative numbers in the com- puter. The most obvious way is to convert the number to binary and stick on another bit to indicate sign, 0 for positive and 1 for negative. Suppose that integers are stored using this signed-magnitude technique in 8 bits so that the leftmost bit holds the sign while the remaining bits represent the magnitude. Thus, +4110 = 00101001 and −4110 = 10101001. The above procedure has a gap. How one would represent the bit 0? Well, there are two ways for storing 0. One way is 00000000 which represents +0 and a second way 10000000 represents −0. A method for representing numbers that avoid this problem is called the two’s complement. Con- sidering −4110 again, first, convert the absolute value to binary obtaining 4110 = 00101001. Then take the complement of each bit obtaining 11010110. This is called the one complement of 41. To complete the procedure, in- crement by 1 the one’s complement to obtain −4110 = 11010111. Conversion of +4110 to two’s complement consists merely of expressing the number in binary, i.e. +4110 = 00101001.
  49. 49. 6 PROJECT I: DIGITAL LOGIC DESIGN 49 Problem 6.9 Express the numbers 104 and −104 in two’s complement representation with 8 bits. Now, an algorithm to find the decimal representation of the integer with a given 8-bit two’s complement is the following: 1. Find the two’s complement of the given two’s complement, 2. write the decimal equivalent of the result. Problem 6.10 What is the decimal representation for the integer with two’s complement 10101001?
  50. 50. 50 FUNDAMENTALS OF MATHEMATICAL LOGIC 7 Project II: Number Systems In this section we consider three number systems that are of importance in applications, namely, the decimal system, the binary system, and the hexadecimal system. Decimal numbers are used in communication among human beings whereas binary numbers are used by computers to represent numbers. Consider first the decimal system. If n is a positive integer then n can be written as n = dk dk−1 · · · d1 d0 , where the digits d0 , d1 , · · · , dk are elements of the set {0, 1, 2, · · · , 9}. The number n can be expressed as a sum of powers of 10 as follows: n = dk 10k + dk−1 10k−1 + · · · + d1 101 + d0 100 . For example, 5049 = 5(103 ) + 0(102 ) + 4(101 ) + 9(100 ). A number in binary system is a number n that can be written in the form n = bk bk−1 · · · b1 b0 , where bi is either 0 or 1. We will use subscript to tell the base of which a number is represented. Thus, we write n2 = bk bk−1 · · · b1 b0 to indicate that the number n is in base 2. If n is a number in base 2 then its decimal value (i.e. base 10) is found by the formula: n2 = bk (2k ) + bk−1 (2k−1 ) + · · · + b1 (21 ) + b0 (20 ) = m10 . Problem 7.1 Find the decimal value of the following binary numbers: a. 11001012 b. 1101102
  51. 51. 7 PROJECT II: NUMBER SYSTEMS 51 To convert a positive integer n from base 10 to base 2 we use the division algorithm as follows: (1) n = q0 (2) + r0 , where q0 is the quotient of the division of n by 2 and r0 is the remainder. (2) If q0 = 0 then n is already in base 2. If not then divide q0 by 2 to obtain q0 = q1 (2) + r1 . (3) If q1 = 0 then n10 = r1 r0 . If not repeat the process. Note that the remainders are all less than 2. Suppose that qk = 0 then n10 = rk rk−1 · · · r1 r0 . Problem 7.2 Represent the following decimal integers in binary notation: a. 129710 b. 45810 Problem 7.3 Evaluate the following sums: a. 110111012 + 10010110102 b. 1011012 + 111012 Another useful number system is the hexadecimal system. The possible digits in an hexadecimal system are : 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F where A, B, C, D, E, F stand for 10, 11, 12, 13, 14, and 15 respectively. The conversion of a number from base 16 to base 10 is similar to the conver- sion of numbers from base 2 to base 10. The conversion of a number from base 10 to base 16 is similar to the conversion of a decimal number to base 2. Problem 7.4 Convert the number A2BC16 to base 10. To convert an integer from base 16 to base 2 one performs the following: (1) Write each hexadecimal digit of the integer in fixed 4-bit binary notation. (2) Juxtapose the results.
  52. 52. 52 FUNDAMENTALS OF MATHEMATICAL LOGIC Problem 7.5 Convert the number B53DF 816 to base 2. To convert an integer from base 2 to base 16: (1) Group the digits of the binary number into sets of four bits, starting from the right and adding leading zeros as needed. (2) Convert the binary numbers in (1) to base 16. (3) Juxtapose the results of (2) Problem 7.6 Convert the number 1011011110001012 to base 16.
  53. 53. Fundamentals of Mathematical Proofs In this chapter we discuss some common methods of proof and the standard terminology that accompanies them. 8 Methods of Direct Proof I A mathematical system consists of axioms, definitions, and undefined terms. An axiom is a statement that is assumed to be true. A definition is used to create new concepts in terms of existing ones. A theorem is a proposition that has been proved to be true. A lemma is a theorem that is usually not interesting in its own right but is useful in proving another theorem. A corollary is a theorem that follows quickly from a theorem. Example 8.1 The Euclidean geometry furnishes an example of mathematical system: • points and lines are examples of undefined terms. • An example of a definition: Two angles are supplementary if the sum of their measures is 180◦ . • An example of an axiom: Given two distinct points, there is exactly one line that contains them. • An example of a theorem: If two sides of a triangle are equal, then the angles opposite them are equal. • An example of a corollary: If a triangle is equilateral, then it is equiangular. An argument that establishes the truth of a theorem is called a proof. Logic is a tool for the analysis of proofs. 53
  54. 54. 54 FUNDAMENTALS OF MATHEMATICAL PROOFS First we discuss methods for proving a theorem of the form ”∃x such that P (x).” This theorem guarantees the existence of at least one x for which the predicate P (x) is true. The proof of such a theorem is constructive: that is, the proof is either by finding a particular x that makes P (x) true or by exhibiting an algorithm for finding x. Example 8.2 Show that there exists a positive integer which can be written as the sum of the squares of two numbers. Solution. Indeed, one example is 52 = 32 + 42 Example 8.3 Show that there exists an integer x such that x2 = 15, 129. Solution. Applying the well-known algorithm of extracting the square root we find that x = 123 By a nonconstructive existence proof we mean a method that involves either showing the existence of x using a proved theorem (or axioms) or the assumption that there is no such x leads to a contradiction. The disadvan- tage of nonconstructive method is that it may give virtually no clue about where or how to find x. Theorems are often of the form ”∀x ∈ D if P (x) then Q(x).” We call P (x) the hypothesis and Q(x) the conclusion. Let us first consider a proposition of the form ∀x ∈ D, P (x). Then this can be written in the form ”∀x, if x ∈ D then P (x).” If D is a finite set, then one check the truth value of P (x) for each x ∈ D. This method is called the method of exhaustion. Example 8.4 Show that for each integer 1 ≤ n ≤ 10, n2 − n + 11 is a prime number. Solution. The given proposition can be written in the form ”∀n ∈ IN, if 1 ≤ n ≤ 10
  55. 55. 8 METHODS OF DIRECT PROOF I 55 then P (n)” where P (n) = n2 − n + 11. Using the method of exhaustion we see that P (1) = 11 ; P (2) = 13 ; P (3) = 17 ; P (4) = 23 P (5) = 31 ; P (6) = 41 ; P (7) = 53 ; P (8) = 67 P (9) = 83 ; P (10) = 101. The most powerful technique for proving a universal proposition is one that works regardless of the size of the domain over which the proposition is quantified. It is called the method of generalizing from the generic particular. The method consists of picking an arbitrary element x of the domain (known as a generic element) for which the hypothesis P (x) is satisfied, and then using definitions, previously established results, and the rules of inference to conclude that Q(x) is also true. By a direct method of proof we mean a method that consists of showing that if P (x) is true for x ∈ D then Q(x) is also true. The following shows the format of the proof of a theorem. Theorem 8.1 For all n, m ∈ Z , if m and n are even then so is m + n. Proof. Let m and n be two even integers. Then there exist integers k1 and k2 such that n = 2k1 and m = 2k2 . We must show that m + n is even, that is, an integer multiple of 2. Indeed, m + n = 2k1 + 2k2 = 2(k1 + k2 ) = 2k where k = k1 + k2 ∈ Z . Thus, by the definition of even, m + n is even Example 8.5 Prove the following theorem. Theorem Every integer is a rational number.
  56. 56. 56 FUNDAMENTALS OF MATHEMATICAL PROOFS Solution. n Proof. Let n be an arbitrary integer. Then n = 1 . By the definition of rational numbers, n is rational Theorem 8.2 If a, b ∈ Q then a + b ∈ Q. I I Proof. Let a and b be two rational numbers. Then there exist integers a1 , a2 , b1 = 0, and b2 = 0 such that a = a1 and b = a2 . By the property of addition of two b 1 b 2 fractions we have a + b = a1 + a2 b 1 b 2 a1 b2 +a2 b1 = b1 b2 By letting p = a1 b2 + a2 b1 ∈ Z and q = b1 b2 ∈ Z ∗ we get a + b = p . That is, q a + b ∈QI Corollary 8.1 The double of a rational number is rational. Proof. Let a = b in the previous theorem we see that 2a = a + a = a + b ∈ Q I Next, we point out of some common mistakes that must be avoided in prov- ing theorems. • Arguing from examples. The validity of a general statement can not be proved by just using a particular example. • Using the same letters to mean two different things. For example, sup- pose that m and n are any two given even integers. Then by writing m = 2k and n = 2k this would imply that m = n which is inconsistent with the statement that m and n are arbitrary. • Jumping to a conclusion. Let us illustrate by an example. Suppose that we want to show that if the sum of two integers is even so is their difference. Consider the following proof: Suppose that m + n is even. Then there is an integer k such that m + n = 2k. Then, m = 2k − n and so m − n is even. The problem with this proof is that the crucial step m − n = 2k − n − n = 2(k − n) is missing. The author of the proof has jumped prematurely to a
  57. 57. 8 METHODS OF DIRECT PROOF I 57 conclusion. • Begging the question. By that we mean that the author of a proof uses in his argument a fact that he is supposed to prove. Finally, to show that a proposition of the form ∀x ∈ D, if P (x) then Q(x) is false it suffices to find an element x ∈ D where P (x) is true but Q(x) is false. Such an x is called a counterexample. Example 8.6 Disprove the proposition ∀a, b ∈ IR, if a < b then a2 < b2 . Solution. A counterexample is the following. Let a = −2 and b = −1. Then a < b but a2 > b 2
  58. 58. 58 FUNDAMENTALS OF MATHEMATICAL PROOFS Review Problems A real number r is called rational if there exist two integers a and b = 0 such that r = a . A real number that is not rational is called irrational. b Problem 8.1 Show that the number r = 6.321521521... is a rational number. Problem 8.2 Prove the following theorem. Theorem. The product of two rational numbers is a rational number. Problem 8.3 Use the previous exercise to prove the following. Corollary. The square of any rational number is rational. Problem 8.4 Use the method of constructive proof to show that if r and s are two real numbers then there exists a real number x such that r < x < s. Problem 8.5 The following Pascal program segment does not find the minimum value in a data set of N integers. Find a counterexample. MINN := 0; FOR I := 1 TO N DO BEGIN READLN (A); If A < MINN THEN MINN := A END
  59. 59. 9 MORE METHODS OF PROOF 59 9 More Methods of Proof A vacuous proof is a proof of an implication p → q in which it is shown that p is false. Example 9.1 Use the method of vacuous proof to show that if x ∈ ∅ then David is playing pool. Solution. Since the proposition x ∈ ∅ is always false, the given proposition is vacuously true A trivial proof of an implication p → q is one in which q is shown to be true without any reference to p. Example 9.2 Use the method of trivial proof to show that if n is an even integer then n is divisible by 1. Solution. Since the proposition n is divisible by 1 is always true, the given implication is trivially true The method of proof by cases is a direct method of proving the condi- tional proposition p1 ∨ p2 ∨ · · · ∨ pn → q. The method consists of proving the conditional propositions p1 → q, p2 → q, · · · , pn → q. Example 9.3 Show that if n is a positive integer then n3 + n is even. Solution. We use the method of proof by cases. Case 1. Suppose that n is even. Then there is k ∈ IN such that n = 2k. In this case, n3 + n = 8k 3 + 2k = 2(4k 3 + k) which is even. Case 2. Suppose that n is odd. Then there is a k ∈ IN such that n = 2k + 1. So, n3 + n = 2(4k 3 + 6k 2 + 4k + 1) which is even
  60. 60. 60 FUNDAMENTALS OF MATHEMATICAL PROOFS Example 9.4 Use the proof by cases to prove the triangle inequality: |x + y| ≤ |x| + |y|. Solution. Case 1. x ≥ 0 and y ≥ 0. Then x + y ≥ 0 and so |x + y| = x + y = |x| + |y|. Case 2. x ≥ 0 and y < 0. Then x + y < x + 0 < |x| ≤ |x| + |y|. On the other hand, −(x + y) = −x + (−y) ≤ 0 + (−y) = |y| ≤ |x| + |y|. Thus, if |x + y| = x + y then |x + y| < |x| + |y| and if |x + y| = −(x + y) then |x + y| ≤ |x| + |y|. Case 3. The case x < 0 and y ≥ 0 is similar to case 2. Case 4. Suppose x < 0 and y < 0. Then x + y < 0 and therefore |x + y| = −(x + y) = (−x) + (−y) = |x| + |y|. So in all four cases |x + y| ≤ |x| + |y|. Now, given a real number x. The largest integer n such that n ≤ x < n + 1 is called the floor of x and is denoted by x . The smallest integer n such that n − 1 < x ≤ n is called the ceiling of x and is denoted by x . Example 9.5 Compute x and x of the following values of x : a. 37.999 b. − 57 c. −14.001 2 Solution. a. 37.999 = 37, 37.999 = 38. b. − 57 = −29, − 57 = −28. 2 2 c. −14.001 = −15, −14.001 = −14. Example 9.6 Use the proof by a counterexample to show that the proposition ”∀x, y ∈ IR, x + y = x + y ” is false. Solution. Let x = y = 0.5. Then x + y = 1 and x + y = 0 The following gives another example of the method of proof by cases. Theorem 9.1 For any integer n, n n 2 , if n is even = n−1 2 2 , if n is odd
  61. 61. 9 MORE METHODS OF PROOF 61 Proof. Let n be any integer. Then we consider the following two cases. Case 1. n is odd. In this case, there is an integer k such that n = 2k + 1. Hence, n 2k + 1 1 = = k+ =k 2 2 2 since k ≤ k + 1 < k + 1. Since n = 2k + 1 then solving this equation for k 2 we find k = n−1 . It follows that 2 n n−1 =k= . 2 2 Case 2. Suppose n is even. Then there is an integer k such that n = 2k. Hence, n = k = k = n . 2 2
  62. 62. 62 FUNDAMENTALS OF MATHEMATICAL PROOFS Review Problems Problem 9.1 Prove that for any integer n the product n(n + 1) is even. Problem 9.2 Prove that the square of any integer has the form 4k or 4k + 1 for some integer k Problem 9.3 Prove that for any integer n, n(n2 − 1)(n + 2) is divisible by 4. Theorem 9.2 Given any nonnegative integer n and a positive integer d there exist integers q and r such that n = dq + r and 0 ≤ r < d. The number q is called the quotient of the division of n by d and we write q = n div d. The number r is called the remainder and we write r = n mod d or n ≡ r(mod d). Proof. The proof uses the fact that any nonempty subset of IN has a smallest ele- ment. So let S = {n − d · k ∈ IN : k ∈ Z }. This set is nonempty. Indeed, if n ∈ IN then n = n−0·d ≥ 0 and if n < 0 then n−d·n = n·(1−d) ≥ 0. Thus, S is a nonempty subset of IN so it has a smallest elements, called r. That is, there is an integer q such that n − d · q = r or n = d · q + r. It remains to show that r < d. Suppose the contrary, i.e. r ≥ d. Then n − d · (q + 1) = r − d ≥ 0 so that n − d · (q + 1) ∈ S. Hence, r ≤ n − d · (q + 1) = r − d, a contradiction. Hence, r < d The following theorem shows a way for finding q and r. Theorem 9.3 n If n is a nonnegative integer and d is a positive integer by letting q = d and r = n − d n , we have d n = dq + r, and 0 ≤ r < d. Proof. n Suppose n is a nonnegative integer, d is a positive integer,q = d and r = n − d n . By substitution we have d n n dq + r = d +n−d = n. d d
  63. 63. 9 MORE METHODS OF PROOF 63 It remains to show that 0 ≤ r < d. By the definition of the floor function we have n q ≤ < q + 1. d Multiplying through by d we find dq ≤ n < dq + d. This implies that 0 ≤ n − dq < d. But n r =n−d = n − dq. d Hence, 0 ≤ r < d. This completes a proof of the theorem Problem 9.4 State a necessary and sufficient condition for the floor function of a real number to equal that number Problem 9.5 n Prove that if n is an even integer then 2 = n. 2 Problem 9.6 Show that the equality x − y = x − y is not valid for all real numbers x and y. Problem 9.7 Show that the equality x + y = x + y is not valid for all real numbers x and y. Problem 9.8 Prove that for all real numbers x and all integers m, x + m = x + m. Problem 9.9 n n+1 Show that if n is an odd integer then 2 = 2 .
  64. 64. 64 FUNDAMENTALS OF MATHEMATICAL PROOFS 10 Methods of Indirect Proofs: Contradiction and Contraposition Recall that in a direct proof one starts with the hypothesis of an implication p → q and then prove that the conclusion is true. Any other method of proof will be referred to as an indirect proof. In this section we study two methods of indirect proofs, namely, the proof by contradiction and the proof by contrapositive. • Proof by contradiction: We want to show that p is true. we assume it is not and therefore ∼ p is true and then derive a contradiction. By the rule of contradiction discussed in Chapter 1, p must be true. Theorem 10.1 If n2 is an even integer so is n. Proof. Suppose the contrary. That is suppose that n is odd. Then there is an integer k such that n = 2k + 1. In this case, n2 = 2(2k 2 + 2k) + 1 is odd and this contradicts the assumption that n2 is even. Hence, n must be even Theorem 10.2 √ The number 2 is irrational. Proof. √ Suppose not. That is, suppose that 2 is rational. Then there exist two √ integers m and n with no common divisors such that 2 = m . Squaring n both sides of this equality we find that 2n2 = m2 . Thus, m2 is even. By Theorem 10.1, m is even. That is, 2 divides m. But then m = 2k for some integer k. Taking the square we find that 2n2 = m2 = 4k 2 , that is n2 = 2k 2 . This says that n2 is even and by Theorem 10.1, n is even. We conclude that 2 divides both m and n and this contradcits our assumption that m and n √ have no common divisors. Hence, 2 must be irrational Theorem 10.3 The set of prime numbers is infinite.
  65. 65. 10 METHODS OF INDIRECT PROOFS: CONTRADICTION AND CONTRAPOSITION65 Proof. Suppose not. That is, suppose that the set of prime numbers is finite. Then these prime numbers can be listed, say, p1 , p2 , · · · , pn . Now, consider the inte- ger N = p1 p2 · · · pn +1. By the Unique Factorization Theorem, ( See Exercise ??) N can be factored into primes. Thus, there is a prime number pi such that pi |N. But since pi |p1 p2 · · · pn then pi |(N − p1 p2 · · · pn ) = 1, a contradic- tion since pi > 1. • Proof by contrapositive: We already know that p → q ≡∼ q →∼ p. So to prove p → q we sometimes instead prove ∼ q →∼ p. Theorem 10.4 If n is an integer such that n2 is odd then n is also odd. Proof. Suppose that n is an integer that is even. Then there exists an integer k such that n = 2k. But then n2 = 2(2k 2 ) which is even.
  66. 66. 66 FUNDAMENTALS OF MATHEMATICAL PROOFS Review Problems Problem 10.1 Use the proof by contradiction to prove the proposition ”There is no greatest even integer.” Problem 10.2 Prove by contradiction that the difference of any rational number and any irrational number is irrational. Problem 10.3 Use the proof by contraposition to show that if a product of two positive real numbers is greater than 100, then at least one of the numbers is greater than 10. Problem 10.4 Use the proof by contradiction to show that the product of any nonzero rational number and any irrational number is irrational.
  67. 67. 11 METHOD OF PROOF BY INDUCTION 67 11 Method of Proof by Induction With the emphasis on structured programming has come the development of an area called program verification, which means your program is correct as you are writing it. One technique essential to program verification is mathematical induc- tion, a method of proof that has been useful in every area of mathematics as well. Consider an arbitrary loop in Pascal starting with the statement F OR I := 1 T O N DO If you want to verify that the loop does something regardless of the particular integral value of N, you need mathematical induction. Also, sums of the form n n(n + 1) k= k=1 2 are very useful in analysis of algorithms and a proof of this formula is math- ematical induction. Next we examine this method. We want to prove that some predicate P (n) is true for any nonnegative integer n ≥ n0 . The steps of mathematical induc- tion are as follows: (i) (Basis of induction) Show that P (n0 ) is true. (ii) (Induction hypothesis) Assume P (n) is true. (iii) (Induction step) Show that P (n + 1) is true. Example 11.1 Use the technique of mathematical induction to show that n(n + 1) 1 + 2 + 3 + ··· + n = , n ≥ 1. 2 Solution. Let S(n) = 1 + 2 + · · · + n. Then (i) (Basis of induction) S(1) = 1 = 1(1+1) . That is, S(1)is true. 2 n(n+1) (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = 2 .
  68. 68. 68 FUNDAMENTALS OF MATHEMATICAL PROOFS (n+1)(n+2) (iii) (Induction step) We must show that S(n + 1) = 2 . Indeed, S(n + 1) = 1 + 2 + · · · + n + (n + 1) = S(n) + (n + 1) n(n+1) = 2 + (n + 1) (n+1)(n+2) = 2 Example 11.2 (Geometric progression) a. Let S(n) = n ark , n ≥ 0 where r = 1. Use induction to show that k=0 n+1 S(n) = a(1−r ) . 1−r b. Show that 1 + 1 + · · · + 2n−1 ≤ 2, for all n ≥ 1. 2 1 Solution. a. We use the method of proof by mathematical induction. (i) (Basis of induction) S(0) = a = 0 ark . That is, S(1)is true. k=0 (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = n ark . k=0 a(1−r n+2 ) (iii) (Induction step) We must show that S(n + 1) = 1−r . Indeed, n+1 k S(n + 1) = k=0 ar n+1 = S(n) + ar 1−r n+1 1−r = a 1−r + arn+1 1−r n+1 +r n+1 −r n+2 = a 1−r 1−r n+2 = a 1−r . 1−r b. By a. we have 1−( 1 )n 1+ 1 + 2 1 22 + ··· + 1 2n−1 = 2 1− 12 = 2(1 − ( 1 )n ) 2 1 = 2 − 2n−1 ≤ 2. Example 11.3 (Arithmetic progression) Let S(n) = n (a + (k − 1)r), n ≥ 1. Use induction to show that S(n) = k=1 n 2 [2a + (n − 1)r]. Solution. We use the method of proof by mathematical induction.
  69. 69. 11 METHOD OF PROOF BY INDUCTION 69 (i) (Basis of induction) S(1) = a = 1 [2a + (1 − 1)r]. That is, S(1)is true. 2 (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) = n [2a + (n − 2 1)r]. (iii) (Induction step) We must show that S(n + 1) = (n+1) [2a + nr]. Indeed, 2 n+1 S(n + 1) = k=1 (a + (k − 1)r) = S(n) + a + (n + 1 − 1)r n = 2 [2a + (n − 1)r] + a + nr 2an+n2 r−nr+2a+2nr = 2 2a(n+1)+n(n+1)r = 2 n+1 = 2 [2a + nr]. We next exhibit a theorem whose proof uses mathematical induction. Theorem 11.1 For all integers n ≥ 1, 22n − 1 is divisible by 3. Proof. Let P (n) : 22n − 1 is divisible by 3. Then (i) (Basis of induction) P (1) is true since 3 is divisible by 3. (ii) (Induction hypothesis) Assume P (n) is true. That is, 22n − 1 is divisible by 3. (iii) (Induction step) We must show that 22n+2 − 1 is divisible by 3. Indeed, 22n+2 − 1 = 22n (4) − 1 2n = 2 (3 + 1) − 1 = 2 · 3 + (22n − 1) 2n = 22n · 3 + P (n) Since 3|(22n − 1) and 3|(22n · 3) we have 3|(22n · 3 + 22n − 1). This ends a proof of the theorem Example 11.4 a. Use induction to prove that n < 2n for all non-negative integers n. b. Use induction to prove that 2n < n! for all non-negative integers n ≥ 4. Solution. a. Let S(n) = 2n − n, n ≥ 0. We want to show that S(n) > 0 is valid for all
  70. 70. 70 FUNDAMENTALS OF MATHEMATICAL PROOFS n ≥ 0. By the method of mathematical induction we have (i) (Basis of induction) S(0) = 20 − 0 = 1 > 0. That is, S(0)is true. (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) > 0. (iii) (Induction step) We must show that S(n + 1) > 0. Indeed, S(n + 1) = 2n+1 − (n + 1) = 2n .2 − n − 1 n = 2 (1 + 1) − n − 1 = 2n − n + 2n − 1 = (2n − 1) + S(n) > 2n − 1 ≥ 0 since the smallest value of n is 0 and in this case 20 − 1 = 0. b. Let S(n) = n! − 2n , n ≥ 4. We want to show that S(n) > 0 for all n ≥ 4. By the method of mathematical induction we have (i) (Basis of induction) S(4) = 4! − 24 = 8 > 0. That is, S(4)is true. (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) > 0, n ≥ 4. (iii) (Induction step) We must show that S(n + 1) > 0. Indeed, S(n + 1) = (n + 1)! − 2n+1 = (n + 1)n! − 2n (1 + 1) = n! − 2n + nn! − 2n > 2(n! − 2n ) = 2S(n) > 0 where we have used the fact that if n ≥ 1 then nn! ≥ n! Example 11.5 (Bernoulli’s inequality) Let h > −1. Use induction to show that (1 + nh) ≤ (1 + h)n , n ≥ 0. Solution. Let S(n) = (1 + h)n − (1 + nh). We want to show that S(n) ≥ 0 for all n ≥ 0. We use mathematical induction as follows. (i) (Basis of induction) S(0) = (1 + h)0 − (1 + 0h) = 0. That is, S(0)is true. (ii) (Induction hypothesis) Assume S(n) is true. That is, S(n) ≥ 0, n ≥ 0.
  71. 71. 11 METHOD OF PROOF BY INDUCTION 71 (iii) (Induction step) We must show that S(n + 1) ≥ 0. Indeed, S(n + 1) = (1 + h)n+1 − (1 + (n + 1)h) = (1 + h)(1 + h)n − nh − 1 − h ≥ (1 + h)(1 + nh) − nh − 1 − h = nh2 ≥ 0. Example 11.6 Define the following sequence of numbers: a1 = 2 and for n ≥ 2, an = 5an−1 . Find a formula for an and then prove its validity by mathematical induction. Solution. Listing the first few terms we find, a1 = 2, a2 = 10, a3 = 50, a4 = 250. Thus, an = 2.5n−1 . We will show that this formula is valid for all n ≥ 1 by the method of mathematical induction. (i) (Basis of induction) a1 = 2 = 2.51−1 . That is, a1 is true. (ii) (Induction hypothesis) Assume an is true. That is, an = 2.5n−1 (iii) (Induction step) We must show that an+1 = 2.5n . Indeed, an+1 = 5an = 5(2.5n−1 ) = 2.5n .
  72. 72. 72 FUNDAMENTALS OF MATHEMATICAL PROOFS Review Problems Problem 11.1 Use the method of induction to show that 2 + 4 + 6 + · · · + 2n = n2 + n for all integers n ≥ 1. Problem 11.2 Use mathematical induction to prove that 1 + 2 + 22 + · · · + 2n = 2n+1 − 1 for all integers n ≥ 0. Problem 11.3 Use mathematical induction to show that n(n + 1)(2n + 1) 12 + 22 + · · · + n2 = 6 for all integers n ≥ 1. Problem 11.4 Use mathematical induction to show that 2 3 3 3 n(n + 1) 1 + 2 + ··· + n = 2 for all integers n ≥ 1. Problem 11.5 Use mathematical induction to show that 1 1 1 n + + ··· + = 1·2 2·3 n(n + 1) n+1 for all integers n ≥ 1.
  73. 73. 11 METHOD OF PROOF BY INDUCTION 73 Problem 11.6 Use the formula n(n + 1) 1 + 2 + ··· + n = 2 to find the value of the sum 3 + 4 + · · · + 1, 000. Problem 11.7 Find the value of the geometric sum 1 1 1 1 + + 2 + ··· + n. 2 2 2 Problem 11.8 Let S(n) = n (k+1)! . Evaluate S(1), S(2), S(3), S(4), and S(5). Make a k=1 k conjecture about a formula for this sum for general n, and prove your con- jecture by mathematical induction. Problem 11.9 For each positive integer n let P (n) be the proposition 4n −1 is divisible by 3. a. Write P (1). Is P (1) true? b. Write P (k). c. Write P (k + 1). d. In a proof by mathematical induction that this divisibility property holds for all integers n ≥ 1, what must be shown in the induction step? Problem 11.10 For each positive integer n let P (n) be the proposition 23n − 1 is divisible by 7. Prove this property by mathematical induction. Problem 11.11 Show that 2n < (n + 2)! for all integers n ≥ 0. Problem 11.12 a. Use mathematical induction to show that n3 > 2n + 1 for all integers n ≥ 2. b. Use mathematical induction to show that n! > n2 for all integers n ≥ 4. Problem 11.13 A sequence a1 , a2 , · · · is defined by a1 = 3 and an = 7an−1 for n ≥ 2. Show that an = 3 · 7n−1 for all integers n ≥ 1.
  74. 74. 74 FUNDAMENTALS OF MATHEMATICAL PROOFS 12 Project III: Elementary Number Theory and Mathematical Proofs Recall that the set of positive integers together with zero is denoted by IN. The set of all integers is denoted by Z and the set of rational numbers is denoted by Q. I We say that an integer n is even if and only if there exists an integer k such that n = 2k. An integer n is said to be odd if and only if there exists an integer k such that n = 2k + 1. Problem 12.1 Let m and n be two integers. a. Is 6m + 8n an even integer? b. Is 6m + 4n2 + 3 odd? Let a and b be two integers with a = 0. We say that b is divisible by a, written a|b, if there exists an integer k such that b = ka. In this case we say that a divides b, a is a factor of b, and b is a multiple of a. For example, 3 |7 whereas 3|12. Problem 12.2 Prove the following theorem. Theorem 12.1 Let a = 0, b = 0, and c be integers. (i) If a|b and a|c then a|(b ± c). (ii) If a|b then a|bc. (iii) If a|b and b|c then a|c. A positive integer p > 1 is called prime if 1 and p are the only divisors of p. A number which is not prime is called a composite number. For example, 3 is prime whereas 10 is composite. Problem 12.3 Let m and n be positive integers with m > n. Is m2 − n2 composite? Problem 12.4 Write the first 7 prime numbers.

×