198
k Q¸@ Æ g Q¸@ Ø <¸@ . Chapter 1 The Foundations: Logic and Proofs Second Semester 2018-2019 A ¸@ A º Æ @.X. @ 1 / 52

Chapter 1 The Foundations: Logic and Proofs

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Chapter 1 The Foundations: Logic and Proofs

Õ�æk�

��QË @ á�

�Ôg

��QË @ é�

��<Ë @ Õ

��.�

Chapter 1The Foundations: Logic and

ProofsSecond Semester 2018-2019

A��®

��Ë@ Õæ

��A

�ë á�Üß

@ . X .

@

1 / 52

Page 2: Chapter 1 The Foundations: Logic and Proofs

Chapter 1 The Foundations: Logic and Proofs

The word “discrete” means separate or distinct.

Mathematicians view it as the opposite of “continuous.”

Whereas, in calculus, it is continuous functions of a realvariable that are important, such functions are of relativelylittle interest in discrete mathematics.

Instead of the real numbers, it is the natural numbers1, 2, 3, · · · that play a fundamental role, and it is functions withdomain the natural numbers that are often studied.

Perhaps the best way to summarize the subject matter of thiscourse is to say that discrete mathematics is the study ofproblems associated with the natural numbers.

2 / 52

Page 3: Chapter 1 The Foundations: Logic and Proofs

Chapter 1 The Foundations: Logic and Proofs

The word “discrete” means separate or distinct.

Mathematicians view it as the opposite of “continuous.”

Whereas, in calculus, it is continuous functions of a realvariable that are important, such functions are of relativelylittle interest in discrete mathematics.

Instead of the real numbers, it is the natural numbers1, 2, 3, · · · that play a fundamental role, and it is functions withdomain the natural numbers that are often studied.

Perhaps the best way to summarize the subject matter of thiscourse is to say that discrete mathematics is the study ofproblems associated with the natural numbers.

2 / 52

Page 4: Chapter 1 The Foundations: Logic and Proofs

Chapter 1 The Foundations: Logic and Proofs

The word “discrete” means separate or distinct.

Mathematicians view it as the opposite of “continuous.”

Whereas, in calculus, it is continuous functions of a realvariable that are important, such functions are of relativelylittle interest in discrete mathematics.

Instead of the real numbers, it is the natural numbers1, 2, 3, · · · that play a fundamental role, and it is functions withdomain the natural numbers that are often studied.

Perhaps the best way to summarize the subject matter of thiscourse is to say that discrete mathematics is the study ofproblems associated with the natural numbers.

2 / 52

Page 5: Chapter 1 The Foundations: Logic and Proofs

Chapter 1 The Foundations: Logic and Proofs

The word “discrete” means separate or distinct.

Mathematicians view it as the opposite of “continuous.”

Whereas, in calculus, it is continuous functions of a realvariable that are important, such functions are of relativelylittle interest in discrete mathematics.

Instead of the real numbers, it is the natural numbers1, 2, 3, · · · that play a fundamental role, and it is functions withdomain the natural numbers that are often studied.

Perhaps the best way to summarize the subject matter of thiscourse is to say that discrete mathematics is the study ofproblems associated with the natural numbers.

2 / 52

Page 6: Chapter 1 The Foundations: Logic and Proofs

Chapter 1 The Foundations: Logic and Proofs

The word “discrete” means separate or distinct.

Mathematicians view it as the opposite of “continuous.”

Whereas, in calculus, it is continuous functions of a realvariable that are important, such functions are of relativelylittle interest in discrete mathematics.

Instead of the real numbers, it is the natural numbers1, 2, 3, · · · that play a fundamental role, and it is functions withdomain the natural numbers that are often studied.

Perhaps the best way to summarize the subject matter of thiscourse is to say that discrete mathematics is the study ofproblems associated with the natural numbers.

2 / 52

Page 7: Chapter 1 The Foundations: Logic and Proofs

Discrete mathematics is quite different from other areas inmathematics which you may have already studied, such asalgebra, geometry, or calculus.

It is much less structured; there are far fewer standardtechniques to learn.

It is, however, a rich subject full of ideas at least some of whichwe hope will intrigue you to the extent that you will want tolearn more about them.

Logic is the basis of all mathematical reasoning, and of allautomated reasoning.

It has practical applications to the design of computingmachines, to the specification of systems, to artificialintelligence, to computer programming, to programminglanguages, and to other areas of computer science, as well as tomany other fields of study.

3 / 52

Page 8: Chapter 1 The Foundations: Logic and Proofs

Discrete mathematics is quite different from other areas inmathematics which you may have already studied, such asalgebra, geometry, or calculus.

It is much less structured; there are far fewer standardtechniques to learn.

It is, however, a rich subject full of ideas at least some of whichwe hope will intrigue you to the extent that you will want tolearn more about them.

Logic is the basis of all mathematical reasoning, and of allautomated reasoning.

It has practical applications to the design of computingmachines, to the specification of systems, to artificialintelligence, to computer programming, to programminglanguages, and to other areas of computer science, as well as tomany other fields of study.

3 / 52

Page 9: Chapter 1 The Foundations: Logic and Proofs

Discrete mathematics is quite different from other areas inmathematics which you may have already studied, such asalgebra, geometry, or calculus.

It is much less structured; there are far fewer standardtechniques to learn.

It is, however, a rich subject full of ideas at least some of whichwe hope will intrigue you to the extent that you will want tolearn more about them.

Logic is the basis of all mathematical reasoning, and of allautomated reasoning.

It has practical applications to the design of computingmachines, to the specification of systems, to artificialintelligence, to computer programming, to programminglanguages, and to other areas of computer science, as well as tomany other fields of study.

3 / 52

Page 10: Chapter 1 The Foundations: Logic and Proofs

Discrete mathematics is quite different from other areas inmathematics which you may have already studied, such asalgebra, geometry, or calculus.

It is much less structured; there are far fewer standardtechniques to learn.

It is, however, a rich subject full of ideas at least some of whichwe hope will intrigue you to the extent that you will want tolearn more about them.

Logic is the basis of all mathematical reasoning, and of allautomated reasoning.

It has practical applications to the design of computingmachines, to the specification of systems, to artificialintelligence, to computer programming, to programminglanguages, and to other areas of computer science, as well as tomany other fields of study.

3 / 52

Page 11: Chapter 1 The Foundations: Logic and Proofs

Discrete mathematics is quite different from other areas inmathematics which you may have already studied, such asalgebra, geometry, or calculus.

It is much less structured; there are far fewer standardtechniques to learn.

It is, however, a rich subject full of ideas at least some of whichwe hope will intrigue you to the extent that you will want tolearn more about them.

Logic is the basis of all mathematical reasoning, and of allautomated reasoning.

It has practical applications to the design of computingmachines, to the specification of systems, to artificialintelligence, to computer programming, to programminglanguages, and to other areas of computer science, as well as tomany other fields of study.

3 / 52

Page 12: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.

In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 13: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.

Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 14: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.

The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 15: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.

The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 16: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.

The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 17: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.

We introduce a minimal amount of mathematical logic whichlies behind the concept of proof.

4 / 52

Page 18: Chapter 1 The Foundations: Logic and Proofs

Everyone knows that proofs are important throughoutmathematics, but many people find it surprising how importantproofs are in computer science.In fact, proofs are used to verify that computer programsproduce the correct output for all possible input values, to showthat algorithms always produce the correct result, to establishthe security of a system, and to create artificial intelligence.Furthermore, automated reasoning systems have been createdto allow computers to construct their own proofs.The study of logic is the study of the principles and methodsused in distinguishing valid arguments from those that are notvalid.The aim of this chapter is to help the student to understandthe principles and methods used in each step of a proof.The starting point in logic is the term proposition (orstatement) which is used in a technical sense.We introduce a minimal amount of mathematical logic whichlies behind the concept of proof. 4 / 52

Page 19: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 20: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 21: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 22: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 23: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 24: Chapter 1 The Foundations: Logic and Proofs

1.1 Propositional Logic

When we prove theorems in mathematics, we aredemonstrating the truth of certain statements.

We therefore need to start our discussion of logic with a look atstatements, and at how we recognize certain statements as trueor false.

Besides the importance of logic in understanding mathematicalreasoning, logic has numerous applications to computer science.

These rules are used in the design of computer circuits, theconstruction of computer programs, the verification of thecorrectness of programs, and in many other ways.

Furthermore, software systems have been developed forconstructing some, but not all, types of proofs automatically.

We will discuss these applications of logic in this and laterchapters.

5 / 52

Page 25: Chapter 1 The Foundations: Logic and Proofs

Definition

(Proposition) QKQ�®�K ,

�éJ

�¯

A proposition is a declarative sentence ( a sentence that declares afact) that is either true or false.

Remark

A proposition is also called a statement.

6 / 52

Page 26: Chapter 1 The Foundations: Logic and Proofs

Definition

(Proposition) QKQ�®�K ,

�éJ

�¯

A proposition is a declarative sentence ( a sentence that declares afact) that is either true or false.

Remark

A proposition is also called a statement.

6 / 52

Page 27: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 28: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 29: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 30: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 31: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 32: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

The following sentences are propositions

(a) Gaza is a Palestinian city.

(b) 2− 1 equals 3.

(c) The equation x2 + 1 = 0 has two real solutions.

(d) IUG is a Palestinian university.

(e) Earth is the closest planet to the sun.

7 / 52

Page 33: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 34: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 35: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 36: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 37: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 38: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 39: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 40: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 41: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 42: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

The following sentences are NOT propositions:

(a) How are you?

(b) Gaza is a beautiful city.

(c) The sky is reach.

(d) 4+1.

(e) I will come to school next week.

(f) Would you visit us tomorrow.

(g) He lives in Gaza.

(h) x2 = 9.

Remark

Commends, questions, and opinions are not propositions.

8 / 52

Page 43: Chapter 1 The Foundations: Logic and Proofs

The area of logic that deals with propositions is called thepropositional calculus or propositional logic.

It was first developed systematically by the Greek philosopherAristotle more than 2300 years ago.

9 / 52

Page 44: Chapter 1 The Foundations: Logic and Proofs

The area of logic that deals with propositions is called thepropositional calculus or propositional logic.

It was first developed systematically by the Greek philosopherAristotle more than 2300 years ago.

9 / 52

Page 45: Chapter 1 The Foundations: Logic and Proofs

Compound Propositions

We now turn our attention to methods for producing newpropositions from those that we already have.

These methods were discussed by the English mathematicianGeorge Boole in 1854 in his book “The Laws of Thought”.

Many mathematical statements are constructed by combiningone or more propositions.

New propositions, called compound propositions, are formedfrom existing propositions using logical operators.

A compound proposition is a proposition that has at least onelogical operator (connective).

10 / 52

Page 46: Chapter 1 The Foundations: Logic and Proofs

Compound Propositions

We now turn our attention to methods for producing newpropositions from those that we already have.

These methods were discussed by the English mathematicianGeorge Boole in 1854 in his book “The Laws of Thought”.

Many mathematical statements are constructed by combiningone or more propositions.

New propositions, called compound propositions, are formedfrom existing propositions using logical operators.

A compound proposition is a proposition that has at least onelogical operator (connective).

10 / 52

Page 47: Chapter 1 The Foundations: Logic and Proofs

Compound Propositions

We now turn our attention to methods for producing newpropositions from those that we already have.

These methods were discussed by the English mathematicianGeorge Boole in 1854 in his book “The Laws of Thought”.

Many mathematical statements are constructed by combiningone or more propositions.

New propositions, called compound propositions, are formedfrom existing propositions using logical operators.

A compound proposition is a proposition that has at least onelogical operator (connective).

10 / 52

Page 48: Chapter 1 The Foundations: Logic and Proofs

Compound Propositions

We now turn our attention to methods for producing newpropositions from those that we already have.

These methods were discussed by the English mathematicianGeorge Boole in 1854 in his book “The Laws of Thought”.

Many mathematical statements are constructed by combiningone or more propositions.

New propositions, called compound propositions, are formedfrom existing propositions using logical operators.

A compound proposition is a proposition that has at least onelogical operator (connective).

10 / 52

Page 49: Chapter 1 The Foundations: Logic and Proofs

Compound Propositions

We now turn our attention to methods for producing newpropositions from those that we already have.

These methods were discussed by the English mathematicianGeorge Boole in 1854 in his book “The Laws of Thought”.

Many mathematical statements are constructed by combiningone or more propositions.

New propositions, called compound propositions, are formedfrom existing propositions using logical operators.

A compound proposition is a proposition that has at least onelogical operator (connective).

10 / 52

Page 50: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 51: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 52: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 53: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 54: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 55: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 56: Chapter 1 The Foundations: Logic and Proofs

Example

The following sentences are compound statements:

(a) Gaza is a Palestinian city and Palestine is an arabic country.

(b) 2− 1 equals 3 or 7 is divisible by 2.

(c) If 5 is an integer, then 5 is a real number.

(d) 2 divides 6 if and only if 2× 3 = 6.

(e) π is not a rational number.

Notation

We will denote simple statements by lowercase letters p, q, r , ....

11 / 52

Page 57: Chapter 1 The Foundations: Logic and Proofs

Fundamental logical operators (connectives)

To form new compound statements out of old ones we use thefollowing five fundamental logical operators:

1 “not” symbolized by ¬.

2 “and” symbolized by ∧.

3 “or” symbolized by ∨.

4 “If..., then ...” symbolized by −→.

5 “...if and only if ...” symbolized by ←→.

12 / 52

Page 58: Chapter 1 The Foundations: Logic and Proofs

Fundamental logical operators (connectives)

To form new compound statements out of old ones we use thefollowing five fundamental logical operators:

1 “not” symbolized by ¬.

2 “and” symbolized by ∧.

3 “or” symbolized by ∨.

4 “If..., then ...” symbolized by −→.

5 “...if and only if ...” symbolized by ←→.

12 / 52

Page 59: Chapter 1 The Foundations: Logic and Proofs

Fundamental logical operators (connectives)

To form new compound statements out of old ones we use thefollowing five fundamental logical operators:

1 “not” symbolized by ¬.

2 “and” symbolized by ∧.

3 “or” symbolized by ∨.

4 “If..., then ...” symbolized by −→.

5 “...if and only if ...” symbolized by ←→.

12 / 52

Page 60: Chapter 1 The Foundations: Logic and Proofs

Fundamental logical operators (connectives)

To form new compound statements out of old ones we use thefollowing five fundamental logical operators:

1 “not” symbolized by ¬.

2 “and” symbolized by ∧.

3 “or” symbolized by ∨.

4 “If..., then ...” symbolized by −→.

5 “...if and only if ...” symbolized by ←→.

12 / 52

Page 61: Chapter 1 The Foundations: Logic and Proofs

Fundamental logical operators (connectives)

To form new compound statements out of old ones we use thefollowing five fundamental logical operators:

1 “not” symbolized by ¬.

2 “and” symbolized by ∧.

3 “or” symbolized by ∨.

4 “If..., then ...” symbolized by −→.

5 “...if and only if ...” symbolized by ←→.

12 / 52

Page 62: Chapter 1 The Foundations: Logic and Proofs

Truth tables

A truth table is a mathematical table used in logic whichdetermines the truth values of a compound proposition form forall logical possibilities of its components.

A truth table has one column for each component and one finalcolumn for the compound proposition.

Each row of the truth table contains one possible truth valuefor each component and the result of the logical operation forthose values.

We will use ”T” for true and ”F” for false.

13 / 52

Page 63: Chapter 1 The Foundations: Logic and Proofs

Truth tables

A truth table is a mathematical table used in logic whichdetermines the truth values of a compound proposition form forall logical possibilities of its components.

A truth table has one column for each component and one finalcolumn for the compound proposition.

Each row of the truth table contains one possible truth valuefor each component and the result of the logical operation forthose values.

We will use ”T” for true and ”F” for false.

13 / 52

Page 64: Chapter 1 The Foundations: Logic and Proofs

Truth tables

A truth table is a mathematical table used in logic whichdetermines the truth values of a compound proposition form forall logical possibilities of its components.

A truth table has one column for each component and one finalcolumn for the compound proposition.

Each row of the truth table contains one possible truth valuefor each component and the result of the logical operation forthose values.

We will use ”T” for true and ”F” for false.

13 / 52

Page 65: Chapter 1 The Foundations: Logic and Proofs

Truth tables

A truth table is a mathematical table used in logic whichdetermines the truth values of a compound proposition form forall logical possibilities of its components.

A truth table has one column for each component and one finalcolumn for the compound proposition.

Each row of the truth table contains one possible truth valuefor each component and the result of the logical operation forthose values.

We will use ”T” for true and ”F” for false.

13 / 52

Page 66: Chapter 1 The Foundations: Logic and Proofs

Negation

Definition

The connective ¬ is called the negation and it may be placed beforeany proposition p to form a compound proposition ¬p (read: not por the negation of p). The truth values for ¬p are defined as follows:

p ¬pT F

F T

Remark

If p is a proposition, then ¬p is the statement “It is not the casethat p”.

14 / 52

Page 67: Chapter 1 The Foundations: Logic and Proofs

Negation

Definition

The connective ¬ is called the negation and it may be placed beforeany proposition p to form a compound proposition ¬p (read: not por the negation of p). The truth values for ¬p are defined as follows:

p ¬pT F

F T

Remark

If p is a proposition, then ¬p is the statement “It is not the casethat p”.

14 / 52

Page 68: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the negation of each of the following propositions and expressit in simple English:

(a)√

2 is a rational number.

(b) Ahmed’s PC runs Linux.

Solution

15 / 52

Page 69: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the negation of each of the following propositions and expressit in simple English:

(a)√

2 is a rational number.

(b) Ahmed’s PC runs Linux.

Solution

15 / 52

Page 70: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the negation of each of the following propositions and expressit in simple English:

(a)√

2 is a rational number.

(b) Ahmed’s PC runs Linux.

Solution

15 / 52

Page 71: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the negation of each of the following propositions and expressit in simple English:

(a)√

2 is a rational number.

(b) Ahmed’s PC runs Linux.

Solution

15 / 52

Page 72: Chapter 1 The Foundations: Logic and Proofs

Conjunction

Definition

The connective ∧ is called the conjunction and it may be placedbetween any two propositions p and q to form a compoundproposition p ∧ q (read: p and q or the conjunction of p and q).The truth values for p ∧ q are defined as follows:

p q p ∧ q

T T T

T F F

F T F

F F F

16 / 52

Page 73: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ∧ q is true only when both p and q are true.

(2) In a compound proposition with two components p and q thereare 2× 2 = 4 possibilities, called the logical possibilities. Ingeneral, if a compound proposition has n components, thenthere are 2n logical possibilities.

17 / 52

Page 74: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ∧ q is true only when both p and q are true.

(2) In a compound proposition with two components p and q thereare 2× 2 = 4 possibilities, called the logical possibilities. Ingeneral, if a compound proposition has n components, thenthere are 2n logical possibilities.

17 / 52

Page 75: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ∧ q is true only when both p and q are true.

(2) In a compound proposition with two components p and q thereare 2× 2 = 4 possibilities, called the logical possibilities. Ingeneral, if a compound proposition has n components, thenthere are 2n logical possibilities.

17 / 52

Page 76: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 77: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 78: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 79: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 80: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 81: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following proposition is T and which is F:

(a) 1 + 1 = 2 and 3− 1 = 2.

(b) 5 is an integer and 1− 3 = 1.

(c) 5− 0 = 4 and 5− 1 = 4.

(d) 5× 2 = 5 and 5× 3 = 10.

Solution

18 / 52

Page 82: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct a truth table for the compound proposition p ∧ (¬q).

Solution

19 / 52

Page 83: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct a truth table for the compound proposition p ∧ (¬q).

Solution

19 / 52

Page 84: Chapter 1 The Foundations: Logic and Proofs

Remark

The English words but, while, and although are usually translatedsymbolically with the conjunction connective, because they have thesame meaning as and.

Example

Translate the following statement into logical form usingconnectives: “ 8 is divisible by 2 but it is not divisible by 3.”

Solution

20 / 52

Page 85: Chapter 1 The Foundations: Logic and Proofs

Remark

The English words but, while, and although are usually translatedsymbolically with the conjunction connective, because they have thesame meaning as and.

Example

Translate the following statement into logical form usingconnectives: “ 8 is divisible by 2 but it is not divisible by 3.”

Solution

20 / 52

Page 86: Chapter 1 The Foundations: Logic and Proofs

Remark

The English words but, while, and although are usually translatedsymbolically with the conjunction connective, because they have thesame meaning as and.

Example

Translate the following statement into logical form usingconnectives: “ 8 is divisible by 2 but it is not divisible by 3.”

Solution

20 / 52

Page 87: Chapter 1 The Foundations: Logic and Proofs

Disjunction

In English language there is an ambiguity involved in the use of“or”.

Inclusive or: The statement “I will get a Master degree or a Ph.D” indicate that the speaker will get both the Master degreeand the Ph. D.

Exclusive or: But in the statement “I will study mathematics orphysics ” means that only one of the two fields will be chosen.

In mathematics and logic we can not allow ambiguity. Hencewe must decide on the meaning of the word “or”.

21 / 52

Page 88: Chapter 1 The Foundations: Logic and Proofs

Disjunction

In English language there is an ambiguity involved in the use of“or”.

Inclusive or: The statement “I will get a Master degree or a Ph.D” indicate that the speaker will get both the Master degreeand the Ph. D.

Exclusive or: But in the statement “I will study mathematics orphysics ” means that only one of the two fields will be chosen.

In mathematics and logic we can not allow ambiguity. Hencewe must decide on the meaning of the word “or”.

21 / 52

Page 89: Chapter 1 The Foundations: Logic and Proofs

Disjunction

In English language there is an ambiguity involved in the use of“or”.

Inclusive or: The statement “I will get a Master degree or a Ph.D” indicate that the speaker will get both the Master degreeand the Ph. D.

Exclusive or: But in the statement “I will study mathematics orphysics ” means that only one of the two fields will be chosen.

In mathematics and logic we can not allow ambiguity. Hencewe must decide on the meaning of the word “or”.

21 / 52

Page 90: Chapter 1 The Foundations: Logic and Proofs

Disjunction

In English language there is an ambiguity involved in the use of“or”.

Inclusive or: The statement “I will get a Master degree or a Ph.D” indicate that the speaker will get both the Master degreeand the Ph. D.

Exclusive or: But in the statement “I will study mathematics orphysics ” means that only one of the two fields will be chosen.

In mathematics and logic we can not allow ambiguity. Hencewe must decide on the meaning of the word “or”.

21 / 52

Page 91: Chapter 1 The Foundations: Logic and Proofs

Disjunction

Definition

The connective ∨ is called the disjunction and it may be placedbetween any two propositions p and q to form the compoundproposition p ∨ q (read: p or q or the disjunction of p and q). Thetruth values for p ∨ q are defined as follows:

p q p ∨ q

T T T

T F T

F T T

F F F

Remark

The proposition p ∨ q is true when at least one of p and q is true.

22 / 52

Page 92: Chapter 1 The Foundations: Logic and Proofs

Disjunction

Definition

The connective ∨ is called the disjunction and it may be placedbetween any two propositions p and q to form the compoundproposition p ∨ q (read: p or q or the disjunction of p and q). Thetruth values for p ∨ q are defined as follows:

p q p ∨ q

T T T

T F T

F T T

F F F

Remark

The proposition p ∨ q is true when at least one of p and q is true.

22 / 52

Page 93: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 94: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 95: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 96: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 97: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 98: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Indicate which of the following propositions is T and which is F:

(a) 3 + 3 = 6 or 1− 1 = 1 .

(b) 4 > 4 or 4 = 4.

(c)√−1 = 2 or (2)2 = −1.

(d) 7 is a prime number or 7 is an odd number.

Solution

23 / 52

Page 99: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct the truth table for the compound proposition ¬[p ∨ (¬q)].

Solution

24 / 52

Page 100: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct the truth table for the compound proposition ¬[p ∨ (¬q)].

Solution

24 / 52

Page 101: Chapter 1 The Foundations: Logic and Proofs

Exclusive or

Definition

The connective ⊕ is called the exclusive or and it may be placedbetween any two propositions p and q to form the compoundproposition p ⊕ q (read: the exclusive or of p and q). The truthvalues for p ⊕ q are defined as follows:

p q p ⊕ q

T T F

T F T

F T T

F F F

25 / 52

Page 102: Chapter 1 The Foundations: Logic and Proofs

Conditional Statements

We will discuss two other important ways to combinepropositions.

Definition

The connective → is called the conditional and it may be placedbetween any two propositions p and q to form the compoundproposition p → q (read: if p then q). The truth values of p → qare defined by the following table:

p q p → q

T T T

T F F

F T T

F F T

26 / 52

Page 103: Chapter 1 The Foundations: Logic and Proofs

Conditional Statements

We will discuss two other important ways to combinepropositions.

Definition

The connective → is called the conditional and it may be placedbetween any two propositions p and q to form the compoundproposition p → q (read: if p then q). The truth values of p → qare defined by the following table:

p q p → q

T T T

T F F

F T T

F F T

26 / 52

Page 104: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p → q is false only when p is true and q isfalse.

(2) In a conditional proposition p → q, p is called the hypothesis(or antecedent or premise) and q is called the conclusion (orconsequent).

(3) A conditional statement p → q is also called an implication.

27 / 52

Page 105: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p → q is false only when p is true and q isfalse.

(2) In a conditional proposition p → q, p is called the hypothesis(or antecedent or premise) and q is called the conclusion (orconsequent).

(3) A conditional statement p → q is also called an implication.

27 / 52

Page 106: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p → q is false only when p is true and q isfalse.

(2) In a conditional proposition p → q, p is called the hypothesis(or antecedent or premise) and q is called the conclusion (orconsequent).

(3) A conditional statement p → q is also called an implication.

27 / 52

Page 107: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p → q is false only when p is true and q isfalse.

(2) In a conditional proposition p → q, p is called the hypothesis(or antecedent or premise) and q is called the conclusion (orconsequent).

(3) A conditional statement p → q is also called an implication.

27 / 52

Page 108: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) If 2− 4 = 2, then 2− 2 = 4.

(b) If 7 < 9, then 7 < 8.

(c) If 3 > 3, then 4 > 3.

(d) If 5 < 6, then 5 is even.

28 / 52

Page 109: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) If 2− 4 = 2, then 2− 2 = 4.

(b) If 7 < 9, then 7 < 8.

(c) If 3 > 3, then 4 > 3.

(d) If 5 < 6, then 5 is even.

28 / 52

Page 110: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) If 2− 4 = 2, then 2− 2 = 4.

(b) If 7 < 9, then 7 < 8.

(c) If 3 > 3, then 4 > 3.

(d) If 5 < 6, then 5 is even.

28 / 52

Page 111: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) If 2− 4 = 2, then 2− 2 = 4.

(b) If 7 < 9, then 7 < 8.

(c) If 3 > 3, then 4 > 3.

(d) If 5 < 6, then 5 is even.

28 / 52

Page 112: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) If 2− 4 = 2, then 2− 2 = 4.

(b) If 7 < 9, then 7 < 8.

(c) If 3 > 3, then 4 > 3.

(d) If 5 < 6, then 5 is even.

28 / 52

Page 113: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct the truth table for the compound proposition (p ∨ q)→ r .

29 / 52

Page 114: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Let p be the statement “Ali learns discrete mathematics” and q thestatement “Ali will find a good job.” Express the statement p −→ qas a statement in English.

Solution

30 / 52

Page 115: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Let p be the statement “Ali learns discrete mathematics” and q thestatement “Ali will find a good job.” Express the statement p −→ qas a statement in English.

Solution

30 / 52

Page 116: Chapter 1 The Foundations: Logic and Proofs

Remark

The if-then construction used in many programming languages isdifferent from that used in logic. Most programming languagescontain statements such as if p then S , where p is a proposition andS is a program segment (one or more statements to be executed).When execution of a program encounters such a statement, S isexecuted if p is true, but S is not executed if p is false.

31 / 52

Page 117: Chapter 1 The Foundations: Logic and Proofs

Example

Example

What is the value of the variable x after the statement “if 2 - 1 = 1then x := x + 1” if x = 5 before this statement is encountered?(The symbol := stands for assignment. The statement x := x + 1means the assignment of the value of x + 1 to x .)

Solution

32 / 52

Page 118: Chapter 1 The Foundations: Logic and Proofs

Example

Example

What is the value of the variable x after the statement “if 2 - 1 = 1then x := x + 1” if x = 5 before this statement is encountered?(The symbol := stands for assignment. The statement x := x + 1means the assignment of the value of x + 1 to x .)

Solution

32 / 52

Page 119: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 120: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 121: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 122: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 123: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 124: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 125: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 126: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 127: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p → q to translate the following propositions:

1 If p, then q.

2 p only if q.

3 q if p.

4 p is sufficient to q.

5 q is necessary for p.

6 q whenever p.

7 q when p.

8 p implies q.

33 / 52

Page 128: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 129: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 130: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 131: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 132: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 133: Chapter 1 The Foundations: Logic and Proofs

Converse, Contrapositive, and Inverse

We can form some new conditional statements starting with aconditional statement p −→ q.

In particular, there are three related conditional statements thatoccur so often that they have special names.

Definition

Let p and q be propositions.

(1) The converse of p → q is q → p.

(2) The contrapositive of p → q is ¬q → ¬p.

(3) The inverse of p → q is ¬p → ¬q.

34 / 52

Page 134: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the contrapositive, the converse, and the inverse of theconditional statement “The home team wins whenever it is raining.”

Solution

35 / 52

Page 135: Chapter 1 The Foundations: Logic and Proofs

Example

Example

Find the contrapositive, the converse, and the inverse of theconditional statement “The home team wins whenever it is raining.”

Solution

35 / 52

Page 136: Chapter 1 The Foundations: Logic and Proofs

Biconditionals

We now introduce a new way to combine propositions thatexpresses that two propositions have the same truth value.

Definition

The connective ↔ is called the biconditional and it may be placedbetween any two propositions p and q to form the compoundproposition p ↔ q (read: p if and only if q). The truth values ofp → q are given by the following table

p q p ↔ q

T T T

T F F

F T F

F F T

36 / 52

Page 137: Chapter 1 The Foundations: Logic and Proofs

Biconditionals

We now introduce a new way to combine propositions thatexpresses that two propositions have the same truth value.

Definition

The connective ↔ is called the biconditional and it may be placedbetween any two propositions p and q to form the compoundproposition p ↔ q (read: p if and only if q). The truth values ofp → q are given by the following table

p q p ↔ q

T T T

T F F

F T F

F F T

36 / 52

Page 138: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ↔ q is true when both p and qhave the same truth values.

(2) The proposition p ↔ q also called bi-implication.

37 / 52

Page 139: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ↔ q is true when both p and qhave the same truth values.

(2) The proposition p ↔ q also called bi-implication.

37 / 52

Page 140: Chapter 1 The Foundations: Logic and Proofs

Remarks

(1) The proposition p ↔ q is true when both p and qhave the same truth values.

(2) The proposition p ↔ q also called bi-implication.

37 / 52

Page 141: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 142: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 143: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 144: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 145: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 146: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Determine whether the following propositions are T or F:

(a) 1 is odd if and only if 3 is even.

(b) |5| = −5 if and only if 5 > 0.

(c)√

4 = 2 if and only if (2)2 = 4.

(d) 5 > 6 if and only if 5 is even.

Solution

38 / 52

Page 147: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct the truth table for the compound proposition (p∧ q)↔ p.

Solution

39 / 52

Page 148: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Construct the truth table for the compound proposition (p∧ q)↔ p.

Solution

39 / 52

Page 149: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p ↔ q to translate the following propositions:

1 p if and only if q.

2 p is equivalent to q.

3 p is necessary and sufficient for q.

40 / 52

Page 150: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p ↔ q to translate the following propositions:

1 p if and only if q.

2 p is equivalent to q.

3 p is necessary and sufficient for q.

40 / 52

Page 151: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p ↔ q to translate the following propositions:

1 p if and only if q.

2 p is equivalent to q.

3 p is necessary and sufficient for q.

40 / 52

Page 152: Chapter 1 The Foundations: Logic and Proofs

Remark

We use p ↔ q to translate the following propositions:

1 p if and only if q.

2 p is equivalent to q.

3 p is necessary and sufficient for q.

40 / 52

Page 153: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Translate the given compound propositions into a symbolic formusing the suggested symbols.

(a) ”A natural number is even if and only if it is divisible by 2.” (E,D)

(b) ”A matrix has an inverse whenever its determinant is not zero.”(I, Z)

(c) ”A function is differentiable at a point only if it is continuousat that point.” (D, C).

Solution

41 / 52

Page 154: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Translate the given compound propositions into a symbolic formusing the suggested symbols.

(a) ”A natural number is even if and only if it is divisible by 2.” (E,D)

(b) ”A matrix has an inverse whenever its determinant is not zero.”(I, Z)

(c) ”A function is differentiable at a point only if it is continuousat that point.” (D, C).

Solution

41 / 52

Page 155: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Translate the given compound propositions into a symbolic formusing the suggested symbols.

(a) ”A natural number is even if and only if it is divisible by 2.” (E,D)

(b) ”A matrix has an inverse whenever its determinant is not zero.”(I, Z)

(c) ”A function is differentiable at a point only if it is continuousat that point.” (D, C).

Solution

41 / 52

Page 156: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Translate the given compound propositions into a symbolic formusing the suggested symbols.

(a) ”A natural number is even if and only if it is divisible by 2.” (E,D)

(b) ”A matrix has an inverse whenever its determinant is not zero.”(I, Z)

(c) ”A function is differentiable at a point only if it is continuousat that point.” (D, C).

Solution

41 / 52

Page 157: Chapter 1 The Foundations: Logic and Proofs

Example 3

Example

Translate the given compound propositions into a symbolic formusing the suggested symbols.

(a) ”A natural number is even if and only if it is divisible by 2.” (E,D)

(b) ”A matrix has an inverse whenever its determinant is not zero.”(I, Z)

(c) ”A function is differentiable at a point only if it is continuousat that point.” (D, C).

Solution

41 / 52

Page 158: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 159: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 160: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 161: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 162: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 163: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 164: Chapter 1 The Foundations: Logic and Proofs

Implicit Use of Biconditionals

You should be aware that biconditionals are not always explicitin natural language.

In particular, the “if and only if” construction used inbiconditionals is rarely used in common language.

Instead, biconditionals are often expressed using an “if, then”or an “only if” construction.

The other part of the “if and only if” is implicit.

That is, the converse is implied, but not stated.

For example, consider the statement in English “If you finishyour meal, then you can have dessert.”

What is really meant is “You can have dessert if and only if youfinish your meal.”

42 / 52

Page 165: Chapter 1 The Foundations: Logic and Proofs

This last statement is logically equivalent to the twostatements “If you finish your meal, then you can have dessert”and “You can have dessert only if you finish your meal.”

Because of this imprecision in natural language, we need tomake an assumption whether a conditional statement in naturallanguage implicitly includes its converse.

Because precision is essential in mathematics and in logic, wewill always distinguish between the conditional statementp −→ q and the biconditional statement p ←→ q.

43 / 52

Page 166: Chapter 1 The Foundations: Logic and Proofs

This last statement is logically equivalent to the twostatements “If you finish your meal, then you can have dessert”and “You can have dessert only if you finish your meal.”

Because of this imprecision in natural language, we need tomake an assumption whether a conditional statement in naturallanguage implicitly includes its converse.

Because precision is essential in mathematics and in logic, wewill always distinguish between the conditional statementp −→ q and the biconditional statement p ←→ q.

43 / 52

Page 167: Chapter 1 The Foundations: Logic and Proofs

This last statement is logically equivalent to the twostatements “If you finish your meal, then you can have dessert”and “You can have dessert only if you finish your meal.”

Because of this imprecision in natural language, we need tomake an assumption whether a conditional statement in naturallanguage implicitly includes its converse.

Because precision is essential in mathematics and in logic, wewill always distinguish between the conditional statementp −→ q and the biconditional statement p ←→ q.

43 / 52

Page 168: Chapter 1 The Foundations: Logic and Proofs

Precedence of Logical Operators

We can construct compound propositions using the negationoperator and the logical operators defined so far.

We will generally use parentheses to specify the order in whichlogical operators in a compound proposition are to be applied.

However, to reduce the number of parentheses, we specify thatthe negation operator is applied before all other logicaloperators.

Another general rule of precedence is that the conjunctionoperator ∧ takes precedence over the disjunction operator ∨, sothat p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r).

44 / 52

Page 169: Chapter 1 The Foundations: Logic and Proofs

Precedence of Logical Operators

We can construct compound propositions using the negationoperator and the logical operators defined so far.

We will generally use parentheses to specify the order in whichlogical operators in a compound proposition are to be applied.

However, to reduce the number of parentheses, we specify thatthe negation operator is applied before all other logicaloperators.

Another general rule of precedence is that the conjunctionoperator ∧ takes precedence over the disjunction operator ∨, sothat p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r).

44 / 52

Page 170: Chapter 1 The Foundations: Logic and Proofs

Precedence of Logical Operators

We can construct compound propositions using the negationoperator and the logical operators defined so far.

We will generally use parentheses to specify the order in whichlogical operators in a compound proposition are to be applied.

However, to reduce the number of parentheses, we specify thatthe negation operator is applied before all other logicaloperators.

Another general rule of precedence is that the conjunctionoperator ∧ takes precedence over the disjunction operator ∨, sothat p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r).

44 / 52

Page 171: Chapter 1 The Foundations: Logic and Proofs

Precedence of Logical Operators

We can construct compound propositions using the negationoperator and the logical operators defined so far.

We will generally use parentheses to specify the order in whichlogical operators in a compound proposition are to be applied.

However, to reduce the number of parentheses, we specify thatthe negation operator is applied before all other logicaloperators.

Another general rule of precedence is that the conjunctionoperator ∧ takes precedence over the disjunction operator ∨, sothat p ∧ q ∨ r means (p ∧ q) ∨ r rather than p ∧ (q ∨ r).

44 / 52

Page 172: Chapter 1 The Foundations: Logic and Proofs

Because this rule may be difficult to remember, we willcontinue to use parentheses so that the order of the disjunctionand conjunction operators is clear.

Finally, it is an accepted rule that the conditional andbiconditional operators −→ and ←→ have lower precedencethan the conjunction and disjunction operators, ∧ and ∨.

Consequently, p ∨ q −→ r is the same as (p ∨ q) −→ r .

We will use parentheses when the order of the conditionaloperator and biconditional operator is at issue, although theconditional operator has precedence over the biconditionaloperator.

45 / 52

Page 173: Chapter 1 The Foundations: Logic and Proofs

Because this rule may be difficult to remember, we willcontinue to use parentheses so that the order of the disjunctionand conjunction operators is clear.

Finally, it is an accepted rule that the conditional andbiconditional operators −→ and ←→ have lower precedencethan the conjunction and disjunction operators, ∧ and ∨.

Consequently, p ∨ q −→ r is the same as (p ∨ q) −→ r .

We will use parentheses when the order of the conditionaloperator and biconditional operator is at issue, although theconditional operator has precedence over the biconditionaloperator.

45 / 52

Page 174: Chapter 1 The Foundations: Logic and Proofs

Because this rule may be difficult to remember, we willcontinue to use parentheses so that the order of the disjunctionand conjunction operators is clear.

Finally, it is an accepted rule that the conditional andbiconditional operators −→ and ←→ have lower precedencethan the conjunction and disjunction operators, ∧ and ∨.

Consequently, p ∨ q −→ r is the same as (p ∨ q) −→ r .

We will use parentheses when the order of the conditionaloperator and biconditional operator is at issue, although theconditional operator has precedence over the biconditionaloperator.

45 / 52

Page 175: Chapter 1 The Foundations: Logic and Proofs

Because this rule may be difficult to remember, we willcontinue to use parentheses so that the order of the disjunctionand conjunction operators is clear.

Finally, it is an accepted rule that the conditional andbiconditional operators −→ and ←→ have lower precedencethan the conjunction and disjunction operators, ∧ and ∨.

Consequently, p ∨ q −→ r is the same as (p ∨ q) −→ r .

We will use parentheses when the order of the conditionaloperator and biconditional operator is at issue, although theconditional operator has precedence over the biconditionaloperator.

45 / 52

Page 176: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 177: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 178: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 179: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 180: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 181: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 182: Chapter 1 The Foundations: Logic and Proofs

Logic and Bit Operations

Computers represent information using bits.

A bit is a symbol with two possible values, namely, 0 (zero) and1 (one).

This meaning of the word bit comes from binary digit, becausezeros and ones are the digits used in binary representations ofnumbers.

The well-known statistician John Tukey introduced thisterminology in 1946.

A bit can be used to represent a truth value, because there aretwo truth values, namely, true and false.

As is customarily done, we will us e a 1 bit to represent true and a 0 bit to represent false.

That is, 1 represents T (true), 0 represents F (false).

46 / 52

Page 183: Chapter 1 The Foundations: Logic and Proofs

A variable is called a Boolean variable if its value is either trueor false.

Consequently, a Boolean variable can be represented using abit.

Computer bit operations correspond to the logical connectives.

By replacing true by a one and false by a zero in the truthtables for the operators ∧, ∨, and ⊕, we obtain the followingtables

x y x ∨ y x ∧ y x ⊕ y

1 1 1 1 0

1 0 1 0 1

0 1 1 0 1

0 0 0 0 0

We will also use the notation OR , AND , and XOR for theoperators ∧, ∨, and ⊕, as is done in various programminglanguages.

47 / 52

Page 184: Chapter 1 The Foundations: Logic and Proofs

A variable is called a Boolean variable if its value is either trueor false.

Consequently, a Boolean variable can be represented using abit.

Computer bit operations correspond to the logical connectives.

By replacing true by a one and false by a zero in the truthtables for the operators ∧, ∨, and ⊕, we obtain the followingtables

x y x ∨ y x ∧ y x ⊕ y

1 1 1 1 0

1 0 1 0 1

0 1 1 0 1

0 0 0 0 0

We will also use the notation OR , AND , and XOR for theoperators ∧, ∨, and ⊕, as is done in various programminglanguages.

47 / 52

Page 185: Chapter 1 The Foundations: Logic and Proofs

A variable is called a Boolean variable if its value is either trueor false.

Consequently, a Boolean variable can be represented using abit.

Computer bit operations correspond to the logical connectives.

By replacing true by a one and false by a zero in the truthtables for the operators ∧, ∨, and ⊕, we obtain the followingtables

x y x ∨ y x ∧ y x ⊕ y

1 1 1 1 0

1 0 1 0 1

0 1 1 0 1

0 0 0 0 0

We will also use the notation OR , AND , and XOR for theoperators ∧, ∨, and ⊕, as is done in various programminglanguages.

47 / 52

Page 186: Chapter 1 The Foundations: Logic and Proofs

A variable is called a Boolean variable if its value is either trueor false.

Consequently, a Boolean variable can be represented using abit.

Computer bit operations correspond to the logical connectives.

By replacing true by a one and false by a zero in the truthtables for the operators ∧, ∨, and ⊕, we obtain the followingtables

x y x ∨ y x ∧ y x ⊕ y

1 1 1 1 0

1 0 1 0 1

0 1 1 0 1

0 0 0 0 0

We will also use the notation OR , AND , and XOR for theoperators ∧, ∨, and ⊕, as is done in various programminglanguages.

47 / 52

Page 187: Chapter 1 The Foundations: Logic and Proofs

A variable is called a Boolean variable if its value is either trueor false.

Consequently, a Boolean variable can be represented using abit.

Computer bit operations correspond to the logical connectives.

By replacing true by a one and false by a zero in the truthtables for the operators ∧, ∨, and ⊕, we obtain the followingtables

x y x ∨ y x ∧ y x ⊕ y

1 1 1 1 0

1 0 1 0 1

0 1 1 0 1

0 0 0 0 0

We will also use the notation OR , AND , and XOR for theoperators ∧, ∨, and ⊕, as is done in various programminglanguages.

47 / 52

Page 188: Chapter 1 The Foundations: Logic and Proofs

Bit string

Definition

A bit string is a sequence of zero or more bits. The length of thisstring is the number of bits in the string.

Example

0010111 is a bit string of length 7.

48 / 52

Page 189: Chapter 1 The Foundations: Logic and Proofs

Bit string

Definition

A bit string is a sequence of zero or more bits. The length of thisstring is the number of bits in the string.

Example

0010111 is a bit string of length 7.

48 / 52

Page 190: Chapter 1 The Foundations: Logic and Proofs

Bitwise operators

We can extend bit operations to bit strings.

Definition

We define the bitwise OR , bitwise AND , and bitwise XOR of twostrings of the same length to be the strings that have as their bitsthe OR , AND , and XOR of the corresponding bits in the twostrings, respectively.

Notation

We use the symbols ∧, ∨, and ⊕ to denote the bitwise OR , bitwiseAND , and bitwise XOR operations, respectively.

Remark

Throughout this course, we will split bit strings into blocks of fourbits to make them easier to read.

49 / 52

Page 191: Chapter 1 The Foundations: Logic and Proofs

Bitwise operators

We can extend bit operations to bit strings.

Definition

We define the bitwise OR , bitwise AND , and bitwise XOR of twostrings of the same length to be the strings that have as their bitsthe OR , AND , and XOR of the corresponding bits in the twostrings, respectively.

Notation

We use the symbols ∧, ∨, and ⊕ to denote the bitwise OR , bitwiseAND , and bitwise XOR operations, respectively.

Remark

Throughout this course, we will split bit strings into blocks of fourbits to make them easier to read.

49 / 52

Page 192: Chapter 1 The Foundations: Logic and Proofs

Bitwise operators

We can extend bit operations to bit strings.

Definition

We define the bitwise OR , bitwise AND , and bitwise XOR of twostrings of the same length to be the strings that have as their bitsthe OR , AND , and XOR of the corresponding bits in the twostrings, respectively.

Notation

We use the symbols ∧, ∨, and ⊕ to denote the bitwise OR , bitwiseAND , and bitwise XOR operations, respectively.

Remark

Throughout this course, we will split bit strings into blocks of fourbits to make them easier to read.

49 / 52

Page 193: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Find the bitwise OR , bitwise AND , and bitwise XOR of the bitstrings x = 0110110110 and y = 1100011101.

Solution

50 / 52

Page 194: Chapter 1 The Foundations: Logic and Proofs

Example 1

Example

Find the bitwise OR , bitwise AND , and bitwise XOR of the bitstrings x = 0110110110 and y = 1100011101.

Solution

50 / 52

Page 195: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Evaluate the expression 1101 ∧ (0101 ∨ 1001).

Solution

51 / 52

Page 196: Chapter 1 The Foundations: Logic and Proofs

Example 2

Example

Evaluate the expression 1101 ∧ (0101 ∨ 1001).

Solution

51 / 52

Page 197: Chapter 1 The Foundations: Logic and Proofs

Exercises: Page 12: 1-35, 43,44

é��<Ë @ YÒm�'

. Õç�'

? ¨ñ

�ñÖÏ @ ú

¯ Z Qk. I. ª�@ A

�Ó

What is the most difficult partof this section?

52 / 52

Page 198: Chapter 1 The Foundations: Logic and Proofs

Exercises: Page 12: 1-35, 43,44

é��<Ë @ YÒm�'

. Õç�'

? ¨ñ

�ñÖÏ @ ú

¯ Z Qk. I. ª�@ A

�Ó

What is the most difficult partof this section?

52 / 52