logic & propositional calculus · department of software 2 introduction propositional calculus...

28
Department of Software 1 Logic & Propositional Calculus

Upload: others

Post on 21-Jun-2020

12 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

Department of Software 1

Logic &

Propositional

Calculus

Page 2: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

2 Department of Software

Introduction

Propositional calculus (or logic) is the study of

the logical relationship between objects called

propositions and forms the basis of all

mathematical reasoning.

Definition: A proposition is a statement that is

either true or false, but not both (we usually

denote a proposition by letters; p, q, r, s, . . .).

Page 3: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

3 Department of Software

Introduction

Definition: The value of a proposition is

called its truth value; denoted by T or 1 if it is

true and F or 0 if it is false.

Truth Table:

Page 4: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

4 Department of Software

Examples

Example (Propositions)

-Today is Monday.

-The derivative of sin x is cos x.

-Every even number has at least two factors.

Example (Not Propositions)

-When is the pretest?

-Do your homework.

Page 5: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

5 Department of Software

Basic Logical Operations

Connectives are used to create a compound

proposition from two or more other propositions.

-Negation (denoted ¬ or !)

-And (denoted ) or Logical Conjunction

-Or (denoted ) or Logical Disjunction

-Exclusive Or (XOR, denoted )

-Implication (denoted →)

-Biconditional; “if and only if” (denoted )

Page 6: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

6 Department of Software

Basic Logical Operations (Cont.)

Page 7: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

7 Department of Software

Boolean Operation Summary

Page 8: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

8 Department of Software

Example (1)

Construct the Truth Table for the following

compound proposition.

((p q) q).

Page 9: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

9 Department of Software

Example (2)

Construct the Truth Table for the following

compound proposition.

q ( r → p).

Page 10: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

10 Department of Software

Example (3) Find if the following two compound

propositions are equivalence?

p (q r) (p q) r

Page 11: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

11 Department of Software

Precedence of Logical Operators

Page 12: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

12 Department of Software

Homework

Construct the truth table for the following

logical expression?

Page 13: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

13 Department of Software

Limitations of Truth Tables It just requires some brute force calculation.

If we have 129 variables, truth table has 2129

lines. That number is larger than the number of

atoms in the known universe.

We don’t need any insight into why the proposition you’re working on is true (or false,

or sometimes true).

However, a big advantage of the Boolean

algebra, is that they give much better insight

into why a theorem is true.

Page 14: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

14 Department of Software

Tautologies & Contradictions

A tautology is a compound proposition which

is true no matter what the truth values of its

simple components.

A contradiction is a compound proposition

which is false no matter what the truth values

of its simple components.

Page 15: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

15 Department of Software

Tautologies & Contradictions (Cont.)

Show that (p ∧ q) ∨ (p ∧ q) is a tautology.

Page 16: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

16 Department of Software

Logical Equivalence

Two propositions are said to be logically

equivalent if they have identical truth values

for every set of truth values of their

components.

Page 17: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

17 Department of Software

Logical Equivalence (Cont.)

Example

Page 18: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

18 Department of Software

Algebra of Propositions

Page 19: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

19 Department of Software

Algebra of Propositions (Cont.)

Page 20: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

20 Department of Software

Example (1)

Simplify the following logical expression

(p q) ( p q)

Page 21: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

21 Department of Software

Prove Equivelance

Page 22: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

22 Department of Software

Applications

Page 23: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

23 Department of Software

Applications (Cont.)

Page 24: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

24 Department of Software

Homework

Try to find the logical expression for the

following Circuits. Is there any relation between the two?

Page 25: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

The date for

the next exam is

January 3, 2012;

Tuesday. 25 Department of Software

Page 26: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

26 Department of Software

Be ready for the

exam on the next

lecture

Page 27: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

27 Department of Software

References

1. John O’Donnell, Cordelia Hall, and Rex Page, “Discrete Mathematics Using a Computer,” 2nd edition, Springer-Verlag, 2006.

2. Seymour Lipschutz, and Marc Lipson, “Schaum’s Outlines: Discrete Mathematics,” 3rd edition, McGraw-Hill, 2007.

3. Gary Haggard, John Schlipf, and Sue Whitesides, “Discrete Mathematics for Computer Science,” Thomson Brooks/Cole, 2006.

4. Rowan Garnier, and John Taylor “Discrete Mathematics for New Technology,” 2nd edition, Institute of Physics Publishing, 2002.

5. Vladlen Koltun, “Discrete Structures Lecture Notes,” 2006.

6. Miguel A. Lerma, “Notes on Discrete Mathematics” Northwestern University, 2005.

Page 28: Logic & Propositional Calculus · Department of Software 2 Introduction Propositional calculus (or logic) is the study of the logical relationship between objects called propositions

28 Department of Software

Thank You for

Listening.