n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Similar documents
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

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

PROPOSITIONAL CALCULUS

CSC Discrete Math I, Spring Propositional Logic

2/13/2012. Logic: Truth Tables. CS160 Rosen Chapter 1. Logic?

Propositional Logic. Spring Propositional Logic Spring / 32

DISCRETE MATHEMATICS BA202

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

THE LOGIC OF COMPOUND STATEMENTS

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

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

Announcements CompSci 102 Discrete Math for Computer Science

MAT2345 Discrete Math

Chapter 1: The Logic of Compound Statements. January 7, 2008

Tautologies, Contradictions, and Contingencies

CSE 20: Discrete Mathematics

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

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

10/13/15. Proofs: what and why. Proposi<onal Logic Proofs. 1 st Proof Method: Truth Table. A sequence of logical arguments such that:

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

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.

The Logic of Compound Statements cont.

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

ANS: If you are in Kwangju then you are in South Korea but not in Seoul.

EECS 1028 M: Discrete Mathematics for Engineers

Compound Propositions

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Propositional Logic. Fall () Propositional Logic Fall / 30

Readings: Conjecture. Theorem. Rosen Section 1.5

Introduction to Sets and Logic (MATH 1190)

Mat 243 Exam 1 Review

Logic and Proof. Aiichiro Nakano

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

software design & management Gachon University Chulyun Kim

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

Chapter 1 Elementary Logic

Rules Build Arguments Rules Building Arguments

CSE 20 DISCRETE MATH. Winter

EECS 1028 M: Discrete Mathematics for Engineers

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Section 1.2: Propositional Logic

Propositional Logic Not Enough

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

COMP 2600: Formal Methods for Software Engineeing

Chapter 1, Section 1.1 Propositional Logic

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

Review. Propositions, propositional operators, truth tables. Logical Equivalences. Tautologies & contradictions

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Packet #1: Logic & Proofs. Applied Discrete Mathematics

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

Introduction Logic Inference. Discrete Mathematics Andrei Bulatov

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

Learning Goals of CS245 Logic and Computation

Boolean Logic. CS 231 Dianna Xu

1 The Foundation: Logic and Proofs

ECOM Discrete Mathematics

1.1 Statements and Compound Statements

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

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

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

Chapter 1, Logic and Proofs (3) 1.6. Rules of Inference

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

THE LOGIC OF COMPOUND STATEMENTS

1 The Foundation: Logic and Proofs

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

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

Predicate Logic & Quantification

CSE 20 DISCRETE MATH. Fall

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

1.1 Language and Logic

Propositional Logic. Argument Forms. Ioan Despi. University of New England. July 19, 2013

We last time we began introducing equivalency laws.

Section 1.1 Propositions

5. Use a truth table to determine whether the two statements are equivalent. Let t be a tautology and c be a contradiction.

Supplementary Logic Notes CSE 321 Winter 2009

Today s Lecture 2/25/10. Truth Tables Continued Introduction to Proofs (the implicational rules of inference)

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!

1.3 Propositional Equivalences

1.1 Language and Logic

What is the decimal (base 10) representation of the binary number ? Show your work and place your final answer in the box.

Propositional Logic. Jason Filippou UMCP. ason Filippou UMCP) Propositional Logic / 38

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

Introduction Propositional Logic

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Math.3336: Discrete Mathematics. Propositional Equivalences

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Propositional natural deduction

Proposition logic and argument. CISC2100, Spring 2017 X.Zhang

Where are my glasses?

15414/614 Optional Lecture 1: Propositional Logic

FORMAL PROOFS DONU ARAPURA

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

MATH 2001 MIDTERM EXAM 1 SOLUTION

Logic As Algebra COMP1600 / COMP6260. Dirk Pattinson Australian National University. Semester 2, 2017

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

PHI Propositional Logic Lecture 2. Truth Tables

Transcription:

Discrete Math Review Discrete Math Review (Rosen, Chapter 1.1 1.6) TOPICS Propositional Logic Logical Operators Truth Tables Implication Logical Equivalence Inference Rules What you should know about propositional and predicate logic before the next midterm! Less theory, more problem solving, will be repeated in recitation and homework. CS160 Spring Semester 2013 2 Propositional Logic A proposition is a statement that is either true or false Examples: Fort Collins is in Nebraska (false) Java is case sensitive (true) We are not alone in the universe (?) Every proposition is true or false, but its truth value may be unknown Logical Operators logical not (negation) logical or (disjunction) logical and (conjunction) logical exclusive or logical implication (conditional) logical bi-implication (biconditional) CS160 Spring Semester 2013 3 CS160 Spring Semester 2013 4 1

Truth Tables p q p q T T T T F F F T F F F F p q p q T T T T F F F T T F F T (1) You should be able to write out the truth table for all logical operators, from memory. CS160 Spring Semester 2013 5 Compound Propositions Propositions and operators can be combined into compound propositions. (2) You should be able to make a truth table for any compound proposition: p q p p q p (p q) T T F T F T F F F F F T T T T F F T T T CS160 Spring Semester 2013 6 (3) You should be able to translate natural language to logic (can be ambiguous!): English: If the car is out of gas, then it will stop Logic: English to Propositional Logic p equals the car is out of gas q equals the car will stop p q Propositional Logic to English (4) You should be able to translate propositional logic to natural language: Logic: p equals it is raining p q English: q equals the grass will be wet If it is raining, the grass will be wet. CS160 Spring Semester 2013 7 CS160 Spring Semester 2013 8 2

Logical Equivalences: Definition Certain propositions are equivalent (meaning they share exactly the same truth values): For example: (p q) p q De Morgan s (p T) p Identity Law (p p) F Negation Law Logical Equivalences: Truth Tables (5) And you should know how to prove logical equivalence with a truth table For example: (p q) p q p q p q (p q) (p q) p q T T F F T F F T F F T F T T F T T F F T T F F T T F T T CS160 Spring Semester 2013 9 CS160 Spring Semester 2013 10 Logical Equivalences: Review (6) You should understand the logical equivalences and laws on the course web site. You should be able to prove any of them using a truth table that compares the truth values of both sides of the equivalence. Memorization of the logical equivalences is not required in this class. Logical Equivalences (Rosen) CS160 Spring Semester 2013 11 CS160 Spring Semester 2013 12 3

Transformation via Logical Equivalences Vocabulary (7) You should be able to transform propositions using logical equivalences. Prove: p (p q) (p q) p (p q) ( p p) ( p q) T ( p q) ( p q) (p q) Distributive law Negation law Domination law De Morgan s Law CS160 Spring Semester 2013 13 (8) You should memorize the following vocabulary: A tautology is a compound proposition that is always true. A contradiction is a compound proposition that is always false. A contingency is neither a tautology nor a contradiction. And know how to decide the category for a compound proposition. CS160 Spring Semester 2013 14 Examples Logical Proof p p p p p p T F T F F T T F Result is always true, no matter what A is Therefore, it is a tautology Result is always false, no matter what A is Therefore, it is a contradiction Given a set of axioms Statements asserted to be true Prove a conclusion Another propositional statement In other words: Show that the conclusion is true whenever the axioms are true CS160 Spring Semester 2013 15 CS160 Spring Semester 2013 16 4

Logical Proof (9) You should be able to perform a logical proof via truth tables. (10) You should be able to perform a logical proof via inference rules. Both methods are described in the following slides. Method 1: Proof by Truth Table Prove that p q, given p p q p p q T T F T T F F F F T T T F F T T For all rows in which axiom is true, conclusion is true Thus the conclusion follows from axiom CS160 Spring Semester 2013 17 CS160 Spring Semester 2013 18 Method 2: Proof using Rules of Inference A rule of inference is a proven relation: when the left hand side (LHS) is true, the right hand side (RHS) is also true. Therefore, if we can match an axiom to the LHS by substituting propositions, we can assert the (substituted) RHS Applying rules of inference Example rule: p, p q q Read as p and p q, therefore q This rule has a name: modus ponens If you have axioms r, r s Substitute r for p, s for q Apply modus ponens Conclude s CS160 Spring Semester 2013 19 CS160 Spring Semester 2013 20 5

Modus Ponens If p, and p implies q, then q Example: p = it is sunny, q = it is hot p q, it is hot whenever it is sunny Given the above, if it is sunny, it must be hot. Modus Tollens If not q and p implies q, then not p Example: p = it is sunny, q = it is hot p q, it is hot whenever it is sunny Given the above, if it is not hot, it cannot be sunny. CS160 Spring Semester 2013 21 CS160 Spring Semester 2013 22 Rules of Inference (Rosen) A Simple Proof: Problem Statement Example of a complete proof using inference rules, from English to propositional logic and back: If you don t go to the store, then you cannot not cook dinner. (axiom) If you cannot cook dinner or go out, you will be hungry tonight. (axiom) You are not hungry tonight, and you didn t go to the store. (axiom) You must have gone out to dinner. (conclusion) CS160 Spring Semester 2013 23 CS160 Spring Semester 2013 24 6

A Simple Proof: Logic Translation A Simple Proof: Applying Inference p: you go to the store q: you can cook dinner r: you will go out s: you will be hungry AXIOMS: p q, (q r) s, s, p CONCLUSION: r 1. p q Axiom 2. (q r) s Axiom 3. s Axiom 4. p Axiom 5. q Modus Ponens (1, 4) 6. q r Modus Tollens (2, 3) 7. r Disjunctive Syllogism (5, 6) CONCLUSION: You must have gone out to dinner! CS160 Spring Semester 2013 25 CS160 Spring Semester 2013 26 Predicate Logic Predicate Logic (cont d) (11) You should recognize predicate logic symbols, i.e. quantifications. Quantification express the extent to which a predicate is true over a set of elements: Universal, for all Existential, there exists (12) You should able to translate between predicate logic and English, in both directions. Specifies a proposition (and optionally a domain), for example: x N, -10 < x < -5 x N, x > -1 Must be able to find examples // False, since no negative x // True, since no negative x to prove, e.g. x Z, -1 < x < 1, x = 0 Must be able to find counterexamples to disprove, e.g. x Z, x > -1, x = -2 CS160 Spring Semester 2013 27 CS160 Spring Semester 2013 28 7