W3203 Discrete Mathema1cs. Logic and Proofs. Spring 2015 Instructor: Ilia Vovsha. hcp://www.cs.columbia.edu/~vovsha/w3203

Similar documents
Proofs Sec*ons 1.6, 1.7 and 1.8 of Rosen

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

Sec$on Summary. Propositions Connectives. Truth Tables. Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional

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

Chapter 1, Part II: Predicate Logic

Thinking of Nested Quantification

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

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

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

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Introduc)on. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari 1

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

Discrete Structures. Introduc:on. Examples of problems solved using discrete structures. What is discrete about Discrete Structures?

ICS141: Discrete Mathematics for Computer Science I

Mat 243 Exam 1 Review

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

1 The Foundation: Logic and Proofs

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

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

At least one of us is a knave. What are A and B?

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

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

Proposi'onal Logic Not Enough

1 The Foundation: Logic and Proofs

Intro to Logic and Proofs

Propositional Logic 1

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

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

CSE 20 DISCRETE MATH. Winter

Discrete Mathematics and Its Applications

CSE 20 DISCRETE MATH. Fall

Predicate Logic & Quantification

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

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

A Little Deductive Logic

The Foundations: Logic and Proofs. Part I

software design & management Gachon University Chulyun Kim

Variable Names. Some Ques(ons about Quan(fiers (but answers are not proven just stated here!) x ( z Q(z) y P(x,y) )

ECOM Discrete Mathematics

A Little Deductive Logic

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

First order Logic ( Predicate Logic) and Methods of Proof

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

Proofs. Introduction II. Notes. Notes. Notes. Slides by Christopher M. Bourke Instructor: Berthe Y. Choueiry. Fall 2007

EECS 1028 M: Discrete Mathematics for Engineers

Sec$on Summary. Valid Arguments Inference Rules for Propositional Logic. Inference Rules for Quantified Statements. Building Arguments

Unit I LOGIC AND PROOFS. B. Thilaka Applied Mathematics

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

DISCRETE MATHEMATICS BA202

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

Test 1 Solutions(COT3100) (1) Prove that the following Absorption Law is correct. I.e, prove this is a tautology:

Introduction to Sets and Logic (MATH 1190)

Sec$on Summary. Mathematical Proofs Forms of Theorems Trivial & Vacuous Proofs Direct Proofs Indirect Proofs

MATH 215 DISCRETE MATHEMATICS INSTRUCTOR: P. WENG

An Introduction to Logic 1.1 ~ 1.4 6/21/04 ~ 6/23/04

Outline. Logic. Knowledge bases. Wumpus world characteriza/on. Wumpus World PEAS descrip/on. A simple knowledge- based agent

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

THE LOGIC OF COMPOUND STATEMENTS

Propositional Logic. Spring Propositional Logic Spring / 32

Logic and Propositional Calculus

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

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.

CSCE 222 Discrete Structures for Computing. Predicate Logic. Dr. Hyunyoung Lee. !!!!! Based on slides by Andreas Klappenecker

Announcements CompSci 102 Discrete Math for Computer Science

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

Logic and Propositional Calculus

Readings: Conjecture. Theorem. Rosen Section 1.5

Chapter 1 Elementary Logic

Rules Build Arguments Rules Building Arguments

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

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

Review: Potential stumbling blocks

DISCRETE MATH: LECTURE Chapter 3.3 Statements with Multiple Quantifiers If you want to establish the truth of a statement of the form

Introduc)on to Ar)ficial Intelligence

Boolean Algebra and Proof. Notes. Proving Propositions. Propositional Equivalences. Notes. Notes. Notes. Notes. March 5, 2012

Math 3336: Discrete Mathematics Practice Problems for Exam I

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

Where are my glasses?

Logic. Propositional Logic: Syntax

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

WUCT121. Discrete Mathematics. Logic. Tutorial Exercises

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Chapter 4 : The Logic of Boolean Connec6ves. Not all English connec4ves are truth- func4onal

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

PROPOSITIONAL CALCULUS

UNIVERSITY OF CALICUT SCHOOL OF DISTANCE EDUCATION B Sc (MATHEMATICS) I Semester Core Course. FOUNDATIONS OF MATHEMATICS (MODULE I & ii) QUESTION BANK

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

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

Proof. Theorems. Theorems. Example. Example. Example. Part 4. The Big Bang Theory

Chapter 4, Logic using Propositional Calculus Handout

Logic and Proof. Aiichiro Nakano

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

Full file at Chapter 1

Chapter 3. The Logic of Quantified Statements

Section Summary. Section 1.5 9/9/2014

Predicate Logic. Andreas Klappenecker

Logic. Propositional Logic: Syntax. Wffs

Definition 2. Conjunction of p and q

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics. Introductory Notes in Discrete Mathematics Solution Guide

Transcription:

W3203 Discrete Mathema1cs Logic and Proofs Spring 2015 Instructor: Ilia Vovsha hcp://www.cs.columbia.edu/~vovsha/w3203 1

Outline Proposi1onal Logic Operators Truth Tables Logical Equivalences Laws of Logic Rules of Inference Quan1fiers Proof PaCerns Text: Rosen 1 Text: Lehman 1-3 2

Logic Puzzle Three kinds of people live on an island: Knights (K): always tell the truth Knaves (V): always lie Spies (S): either lie or tell the truth You meet 3 people, A, B, and C You know one is K, one is V, and one is S Each of them knows all of their types They make three statements about each other Can you determine who is the knight/knave/spy? 3

Logic Puzzle Statements: A: I am the knight B: C: A is not the knave B is not the knave Can you determine who is the knight/knave/spy? 4

Logic Puzzle (solu1on) Statements: A: I am the knight B: C: A is not the knave B is not the knave Can you determine who is the knight/knave/spy? Suppose A is the Knight (K). Then B tells truth, B must be a spy (S). But C tells truth, can t be a knave (V). Suppose B is K. Then B tells truth, A must be S. Hence C is V, but he tells truth. Hence we have a contradic1on. C must be K. Then C tells truth, B must be S. A is the V. 5

Proposi1ons Defini1on: A proposi6on is a declara1ve sentence (statement) that is either true (T) or false (F), but not both Fact- based declara1on Ø 1 + 1 = 2 Ø A is not the knave Ø If A is a knight, then B is not a knight Excludes commands, ques1ons and opinions Ø What 1me is it? Ø Be quiet! What about statements with (non- constant) variables? Ø x + 2 = 5 Ø n is an even number 6

Predicates Defini1on: A predicate is a proposi1on whose truth depends on one or more variables Variables can have various domains: Ø nonnega1ve integers Ø x > 1 Ø people: all people on the island are knights, knaves or spies Nota1on: P(x) Ø Not an ordinary func1on! Ø P(x) is either True or False 7

Puzzle (proposi1ons) Statements: A: I am the knight B: C: A is not the knave B is not the knave Lets introduce proposi1onal (boolean) variables: V A ::= A is the knave, V B ::= B is the knave V A or V B ::= A is the knave or B is the knave If V A then not V B ::= If A is the knave then B is not the knave K(p) ::= person p is a knight 8

Construc1ng Proposi1ons English: modify, combine, and relate statements with not, and, or, implies, if- then Atomic proposi6ons: boolean constant (T,F) or variable (e.g. p, q, r, V A,V B ) Compound proposi6ons: apply operators to atomic forms in order of precedence. Construct from logical connec1ves and other proposi1ons. Precise mathema1cal meaning of operators can be specified by truth tables 9

Common Operators Nega6on: not Conjunc6on: and Disjunc6on: or Implica6on/ Condi6onal: if- then Monadic operator: one argument Examples: iden1ty, nega1on, constant... (4 operators) Dyadic operator: two arguments Examples: conjunc1on, disjunc1on... (16 operators) 10

Truth Tables (idea) Boolean values & domain: {T,F} n- tuple: (x 1, x 2,..., x n ) Operator on n- tuples : g(x 1 = v 1, x 2 = v 2,..., x n = v n ) Defini1on: A truth table defines an operator g on n- tuples by specifying a boolean value for each tuple Number of rows in a truth table? R = 2 n Number of operators with n arguments? 2 R 11

Truth Table (nega1on) The nega6on of a proposi1on p is denoted by p and has this truth table: p p T F F T Example: If p denotes The earth is round., then p denotes It is not the case that the earth is round, or more simply The earth is not round. 12

Truth Table (conjunc1on) The conjunc6on of proposi1ons p and q is denoted by p q and has this truth table: p q p q T T T T F F F T F F F F Example: If p denotes I am at home. and q denotes It is raining. then p q denotes I am at home and it is raining. 13

Truth Table (disjunc1on) The disjunc6on of proposi1ons p and q is denoted by p q and has this truth table p q p q T T T T F T F T T F F F Example: If p denotes I am at home. and q denotes It is raining. then p q denotes I am at home or it is raining. 14

Truth Table (exclusive or) If only one of the proposi1ons p and q is true but NOT both, we use Xor symbol p q p q T T F T F T F T T F F F Example: When reading the sentence Soup or salad comes with this entrée, we do not expect to be able to get both soup and salad 15

Truth Table (implica1on) If p and q are proposi1ons, then p q is a condi6onal statement or implica6on: if p, then q p q p q T T T T F F F T T F F T Example: If p denotes I am at home. and q denotes It is raining. then p q denotes If I am at home then it is raining. In p q, p is the antecedent and q is the consequent 16

Understanding Implica1on There does not need to be any connec1on between the antecedent or the consequent. The meaning of p q depends only on the truth values of p and q. If pigs fly then you are rich. Think of an obliga1on or a contract If I am elected, then I will lower taxes. 17

Puzzle (compound proposi1ons) Statements: A: I am the knight B: C: A is not the knave B is not the knave Compound proposi1ons: V A ::= A is not the knave K A K B ::= A is the knight or B is the knight V A V B ::= If A is the knave, then B is not the knave K c V B ::= If C is the knight, then C tells the truth 18

Truth Table (rules) Row for every combina1on of values for atomic proposi1ons Column for truth value of each expression in the compound proposi1on Column (far right) for the truth value of the compound proposi1on Build step by step Ø p q r means (p q) r Big problem with this approach! Operator 1 2, 3 4, 5 Precedence 19

Truth Table (example) Construct a truth table for p q r r p q p q r T T T F T F T T F T T T T F T F T F T F F T T T F T T F T F F T F T T T F F T F F T F F F T F T 20

Logical Equivalences Two compound proposi1ons p and q are logically equivalent if and only if the columns in the truth table giving their truth values agree. We write this as p q or as p q Not an operator! (rela1on on proposi1ons) This truth table shows p q is equivalent to p q p q p p q p q T T F T T T F F F F F T T T T F F T T T 21

Converse, Contraposi1ve, & Inverse Given p q, The converse is: q p The contraposi6ve is: q p The inverse is: p q Example: Raining is a sufficient condi1on for my not going to town. Converse: If I do not go to town, then it is raining. Inverse: If it is not raining, then I will go to town. Contraposi1ve: If I go to town, then it is not raining. 22

Truth Table (bicondi1onal) If p and q are proposi1ons, then p q is a bicondi6onal (IFF) statement: p if and only if q p q p q T T T T F F F T F F F T Example: If p denotes I am at home. and q denotes It is raining. then p q denotes I am at home if and only if it is raining. 23

Terminology (p q) Simple English: if p, then q if p, q q unless p q if p q whenever p q follows from p p implies q p only if q q when p p is sufficient for q q is necessary for p A necessary condi1on for p is q A sufficient condi1on for q is p Bicondi1onal: p is necessary and sufficient for q p iff q 24

Tautology & Contradic1on Tautology is a proposi1on which is always true Example: p p Contradic6on is a proposi1on which is always false Example: p p Con6ngency is a proposi1on which is neither a tautology or a contradic1on P p p p p p T F T F F T T F 25

Laws of Logic Trivial laws: iden1ty, double nega1on Express and in terms of each other via Order & Parenthesis (3,4): Distribute operator (5): Laws involving (bi)condi1onal operators (p (q r)) (p q) (p r) 26

The Axioma1c Method Begin with some assump1ons (axioms) Given as true or used to specify the system Provide an argument (proof) Sequence (chain) of logical deduc6ons and previous results (premises) Ends with the proposi1on in ques1on (conclusion) Important true proposi1ons are called theorems Hierarchy of derived truths: Proposi6on: minor result (theorem) Lemma: preliminary proposi1on useful for proving later proposi1ons Corollary: a proposi1on that follows in just a few logical steps from a theorem 27

Logical Argument To provide a logical argument (proof): Sequence of logical deduc6ons (rules of inference) and previous compound proposi1ons (premises) Ends with the proposi1on in ques1on (conclusion) A valid argument can never leads to incorrect (false) conclusion from correct statements (premises) Fallacy: from true statements to incorrect conclusion If some premises untrue: conclusion of valid argument might be false Conclusion of fallacy might be true If premises are correct & argument is valid, conclusion is correct 28

Rules of Inference (modus ponens) Example: Let p be It is snowing. Let q be I will study discrete math. If it is snowing, then I will study discrete math. It is snowing. Therefore, I will study discrete math. Method of rule valida1on: record (in a truth table) where all premises are true. If the conclusion is also true in every case, then the rule is valid 29

Rules of Inference (fallacy) Affirm the consequent, conclude the antecedent Example: Let p be It is snowing. Let q be I will study discrete math. If it is snowing, then I will study discrete math. I will study discrete math. Therefore, it is snowing. p q q - - - - - - - p 30

Rules of Inference (modus tollens) Example: Let p be It is snowing. Let q be I will study discrete math. If it is snowing, then I will study discrete math. I will not study discrete math. Therefore, it is not snowing. Fallacy: deny the antecedent (p), conclude the consequent (q) is false 31

Common Rules Addi1on: Simplifica1on: Disjunc1ve- syllogism: Hypothe1cal- syllogism: 32

Puzzle (logical argument) Statements: A: I am the knight K A B: A is not the knave V A C: B is not the knave V B Argument: Suppose A is the Knight (K). Then B tells truth, B must be a spy (S). But C tells truth, can t be a knave (V) K A V A ::= If A is the knight, then A is not the knave V A (K B S B ) ::= If A is not knave, then B is knight or spy V B (K c S c ) ::= If B is not knave, then C is knight or spy S B (S A S c ) ::= If B is the spy then A and C are not spies 33

Quan1fiers Purpose: express words such as all, some Universal Quan6fier: For all, Existen6al Quan6fier: There exists, Defini1on: x P(x) asserts P(x) is true for every x in the domain x P(x) asserts P(x) is true for some x in the domain 34

Quan1fiers (examples) x P(x): For all x, P(x) or For every x, P(x) x P(x): For some x, P(x) or There is an x such that P(x) or For at least one x, P(x). Example: 1) P(x) denotes x > 0 2) Q(x) denotes x is even Ø For posi1ve integers domain, x P(x) is true x P(x) is true Ø For integers domain, x P(x) is false but x P(x) is true Ø For integers domain, x Q(x) is false but x P(x) is true 35

Quan1fiers (scope) Rules: The quan1fiers and have higher precedence than all the logical operators. Note loca1on of parenthesis: Ø x P(x) Q(x) means ( x P(x)) Q(x) Ø x (P(x) Q(x)) means something different Variable not within scope (clause to which it applies) of any quan1fier: unbound variable Ø x + 4 > 2 Ø y [2x + 3y = 7] 36

Quan1fiers (transla1on) Example: 1) P(x): x has taken calculus. 2) Domain: students in class 3) x P(x): Every student in class has taken calculus. Translate: It is not the case that every student in class has taken calculus. Answer: 1) x P(x) ( x )[ P(x) ] 2) There is a student in class who has not taken calculus x P(x) 37

Quan1fiers (nega1on rules) Rules: 38

Quan1fiers (transla1on) Example: 1. All lions are fierce. 2. Some lions do not drink coffee. 3. Some fierce creatures do not drink coffee. Translate to predicates: a. P(x): x is a lion b. Q(x): x is fierce c. R(x): x drinks coffee 1. x [ P(x) Q(x) ] 2. x [ P(x) R(x) ] 3. x [ Q(x) R(x) ] 39

Quan1fiers (mixing) Nested quan1fiers: Every real number has an inverse x y (x + y = 0) Specify domain when not evident: the domains of x and y are the real numbers ( x R) ( y R)[x + y = 0] Does order macer? Switching order is not safe when the quan1fiers are different! x y P(x,y) and y x P(x,y) have the same truth value 40

Nested Quan1fiers (transla1on) Example 1: Brothers are siblings. Solu>on: x y [ B(x,y) S(x,y) ] Example 2: Everybody loves somebody. Solu>on: x y L(x,y) Example 3: There is someone who is loved by everyone. Solu>on: y x L(x,y) 41

Nested Quan1fiers (nega1on) Example 1: There does not exist a woman who has taken a flight on every airline in the world. Ø Solu>on: w a f [ P(w,f ) Q(f,a) ] Use nega1on rules to move as far inwards as possible: 42

Nested Quan1fiers (nega1on) Example 1: There does not exist a woman who has taken a flight on every airline in the world. Ø Solu>on: w a f [ P(w,f ) Q(f,a) ] Use nega1on rules to move as far inwards as possible: Ø Solu>on: w ( a f [ P(w,f ) Q(f,a) ] ) w ( a f [ P(w,f ) Q(f,a) ] ) w a ( f [ P(w,f ) Q(f,a) ] ) w a f [ P(w,f ) Q(f,a) ] w a f [ P(w,f ) Q(f,a) ] 43

Proof PaCerns Proof approach: Direct / Indirect methods Forward / Backward reasoning Standard templates: Implica1on (If P then Q) Contraposi1ve (if not Q then not P) If and only if statement (P if and only if Q) By cases By contradic1on 44

Backward Reasoning Claim: arithme1c/geometric means inequality Approach: 1. Start from conclusion 2. Show when conclusion is true 3. Algebraic manipula1on a. Simplify 4. Derive simple equivalent premise which is clearly true Let a, b > 0, a b. Then, (a + b) 2 (a + b) > 2 ab (a + b) 2 > 4ab > ab a 2 + 2ab + b 2 > 4ab a 2 2ab + b 2 > 0 (a b) 2 > 0 45

Proving the Contraposi1ve Claim: If r is an irra1onal number then r is an irra1onal number $ Q p ' % : p, q Z, q 0( Approach: & q ) 1. Assume r is ra1onal, show that r is ra1onal. 2. Use defini1on to express r as a frac1on 3. Algebraic manipula1on: square both sides 4. Conclude claim 46

Proving If and Only If Claim: The standard devia1on (std) of a set of numbers is zero if and only if (iff) all the values are equal to the mean Approach: 1. Construct chain of iff statements 2. Use defini1on of std and mean 3. Algebraic manipula1on a. Simplify: square both sides 4. Show that condi1on holds for each value iff condi1on holds for the set 47

Proof by Cases Claim: Let x be any integer, then x 2 + x is even Approach: 1. Break into cases: a. Case 1: x is even b. Case 2: x is odd 2. Use defini1on of even/odd integer to express x 2 + x as an even integer a. Case 1: x = 2n b. Case 2: x = 2n +1 48

Proof by Contradic1on Claim: 2 is irra1onal Approach: 1. Assume 2 is ra1onal 2. Use defini1on to express 2 as frac1on in lowest terms 3. Algebraic manipula1on a. Square both sides b. Apply rules of divisibility 2 Q 4. Derive a nega1on of one of the premises (2), that is the contradic1on. 49