Chapter 1 The Foundations: Logic and Proofs

Preview:

Citation preview

Õ�æk�

��QË @ á�

�Ôg

��QË @ é�

��<Ë @ Õ

��.�

Chapter 1The Foundations: Logic and

ProofsSecond Semester 2018-2019

A��®

��Ë@ Õæ

��A

�ë á�Üß

@ . X .

@

1 / 52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Example 2

Example

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

Solution

19 / 52

Example 2

Example

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

Solution

19 / 52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Example 2

Example

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

Solution

24 / 52

Example 2

Example

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

Solution

24 / 52

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

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

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

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

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

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

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

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

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

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

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

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

Example 2

Example

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

29 / 52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Example

Example

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

Solution

35 / 52

Example

Example

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

Solution

35 / 52

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

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

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

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

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

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

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

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

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

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

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

Example 2

Example

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

Solution

39 / 52

Example 2

Example

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

Solution

39 / 52

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Example 1

Example

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

Solution

50 / 52

Example 1

Example

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

Solution

50 / 52

Example 2

Example

Evaluate the expression 1101 ∧ (0101 ∨ 1001).

Solution

51 / 52

Example 2

Example

Evaluate the expression 1101 ∧ (0101 ∨ 1001).

Solution

51 / 52

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

é��<Ë @ YÒm�'

. Õç�'

? ¨ñ

�ñÖÏ @ ú

¯ Z Qk. I. ª�@ A

�Ó

What is the most difficult partof this section?

52 / 52

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

é��<Ë @ YÒm�'

. Õç�'

? ¨ñ

�ñÖÏ @ ú

¯ Z Qk. I. ª�@ A

�Ó

What is the most difficult partof this section?

52 / 52

Recommended