Logic and Discrete Math Lecture notes 3

Similar documents
CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

Handout #1: Mathematical Reasoning

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

DISCRETE MATH: LECTURE 3

3. Mathematical Induction

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

Cosmological Arguments for the Existence of God S. Clarke

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

Logic in general. Inference rules and theorem proving

DEDUCTIVE & INDUCTIVE REASONING

Lecture 16 : Relations and Functions DRAFT

A Few Basics of Probability

Mathematical Induction

6.080/6.089 GITCS Feb 12, Lecture 3

Beyond Propositional Logic Lukasiewicz s System

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

CHAPTER 7 GENERAL PROOF SYSTEMS

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Invalidity in Predicate Logic

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Math 3000 Section 003 Intro to Abstract Math Homework 2

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

INCIDENCE-BETWEENNESS GEOMETRY

Quine on truth by convention

1.2 Forms and Validity

CSE 135: Introduction to Theory of Computation Decidability and Recognizability

Predicate Logic. For example, consider the following argument:

of Nebraska - Lincoln

Kant s deontological ethics

Reading 13 : Finite State Automata and Regular Expressions

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

The Deadly Sins of Algebra

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

One natural response would be to cite evidence of past mornings, and give something like the following argument:

Basic Proof Techniques

LS.6 Solution Matrices

Philosophical argument

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Introduction to formal semantics -

SECTION 10-2 Mathematical Induction

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

THE FUNDAMENTAL THEOREM OF ARBITRAGE PRICING

Solutions to Math 51 First Exam January 29, 2015

[Refer Slide Time: 05:10]

CS510 Software Engineering

4.5 Linear Dependence and Linear Independence

5 Systems of Equations

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

Cartesian Products and Relations

Hypothetical Syllogisms 1

Public Key Cryptography: RSA and Lots of Number Theory

Automata and Formal Languages

CSE 459/598: Logic for Computer Scientists (Spring 2012)

Chapter 5: Fallacies. 23 February 2015

This chapter is all about cardinality of sets. At first this looks like a

Course Outline Department of Computing Science Faculty of Science. COMP Applied Artificial Intelligence (3,1,0) Fall 2015

Student Outcomes. Lesson Notes. Classwork. Discussion (10 minutes)

So let us begin our quest to find the holy grail of real analysis.

Logic Appendix. Section 1 Truth Tables CONJUNCTION EXAMPLE 1

Basics of Counting. The product rule. Product rule example. 22C:19, Chapter 6 Hantao Zhang. Sample question. Total is 18 * 325 = 5850

Clock Arithmetic and Modular Systems Clock Arithmetic The introduction to Chapter 4 described a mathematical system

Logic and Reasoning Practice Final Exam Spring Section Number

Boolean Algebra Part 1

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Math 4310 Handout - Quotient Vector Spaces

CS 3719 (Theory of Computation and Algorithms) Lecture 4

Five High Order Thinking Skills

Resolution. Informatics 1 School of Informatics, University of Edinburgh

Slippery Slopes and Vagueness

Understanding Logic Design

The Classes P and NP

8 Square matrices continued: Determinants

CAs and Turing Machines. The Basis for Universal Computation

Linear Algebra. A vector space (over R) is an ordered quadruple. such that V is a set; 0 V ; and the following eight axioms hold:

Examination paper for MA0301 Elementær diskret matematikk

Logic in Computer Science: Logic Gates

Computational Logic and Cognitive Science: An Overview

Lecture 8: Resolution theorem-proving

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

Example 1. Consider the following two portfolios: 2. Buy one c(s(t), 20, τ, r) and sell one c(s(t), 10, τ, r).

The last three chapters introduced three major proof techniques: direct,

The Basics of Graphical Models

8 Primes and Modular Arithmetic

Mathematical Induction

Lecture 11: Tail Recursion; Continuations

Lecture 2: Moral Reasoning & Evaluating Ethical Theories

1/9. Locke 1: Critique of Innate Ideas

We would like to state the following system of natural deduction rules preserving falsity:

p: I am elected q: I will lower the taxes

Practice with Proofs

Formal Languages and Automata Theory - Regular Expressions and Finite Automata -

CS154. Turing Machines. Turing Machine. Turing Machines versus DFAs FINITE STATE CONTROL AI N P U T INFINITE TAPE. read write move.

26 Integers: Multiplication, Division, and Order

Lecture 17 : Equivalence and Order Relations DRAFT

4.2 Euclid s Classification of Pythagorean Triples

How To Understand The Theory Of Hyperreals

Transcription:

CSE 240 Logic and Discrete Math Lecture notes 3 Weixiong Zhang Washington University in St. Louis http://www.cse.wustl.edu/~zhang/teaching /cse240/spring10/index.html 1

Today Refresher: Chapter 1.2 Chapter 1.3 : Arguments All images are copyrighted to their respective copyright holders and reproduced here for academic purposes under the condition of fair using. 2

Interpretation In propositional logic interpretation is a mapping from variables in your formulae to {true, false} Example: Formula: Interpretation 1: Interpretation 2: A v B A = true, B = false A = false, B = false 3

Interpretations How many interpretations do the following formulae allow? A B 4 (A B & A) B 4 Why not 8 or 16? The number of interpretations is 2 N where N is the number of independent variables 4

Questions? 5

Conditions Suppose we care about statement X X = this assignment is copied We want to evaluate X (true/false?) Suppose we know A such that A X A is a sufficient condition A= the cheater is caught in the act Suppose we know B such that X B B is a necessary condition B= there was an original assignment to copy from 6

Criteria Suppose we know C such that C X C is a criterion C= someone has copied this assignment Graphically: A X B C 7

Wanted : Criteria Medical tests Software/hardware correctness Fraud/cheating Financial market Psychology (e.g., in sales) Science : mathematics, physics, chemistry, etc. Logic : If C is a criterion for X then C X! 8

Practice It is frequently non-trivial to derive a criterion for a real-life property X Then we have to settle for: Sufficient conditions: If this quality test passes then the product is fine Necessary conditions: If the patient breaks a leg they will be in pain Statistical validity : the condition works most of the time In logic : the condition works all the time! 9

Derivation of Criteria Logic/Mathematics/Theoretical sciences: Equivalent transformations Proofs by contradiction Empirical sciences: Statistical tests Function approximation Artificial Intelligence: Machine learning These methods are not guaranteed to produce true criteria 10

Questions? 11

Logic Equivalence Propositions/statements/formulae A and B are logically equivalent when: A holds if and only if B holds Notation: A B Examples: A v A is equivalent to: A A v ~A is equivalent to: true 12

Challenge Theorem 1.1.1 : Boolean Algebra Derive the rest (e.g., #8) from the first 5 equivalences 13

Use of Equivalences Deriving equivalent formulae! Of course, but why do we care? Simplification of formula Simplification of code Simplification of hardware (e.g., circuits) Derivation of criteria! 14

Limitations Not all statements are equivalent! Of course not, but what else is there? Some formulae are stronger than others They imply or entail other formula but not the other way around Equivalences cannot directly help us proving such entailments 15

Entailment A collection of statements P 1,,P n (premises) entails statement Q (conclusion) if and only if: Whenever all premises hold the conclusion holds For every interpretation I that makes all P j hold, I also makes Q hold Example: Premises: P 1 = If Socrates is human then Socrates is mortal P 2 = Socrates is human Conclusion: Q = Socrates is mortal 16

Valid/Invalid Arguments Suppose someone makes an argument: P 1,..,P N therefore Q The argument is called valid iff: P 1,,P N logically entail Q That is: Q must hold if all P i hold Otherwise the argument is called invalid 17

Example Sample argument: P 1 = If Socrates is human then Socrates is mortal P 2 = Socrates is human Therefore: Q = Socrates is mortal Valid / invalid? 18

Entailment Then is the following argument valid? P 1 P 2 entails Q Yes? Very well, but what if my interpretation I sets P 1 and P 2 to true but Q to false? Then by definition Q is not entailed by P 1 and P 2 So do P 1,P 2 entail Q or do they not? 19

What Happened We considered P 1, P 2, and Q under a particular (common sense) interpretation: P 1 = If Socrates is human then Socrates is mortal true P 2 = Socrates is human true Q = Socrates is mortal true Thus, they were merely logical constants to us: P 1 =true P 2 =true Q=true 20

Generality Thus our argument was: True True entails True Well, this is not very useful because it doesn t tell us anything about validity of other arguments. For example: P 1 = If J.B. broke his leg then J.B. is in pain P 2 = J.B. broke his leg entails Q= J.B. is in pain Is this argument valid? 21

Extracting the Essence How do we know it is valid? Because regardless of who J.B. is and what happened to him/her, we somehow know that: If P 1 and P 2 hold Then Q will hold But how do we know that? How can we extract the essence of the dead Socrates and J.B. in pain arguments? 22

General Structure! Recall both arguments: P 1 If Socrates is human then Socrates is mortal If J.B. broke his leg then J.B. is in pain P 2 Socrates is human J.B. broke his leg entails Q Socrates is mortal J.B. is in pain Note that P 1, P 2, and Q are related! Both arguments share the same structure: P 1 P 2 entails Q If X then Y X Y Then for any interpretation I as long as I satisfies P 1 and P 2, interpretation I must satisfy Q 23

Modus Ponens The generalized argument P 1 = X Y P 2 = X entails Q = Y is much more useful! Why? method of affirming (Lat.) Because it captures the essence of both arguments and can be used for infinitely many more 24

Valid Arguments (Revisited) Suppose someone makes an argument: P 1,..,P N therefore Q The argument is called valid iff: P 1,,P N logically entail Q That is: For any interpretation I that satisfies all P j, interpretation I must necessarily satisfy Q Usually: P j and Q are somehow related formulae and P 1 & & P N can be true or false depending on the interpretation I 25

Logical Form Since: we consider all possible interpretations the conjunction of premises: P 1 & & P N is not always true or false The conclusion Q must follow from / be entailed by the premises by logical form of P j and Q alone (p. 29 in the text) 26

Questions? 27

How Do We: Tell between a valid argument and an invalid argument: People are mortal. Socrates is a man. Socrates is mortal. Ducks fly. F-16 flies. F-16 is a duck. Prove that something logically follows from something else: 1: Everybody likes Buddha 2: Everybody likes someone Prove that something is logically equivalent to something else: 1: Everybody likes cream and sugar 2: Everybody likes cream and everybody likes sugar Prove that there is a contradiction? 28

Propositional Logic Method #1: Go through all possible interpretations and check the definition of valid argument Method #2: Use derivation rules to get from the premises to the conclusion in a logically sound way derive the conclusions from premises 29

Method #1 Section 1.3 in the text proves many arguments/inference rules using truth tables Suppose the argument is: P 1,,P N therefore Q Create a truth table for formula F=(P 1 & & P N Q) Check if F is a tautology 30

But Why? Recall: Formula A entails formula B iff (A B) is a tautology In general: premises P 1,,P N entail Q iff formula F=(P 1 & & P N Q) is a tautology 31

Example #1 P v Q v R ~R entails P v Q valid/invalid? (example 1.3.1 in the book, p. 30) 32

Example #2 P v Q v R ~R entails Q valid/invalid? 33

Example #3 P Q P entails Q valid/invalid? Modus ponens 34

Example #4 P Q Q entails P valid/invalid? 35

Example #5 P Q ~Q entails ~P valid/invalid? Modus tollens 36

Example #6 P Q entails ~Q ~P valid/invalid? In fact, we proved last time that: (P Q) (~Q ~P) 37

Example #7 P v Q ~P & ~Q entails P & Q valid/invalid? Any argument with a contradiction in its premises is valid by default 38

Pros & Cons Method #1: Pro: straight-forward, not much creativity machines can do Con: the number of interpretations grows exponentially with the number of variables cannot do for many variables Con: in predicate and some other logics even a small formula may have an infinite number of interpretations 39

Questions? 40

Method #2 : Derivations To prove that an argument is valid: Begin with the premises Use valid/sound inference rules Arrive at the conclusion 41

Inference Rules But what are these inference rules? They are simply valid arguments! Example: X & Y X & Y Z & W therefore Z & W by modus ponens 42

Example #1 (X&Y Z&W) & K X&Y therefore Z&W How? (X&Y Z&W) & K X&Y Z&W by conjunctive simplification X&Y Z&W by modus ponens 43

Derivations The chain of inference rules that starts with the premises and ends with the conclusion is called a derivation: The conclusion is derived from the premises Such a derivation makes a proof of argument s validity 44

Example #1 (X&Y Z&W) & K X&Y therefore Z&W How? (X&Y Z&W) & K derivation X&Y Z&W by conjunctive simplification X&Y Z&W by modus ponens 45

Pros & Cons Method #2: Pro: often can get a dramatic speed-up over truth tables. Con: requires creativity and intuition harder to do by machines Con: semi-decidable : there is no algorithm that can prove any first-order predicate logic argument to be valid or invalid 46

Questions? 47

Fallacies An error in derivation leading to an invalid argument Vague formulations of premises/conclusion Missing steps Using non-sound inference rules, e.g.: Converse error Inverse error 48

Converse Error If John is smart then John makes a lot of money John makes a lot of money Therefore: John is smart Tries to use this non-sound inference rule : A B, B Thus: A 49

Inverse Error If John is smart then John makes a lot of money John is not smart Therefore: John doesn t make a lot of money Tries to use this non-sound inference rule : A B, ~A Thus: ~B 50

Questions? 51

Truth of facts vs. Validity of Arguments The premises are assumed to be true ONLY in the context of the argument The following argument is valid: If John Lennon was a rock star then he was a woman John Lennon was a rock star Thus: John Lennon was a woman But the 1 st premise doesn t hold under the common sense interpretation 52

Inference Rules Table 1.3.1 on page 39 If practice with the rules then will be more fluent using them If are more fluent using them then will be more likely to get a better mark on exams 53

Summary Equivalence: A B A holds iff B holds A is a criterion for B B is a criterion for A A entails B B entails A A and B are equivalently strong Formula F=(A B) is a tautology 54

Summary Entailment: A entails B B follows from A A B is a valid argument A is a sufficient condition for B B is a necessary condition for A If A holds then B holds A may be stronger than B Formula F=(A B) is a tautology 55

The Big Picture Logic is being used to verify validity of arguments An argument is valid iff its conclusion logically follows from the premises Derivations are used to prove validity Inference rules are used as part of derivations 56

Questions? 57