Propositional Logic.

Slides:



Advertisements
Similar presentations
Propositional Logic Lecture 10: Oct 29.
Advertisements

1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Deduction In addition to being able to represent facts, or real- world statements, as formulas, we want to be able to manipulate facts, e.g., derive new.
CS128 – Discrete Mathematics for Computer Science
Chapter 1 The Logic of Compound Statements. Section 1.2 – 1.3 (Modus Tollens) Conditional and Valid & Invalid Arguments.
Logic 3 Tautological Implications and Tautological Equivalences
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
Logic and Proof. Argument An argument is a sequence of statements. All statements but the first one are called assumptions or hypothesis. The final statement.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
EE1J2 – Discrete Maths Lecture 5 Analysis of arguments (continued) More example proofs Formalisation of arguments in natural language Proof by contradiction.
Propositional Logic Lecture 1: Sep 2. Content 1.Mathematical proof (what and why) 2.Logic, basic operators 3.Using simple operators to construct any operator.
Propositional Logic Lecture 2: Sep 9. Conditional Statement If p then q p is called the hypothesis; q is called the conclusion “If your GPA is 4.0, then.
Logical and Rule-Based Reasoning Part I. Logical Models and Reasoning Big Question: Do people think logically?
Adapted from Discrete Math
Propositional Logic.
MATERI II PROPOSISI. 2 Tautology and Contradiction Definition A tautology is a statement form that is always true. A statement whose form is a tautology.
Chapter 1: The Foundations: Logic and Proofs
1 Methods of Proof CS/APMA 202 Epp, chapter 3 Aaron Bloomfield.
Conditional Statements CS 2312, Discrete Structures II Poorvi L. Vora, GW.
Proofs1 Elementary Discrete Mathematics Jim Skon.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
10/17/2015 Prepared by Dr.Saad Alabbad1 CS100 : Discrete Structures Proof Techniques(1) Dr.Saad Alabbad Department of Computer Science
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Lecture 10 Methods of Proof CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Lecture 2: Proofs and Recursion. Lecture 2-1: Proof Techniques Proof methods : –Inductive reasoning Lecture 2-2 –Deductive reasoning Using counterexample.
Chapter 1 Logic and Proof.
Discrete Mathematical
Logic and Reasoning.
2. The Logic of Compound Statements Summary
Propositional Logic.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 311 Foundations of Computing I
Argument An argument is a sequence of statements.
Discrete Mathematics Lecture 1 Logic of Compound Statements
CSE15 Discrete Mathematics 01/30/17
Discrete Mathematics Logic.
Formal Logic CSC 333.
Chapter 1 Logic and Proofs Homework 1 Two merchants publish new marketing campaign to attract more customers. The first merchant launches a motto “Good.
Proof methods We will discuss ten proof methods: Direct proofs
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
Methods of proof Section 1.6 & 1.7 Wednesday, June 20, 2018
MATH 245 Spring 2009 This is mathematics for computer science
(CSC 102) Discrete Structures Lecture 2.
Methods of Proof CS 202 Epp, chapter 3.
Proof Techniques.
Discrete Structures for Computer Science
Principles of Computing – UFCFA3-30-1
Information Technology Department
Sets and Logic…. Chapter 3
CS201: Data Structures and Discrete Mathematics I
Mathematical Reasoning
Methods of Proof. Methods of Proof Definitions A theorem is a valid logical assertion which can be proved using Axioms: statements which are given.
CSE 311: Foundations of Computing
CS 270 Math Foundations of CS
CS 220: Discrete Structures and their Applications
Applied Discrete Mathematics Week 1: Logic
Discrete Mathematics Dr.-Ing. Erwin Sitompul
Computer Security: Art and Science, 2nd Edition
Discrete Mathematics Logic.
Information Technology Department SKN-SITS,Lonavala.
Foundations of Discrete Mathematics
Valid and Invalid Arguments
Mathematical Reasoning
Discrete Structures Prepositional Logic 2
Logical and Rule-Based Reasoning Part I
Arguments in Sentential Logic
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

Propositional Logic

This Lecture In the last lecture we introduced logic formulas. In this lecture we are going to use logic to derive things. The two important components in this lecture are: Conditional Statements Arguments

Conditional Statement If p then q p implies q p is called the hypothesis; q is called the conclusion The department says: “If your GPA is 4.0, then you will have full scholarship.” When is the above sentence false? It is false when your GPA is 4.0 but you don’t receive full scholarship. But it is not false if your GPA is below 4.0. Another example: “If there is a match of Bangladesh, then there is no class.” When is the above sentence false?

Q P P Q F T T F Logic Operator Convention: if we don’t say anything wrong, then it is not false, and thus true.

Logical Equivalence If you see a question in the above form, there are usually 3 ways to deal with it. Truth table Use logical rules Intuition

Q P P Q F T T F If-Then as Or Idea 2: Look at the false rows, negate and take the “and”. If you don’t give me all your money, then I will kill you. Either you give me all your money or I will kill you (or both). If you talk to her, then you can never talk to me. Either you don’t talk to her or you can never talk to me (or both).

P Q ~P P Q ~P If-Then as Or P Q  ~P or Q If you don’t give me all your money, then I will kill you. Either you give me all your money or I will kill you (or both). ~P P Q If you talk to her, then you can never talk to me. Either you don’t talk to her or you can never talk to me (or both). ~P

Negation of If-Then If you eat an apple everyday, then you have no toothache. You eat an apple everyday but you have toothache. If my computer is not working, then I cannot finish my homework. My computer is not working but I can finish my homework. previous slide DeMorgan

Contrapositive The contrapositive of “if p then q” is “if ~q then ~p”. Statement: If you are a CS year 1 student, then you are taking CSC 2110. Contrapositive: If you are not taking CSC 2110, then you are not a CS year 1 student. Statement: If x2 is an even number, then x is an even number. Contrapositive: If x is an odd number, then x2 is an odd number. Fact: A conditional statement is logically equivalent to its contrapositive.

Proofs Statement: If P, then Q  if ~Q then ~P (: Contrapositive) T F F T

If, Only-If You will succeed if you work hand. You will succeed only if you work hard. R if S means “if S then R” or equivalently “S implies R” We also say S is a sufficient condition for R. R only if S means “if R then S” or equivalently “R implies S” We also say S is a necessary condition for R. You will succeed if and only if you work hard. P if and only if (iff) Q means P and Q are logically equivalent. That is, P implies Q and Q implies P.

if a number x greater than 2 is not an odd number, then x is not a prime number. O  if a number x greater than 2 is an odd number P  x is a prime number. This sentence says But of course it doesn’t mean if a number x greater than 2 is an odd number, then x is a prime number.

Q P P Q F T T F Necessary AND Sufficient Condition Note: P Q is equivalent to (P Q) (Q P) Note: P Q is equivalent to (P Q) ( P Q)

Is the statement “x is an even number if and only if x2 is an even number” true? P Q If x is an even number then x2 is an even number: P -> Q If x2 is an even number then x is an even number: Q -> P x is an even number x2 is an even number True x2 is an odd number False x is an odd number So, from truth table, P  Q x is an even number if and only if x2 is an even number

Argument An argument is a sequence of statements. All statements but the final one are called assumptions or hypothesis. The final statement is called the conclusion. An argument is valid if: whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday. Yesterday is Tuesday. Hypotheses Conclusion

p q p→q T F Modus Ponens If p then q. If typhoon, then class cancelled. Typhoon. Class cancelled. assumptions conclusion p q p→q T F Modus ponens is Latin meaning “method of affirming”.

p q p→q ~q ~p T F Modus Tollens If p then q. If typhoon, then class cancelled. Class not cancelled. No typhoon. assumptions conclusion p q p→q ~q ~p T F Modus tollens is Latin meaning “method of denying”.

Equivalence A student is trying to prove that propositions P, Q, and R are all true. She proceeds as follows. First, she proves three facts: P implies Q Q implies R R implies P. Then she concludes, ``Thus P, Q, and R are all true.'' Proposed argument: assumption Is it valid? conclusion

Valid Argument? Is it valid? assumptions conclusion P Q R T F T F OK? yes F no To prove an argument is not valid, we just need to find a counterexample.

p q p→q T F Valid Arguments? assumptions conclusion If p then q. q p If you are a fish, then you drink water. You drink water. You are a fish. Assumptions are true, but not the conclusion, i.e., a counter example!!! So, INVALID ARGUMENTS

p q p→q ~p ~q T F Valid Arguments? assumptions conclusion If p then q. If you are a fish, then you drink water. You are not a fish. You do not drink water. Assumptions are true, but not the conclusion, i.e., a counter example!!! So, INVALID ARGUMENTS

p q p→q T F Valid Arguments? assumptions conclusion If p then q. p q If you are a fish, then you drink water. You are a fish. You drink water. No counter examples!!! For all cases, when assumptions are true, conclusion is true. In fact there is only one such case here. So, VALID ARGUMENTS

p q p→q ~q ~p T F Valid Arguments? assumptions conclusion If p then q. If you are a fish, then you drink water. You do not drink water. You are not a fish. No counter examples!!! For all cases, when assumptions are true, conclusion is true. In fact there is only one such case here. So, VALID ARGUMENTS

Exercises

More Exercises

Knights and Knaves (Who is who?) Using Contradiction: Knights and Knaves (Who is who?) Knights always tell the truth. Knaves always lie. A says: B is a knight. B says: A and I are of opposite type. B is a Night: P A is a Night: Q Suppose A is a knight. Then B is a knight (because what A says is true). Then A is a knave (because what B says is true) A contradiction. So A must be a knave. So B must be a knave (because what A says is false). Q. Then, P Then, ~Q; CONTRADICTION! So, ~Q. So, ~P.

Quick Summary The meaning of IF and its logical forms Contrapositive Conditional Statements The meaning of IF and its logical forms Contrapositive If, only if, if and only if Arguments definition of a valid argument method of affirming, denying, contradiction Key points: Make sure you understand conditional statements and contrapositive. Make sure you can check whether an argument is valid.

“The sentence below is false.” “The sentence above is true.” Which is true? Which is false? “The sentence below is false.” “The sentence above is true.”