Equivalence and Implication

Similar documents
CSC Discrete Math I, Spring Propositional Logic

2.2: Logical Equivalence: The Laws of Logic

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Sets. Alice E. Fischer. CSCI 1166 Discrete Mathematics for Computing Spring, Outline Sets An Algebra on Sets Summary

2. The Logic of Compound Statements Summary. Aaron Tan August 2017

Compound Propositions

Propositional Equivalence

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Logic, Sets, and Proofs

Propositional Logic. Spring Propositional Logic Spring / 32

Chapter 1, Section 1.1 Propositional Logic

We last time we began introducing equivalency laws.

CISC-102 Winter 2016 Lecture 17

Numbers that are divisible by 2 are even. The above statement could also be written in other logically equivalent ways, such as:

Proofs. Joe Patten August 10, 2018

Logic and Truth Tables

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Proving Things. Why prove things? Proof by Substitution, within Logic. Rules of Inference: applying Logic. Using Assumptions.

Packet #1: Logic & Proofs. Applied Discrete Mathematics

1.1 Statements and Compound Statements

CISC-102 Fall 2018 Week 11

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

PHIL12A Section answers, 16 February 2011

AMTH140 Lecture 8. Symbolic Logic

Introduction to Decision Sciences Lecture 2

Review CHAPTER. 2.1 Definitions in Chapter Sample Exam Questions. 2.1 Set; Element; Member; Universal Set Partition. 2.

Boolean Logic. CS 231 Dianna Xu

Logic and Discrete Mathematics. Section 3.5 Propositional logical equivalence Negation of propositional formulae

Logic and Propositional Calculus

Foundations of Mathematics MATH 220 FALL 2017 Lecture Notes

Solutions to Homework I (1.1)

1 Propositional Logic

The following techniques for methods of proofs are discussed in our text: - Vacuous proof - Trivial proof

Propositional Calculus: Formula Simplification, Essential Laws, Normal Forms

Truth-Functional Logic

Propositional Logic, Predicates, and Equivalence

Logic. Definition [1] A logic is a formal language that comes with rules for deducing the truth of one proposition from the truth of another.

Proposition/Statement. Boolean Logic. Boolean variables. Logical operators: And. Logical operators: Not 9/3/13. Introduction to Logical Operators

HANDOUT AND SET THEORY. Ariyadi Wijaya

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

1.3 Propositional Equivalences

2 Truth Tables, Equivalences and the Contrapositive

Discrete Mathematical Structures: Theory and Applications

Logic and Truth Tables

The Logic of Compound Statements cont.

Discrete Mathematics and Applications COT3100

Sample Problems for all sections of CMSC250, Midterm 1 Fall 2014

Logic and Propositional Calculus

Propositional natural deduction

Propositional Logic. Fall () Propositional Logic Fall / 30

Language of Propositional Logic

ICS141: Discrete Mathematics for Computer Science I

PROPOSITIONAL CALCULUS

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Discrete Mathematics. (c) Marcin Sydow. Sets. Set operations. Sets. Set identities Number sets. Pair. Power Set. Venn diagrams

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Discrete Mathematics and Its Applications

Definition 2. Conjunction of p and q

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Chapter III. Basic Proof Techniques. Proving the obvious has never been easy. Marty Rubin

Logic. Def. A Proposition is a statement that is either true or false.

Note: The area of logic that deals with propositions is called the propositional calculus or propositional logic.

A statement is a sentence that is definitely either true or false but not both.

Logic as a Tool Chapter 1: Understanding Propositional Logic 1.1 Propositions and logical connectives. Truth tables and tautologies

Propositional Logics and their Algebraic Equivalents

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Discrete Structures of Computer Science Propositional Logic III Rules of Inference

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

Logic Synthesis and Verification

1.1 Language and Logic

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

Discrete Basic Structure: Sets

Topic 1: Propositional logic

MATHEMATICAL REASONING

Chapter 4, Logic using Propositional Calculus Handout

Lecture 02: Propositional Logic

MATH 120. Test 1 Spring, 2012 DO ALL ASSIGNED PROBLEMS. Things to particularly study

Chapter 1: Formal Logic

Math Final Exam December 14, 2009 Page 1 of 5

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Supplementary Logic Notes CSE 321 Winter 2009

Natural Deduction is a method for deriving the conclusion of valid arguments expressed in the symbolism of propositional logic.

CHAPTER 1. MATHEMATICAL LOGIC 1.1 Fundamentals of Mathematical Logic

Logic and Proof. On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes!

Logic Overview, I. and T T T T F F F T F F F F

Discrete Structures of Computer Science Propositional Logic I

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

CSE 20 DISCRETE MATH. Winter

Section 1.2: Propositional Logic

PS10.3 Logical implications

On my first day of school my parents dropped me off at the wrong nursery. There I was...surrounded by trees and bushes! 26-Aug-2011 MA

n Empty Set:, or { }, subset of all sets n Cardinality: V = {a, e, i, o, u}, so V = 5 n Subset: A B, all elements in A are in B

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

1 The Foundation: Logic and Proofs

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

University of California, San Diego Department of Computer Science and Engineering CSE 20. Solutions to Midterm Exam Winter 2018

10/5/2012. Logic? What is logic? Propositional Logic. Propositional Logic (Rosen, Chapter ) Logic is a truth-preserving system of inference

4. Sets The language of sets. Describing a Set. c Oksana Shatalov, Fall

Mat 243 Exam 1 Review

Transcription:

Equivalence and Alice E. Fischer CSCI 1166 Discrete Mathematics for Computing February 7 8, 2018 Alice E. Fischer Laws of Logic... 1/33

1 Logical Equivalence Contradictions and Tautologies 2 3 4 Necessary and Sufficient Conditions Inside out and Backwards 5 Alice E. Fischer Laws of Logic... 2/33

Logical Equivalence Contradictions and Tautologies Logical Equivalence Contradictions and Tautologies Alice E. Fischer Laws of Logic... 3/33

Logical Equivalence: Logical Equivalence Contradictions and Tautologies Two propositions are logically equivalent ( ) if they have the same outcomes under all input conditions. We can determine whether two propositions are equivalent ( ) by comparing the last column in the truth tables for the two statements. P Q P Q Q P T T T T T F T T F T T T F F F F For example, The column for P Q is the same as the column for Q P, so the two propositions are equivalent. Alice E. Fischer Laws of Logic... 4/33

Example: The Supervisor s Critique Logical Equivalence Contradictions and Tautologies Do you remember John and his elevator design from last time? John s supervisor looked at his logic and told him It s too complex, O is just the opposite of M. Simplify! So John thought a bit and added a column with a simpler formula to his truth table. (O M) O M O M O M O M ( O M) O M T T F F F F F F T F F T T F T T F T T F F T T T F F T T F F F F Indeed, the boss was right. They are equivalent! Alice E. Fischer Laws of Logic... 5/33

Contradictions Logical Equivalence Contradictions and Tautologies A contradiction is a proposition that is always false, no matter what the input truth values are. For example, this is a contradiction: An odd number, X, equals 2 * some even number, Y. And this is a contradiction: P P Let P be All dogs are black. All dogs are black and not (all dogs are black). A contradiction can be symbolized by c. Alice E. Fischer Laws of Logic... 6/33

Tautologies Outline Logical Equivalence Contradictions and Tautologies A tautology is a proposition that is always true, no matter what the input truth values are. For example: Let Q be the proposition Today is Tuesday. Then this is a tautology: Q Q Today is Tuesday or today is not Tuesday. A tautology can be symbolized by t. Alice E. Fischer Laws of Logic... 7/33

A set of rules for logical calculation can be proven from the definitions using truth tables. They will be presented in the following slides. These laws are analogs of the laws for algebra and for sets that you already know. They are essential in making logical proofs and several are also important in programming. The following slides define the laws for symbolic logic. The corresponding set-theory law(s) will be given at the bottom of each slide. Alice E. Fischer Laws of Logic... 8/33

1. Commutative Laws Both and and or are commutative, that is, the left and right sides can be reversed without changing the meaning of the proposition. P Q Q P P Q Q P This is important in programming. Set theory: and are commutative. Given sets A and B, A B B A A B B A Alice E. Fischer Laws of Logic... 9/33

2. Associative Laws Both and and or are associative operators, that is, you may parenthesize the expression any way you wish without changing its meaning. (P Q) R P (Q R) (P Q) R P (Q R) This is important in programming. Set theory: and are associative. Given sets P, Q, and R, (P Q) R P (Q R) (P Q) R P (Q R) Alice E. Fischer Laws of Logic... 10/33

3. Distributive Laws Both and and or can be distributed over the other operator. P (Q R) (P Q) (P R) P (Q R) (P Q) (P R) This is important in programming. Set theory: and can be distributed over each other. Given sets P, Q, and R, P (Q R) (P Q) (P R) P (Q R) (P Q) (P R) Alice E. Fischer Laws of Logic... 11/33

4. Identity Laws The identity laws are based on the definitions of and and or. P t P P c P Set Theory: The set identity laws are based on definitions of the Universal set and the empty set. Given set A, A U A A A Alice E. Fischer Laws of Logic... 12/33

5. Negation Laws The negation laws are based on the definitions of and, or, and not. P P t P P c Set Theory: Complement Laws The set complement laws are based on definitions of the Universal set, empty set, and complement. Given set A, A A c U A A c Alice E. Fischer Laws of Logic... 13/33

6. Double Negative Law The double-negative law is based on the definitions of not. ( P) P Set Theory: Double Complement Law This is based on the definitions of complement. Given set A, (A c ) c A Alice E. Fischer Laws of Logic... 14/33

7. Idempotent Laws and, or are idempotent, meaning that the trivial computations have no effect and can be repeated without changing the meaning of the expression. P P P P P P Set Theory: intersection and union are idempotent. Given set A, A A A A A A Alice E. Fischer Laws of Logic... 15/33

8. Universal Bound Laws A contradiction and anything is a contradiction. A tautology or anything is a tautology. P c c P t t The shortcut evaluation of logical operators in C is based on these. Set Theory: The empty set is as small as you can get and the universal set is as large as you can get. Given set A, A A U U Alice E. Fischer Laws of Logic... 16/33

9. DeMorgan s Laws To distribute not over and, change the and to or. To distribute not over or, change the or to and. (P Q) P Q (P Q) P Q These laws are very important in programming and in databases. Set Theory: To distribute complement over, change the to. To distribute complement over, change the to. Given sets A, B, (A B) c A c B c (A B) c A c B c Alice E. Fischer Laws of Logic... 17/33

10. Absorption Laws A truth table can be used to verify these absorptions. P (P Q) P P (P Q) P These laws are important in proofs. Set Theory: Given sets A, B, A (A B) A That is, A a subset of A is still A. A (A B) A That is, A a superset of A is still A. Alice E. Fischer Laws of Logic... 18/33

11. Negations of t and c The negation of a tautology is a contradiction and vice versa. t c c t Set Theory: The complement of the Universal set is the empty set, and vice versa. U c c U Alice E. Fischer Laws of Logic... 19/33

Practice This section contains three logical expressions to simplified by applying the rules, and one law to prove using truth tables. Alice E. Fischer Laws of Logic... 20/33

1. Proving DeMorgan s Law Construct a truth table to prove that (P Q) P Q P Q P Q (P Q) P Q ( P Q) T T T F F F F T F F T F T T F T F T T F T F F F T T T T Compare the contents of the fourth and seventh columns. They are the same, so the two expressions are equivalent. Alice E. Fischer Laws of Logic... 21/33

2. Two small messes to simplify. (P Q) (P Q) P ( Q Q) P (t) P Initial expression. Use the distributive law, backwards. Use negation law. Use identity law. P ( Q P) (P Q) (P P) (P Q) P P (P Q) P Distributive law. Idempotent law Commutative law Absorption law. Alice E. Fischer Laws of Logic... 22/33

3. A big mess. (P ( ( P Q))) (P Q) Initial expression (P ( P) Q)) (P Q) DeMorgan s law. (P ( P Q)) (P Q) Double negative law. ((P P) Q) (P Q) Associative law. ( P Q) (P Q) Idempotent law. P ( Q Q) Distributive law, backwards. P (t) Negation law. P Identity law. Alice E. Fischer Laws of Logic... 23/33

Necessary and Sufficient Conditions Inside out and Backwards and its Truth Table Necessary and Sufficient Conditions Inside out and Backwards Alice E. Fischer Laws of Logic... 24/33

and its Truth Table Necessary and Sufficient Conditions Inside out and Backwards The symbol is called if... then in the textbook. It is more traditional to call it implies. The proposition P Q is read P implies Q or if P, then Q We say that P is the premise and Q is the conclusion. The truth table for P Q is: P Q P Q P P Q T T T F T T F F F F F T T T T F F T T T It is also true that P Q P Q Alice E. Fischer Laws of Logic... 25/33

Can be Confusing. Necessary and Sufficient Conditions Inside out and Backwards Sometimes, but not always, P Q means that P causes Q: I didn t increment my loop variable so my program had an infinite loop. Sometimes P Q is used to define a term: If a creature is bipedal, it has two feet. The conclusion can be true independently of the premise: If the moon is made of green cheese then UNH is a university. This is often called a vacuous truth. The implication is true when both the premise and the conclusion are false. if 0 = 1 then 1 = 2. A truth table is the most reliable way to figure out the correct interpretation of an implication. Alice E. Fischer Laws of Logic... 26/33

If and Only If Necessary and Sufficient Conditions Inside out and Backwards P Q is a conditional statement that can be read if P then Q. Now suppose that P Q and also Q P. Then we write P Q, which can be read P if and only if Q. This statement is called a biconditional. P Q P Q Q P P Q T T T T T T F F T F F T T F F F F T T T Alice E. Fischer Laws of Logic... 27/33

Necessary and Sufficient Conditions Necessary and Sufficient Conditions Inside out and Backwards A sufficient condition is a premise or set of premises that are enough, without any more premises, to prove the conclusion. If C is a sufficient condition for S, then C S. A necessary condition is a premise that must be true in order for the conclusion to be true. If C is a necessary condition for S, then C S. If a condition C is both necessary and sufficient for S, then C S. Alice E. Fischer Laws of Logic... 28/33

Inside Out and Backwards Necessary and Sufficient Conditions Inside out and Backwards There are four ways to reverse the proposition P Q: The contrapositive is The converse is Q P. The inverse is P Q. Q P. The negation is (P Q), which is equivalent to P Q. A proposition and its contrapositive are equivalent. A proposition is not equivalent to its converse, inverse, or negation. For example, If it is a bee, it can fly is not to If it can fly, it is a bee. Alice E. Fischer Laws of Logic... 29/33

The opposites of P Q: Necessary and Sufficient Conditions Inside out and Backwards Conditional P Q Inverse P Q Converse Q P Contrapositive Q P A conditional is not equivalent to its converse. A conditional is equivalent to its contrapositive. The inverse is equivalent to the converse P Q P Q P Q Q P Q P P Q T T F F T T T T T F F T F F T T F T T F T T F F F F T T T T T T Alice E. Fischer Laws of Logic... 30/33

Alice E. Fischer Laws of Logic... 31/33

of Terminology A conjunction is two propositions joined by. A disjunction is two propositions joined by. A negation is applied to a proposition. Two propositions are equivalent ( ) if the results in the last column of their truth tables are identical. An implication is two propositions joined by. A biconditional is two propositions joined by. Alice E. Fischer Laws of Logic... 32/33

More Terminology A proposition that is always true is called a tautology. A proposition that is always false is called a contradiction. Given a proposition P Q, The contrapositive is Q P (equivalent to proposition) The converse is Q P (equivalent to inverse) The inverse is P Q (equivalent to converse) The negation is (P Q) (equivalent to P Q) Alice E. Fischer Laws of Logic... 33/33