Discrete Structures Chapter 1 Part A Fundamentals of Logic Nurul Amelina Nasharuddin Multimedia Department 1.

Slides:



Advertisements
Similar presentations
Chapter 2 Fundamentals of Logic Dept of Information management National Central University Yen-Liang Chen.
Advertisements

Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
Chapter 1 The Logic of Compound Statements. Section 1.3 Valid & Invalid Arguments.
CS128 – Discrete Mathematics for Computer Science
Copyright © Cengage Learning. All rights reserved. CHAPTER 2 THE LOGIC OF COMPOUND STATEMENTS THE LOGIC OF COMPOUND STATEMENTS.
Chapter 1 The Logic of Compound Statements. Section 1.2 – 1.3 (Modus Tollens) Conditional and Valid & Invalid Arguments.
2.2 Conditional Statements. Goals Identify statements which are conditional Identify the antecedent and consequent of a conditional statement Negate conditional.
Discrete Mathematics Lecture 1 Logic of Compound Statements Harper Langston New York University.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Through the Looking Glass, 1865
Introduction to Logic Logical Form: general rules
Copyright © Cengage Learning. All rights reserved.
Adapted from Discrete Math
Harper Langston New York University Summer 2015
Propositional Logic.
Discrete Maths 2. Propositional Logic Objective
Week 1 - Wednesday.  Course overview  Propositional logic  Truth tables  AND, OR, NOT  Logical equivalence.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Valid and Invalid Arguments
2. The Logic of Compound Statements
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Chapter 1 Logic Section 1-1 Statements Open your book to page 1 and read the section titled “To the Student” Now turn to page 3 where we will read the.
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
Lecture 4. CONDITIONAL STATEMENTS: Consider the statement: "If you earn an A in Math, then I'll buy you a computer." This statement is made up of two.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Valid and Invalid Arguments
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
LOGIC.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 1: The Foundations: Logic and Proofs
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
Week 1 - Wednesday.  Course overview  Propositional logic  Truth tables  AND, OR, NOT  Logical equivalence.
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
Copyright © Cengage Learning. All rights reserved.
Outline Logic Propositional Logic Well formed formula Truth table
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Foundations of Discrete Mathematics Chapter 1 By Dr. Dalia M. Gil, Ph.D.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Discrete Math by R.S. Chang, Dept. CSIE, NDHU1 Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Law of logic Lecture 4.
Chapter 1 Logic and proofs
Discrete Mathematics Lecture 2 Continuing Logic, Quantified Logic, Beginning Proofs Harper Langston New York University Summer 2016.
Harper Langston New York University Summer 2017
2. The Logic of Compound Statements Summary
Valid and Invalid Arguments
Discrete Mathematics Lecture 1 Logic of Compound Statements
Discrete Mathematics Logic.
Discrete Mathematics Logic of Compound Statements
COMP 1380 Discrete Structures I Thompson Rivers University
(CSC 102) Discrete Structures Lecture 2.
Copyright © Cengage Learning. All rights reserved.
Proposition logic and argument CISC2100, Spring 2017 X.Zhang
Information Technology Department
CS201: Data Structures and Discrete Mathematics I
Discrete Mathematics Logic.
COMP 1380 Discrete Structures I Thompson Rivers University
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

Discrete Structures Chapter 1 Part A Fundamentals of Logic Nurul Amelina Nasharuddin Multimedia Department 1

Logic of Statements Logical Form and Logical Equivalence Conditional Statements Valid and Invalid Arguments Logic of Quantified Statements Application: Digital Logic Circuits 2

Logical Form Concept of logic – argument form Argument is a sequence of statements aimed to demonstrate the truth of an assertion The preceding statements are called premises Assertion at the end of the sequence is called the conclusion Arguments are valid in the sense that if their premises are true, then their conclusions must also be true 3

Logical Form To illustrate the logical form of arguments, we use letters of the alphabet (p, q, and r) to represent the statements Argument 1: “If Jane is a computer science major, then Jane will take SSK3003” p = Jane is a computer science major q = Jane will take SSK3003 The common logical form: If p, then q. 4

Logical Form Argument 2: “If x 2, then x 2 > 4.” p = x 2, r = x 2 > 4 The common logical form: If p or q, then r. Argument 3: “If the program syntax is faulty or if program execution results in division by 0, then the computer will generate an error message. Therefore, if the computer does not generate an error message, then the program syntax is correct and program execution does not result in division by 0.” 5

Logical Form p = The program syntax faulty, q = The computer will generate an error message r = The program execution results in division by 0 The common logical form: If p and q, then r. Therefore, if not r, then not p and not q. 6

Logical Form Initial terms in logic: sentence, true, false Statement (proposition) is a sentence that is true or false BUT not both Compound statement is a statement built out of simple statements using logical operations: negation, conjunction, disjunction 7

Logical Form Given two statements, p and q. Negation of p (NOT p) = symbolized by  /  Conjunction of p and q (p AND q) = symbolized by  Disjunction of p and q (p OR q) = symbolized by  8

Logical Form Translation of English to symbolic logic statements: 1.The sky is blue. One simple (primitive) statement – assign to a letter i.e. p 2.The sky is blue and the grass is green. One compound statement Conjunction of two primitive statements Each single statement gets a letter i.e. p q And join with  i.e. p  q 3.The sky is blue or the sky is purple. One compound statement Disjunction of two primitive statements Each single statement gets a letter i.e. r s And join with  i.e. r  s 9

Logical Form Each statement must have well-define truth values – they must either be true or false. We summarized all the possible truth values of a statement in truth tables. Truth tables for operators can be –Alone –Combined –Using 0’s or 1’s pq p  qp  q  p FFFFT FTFTT TFFTF TTTTF 10

Logical Form Given two statements, p and q. Exclusive Or of p and q (p XOR q) = symbolized by  = when or is used in its exclusive sense, when the statement “p or q” means “p or q but not both.” pq p  q FFF FTT TFT TTF 11

Logical Form Construct a truth table for the statement form (p  q)   r pqr p  q  r(p  q)   r FFFFTT FFTFFF FTFFTT FTTFFF TFFFTT TFTFFF TTFTTT TTTTFT n = number of statements How to calculate number of rows? Answer = 2 n 12

Logical Equivalence Truth table for (~p  q)  (q  ~r) Two statements (P and Q) are called logically equivalent if and only if (iff) they have identical truth tables (P  Q) How to check two statements are logically equivalent? Double negation, ~(~p)  p De Morgan’s Laws: –The negation of and AND statement is logically equivalent to the OR statement in which component is negated, ~(p  q)  ~p  ~q –The negation of an OR statement is logically equivalent to the AND statement in which each component is negated, ~(p  q)  ~p  ~q 13

Logical Equivalence Applying De-Morgan’s Laws: –Write negation for The bus was late or Tom’s watch was slow -1 < x <= 4 Tautology is a statement that is always true regardless of the truth values of the individual logical variables Contradiction is a statement that is always false regardless of the truth values of the individual logical variables 14

Logical Equivalence Show that the statement form p   p is a tautology and p   p is a contradiction A number of logical equivalences are summarized in Theorem for future reference (pg. 14) The theorem can be used in a formal way to simplify complicated statements p  pp   pp   p FTTF TFTF 15

THEOREM Logical Equivalences Commutative laws: p  q  q  p, p  q  q  p Associative laws: (p  q)  r  p  (q  r), (p  q)  r  p  (q  r) Distributive laws: p  (q  r)  (p  q)  (p  r) p  (q  r)  (p  q)  (p  r) Identity laws: p  t  p, p  c  p Negation laws: p  ~p  t, p  ~p  c Double negative law: ~(~p)  p Idempotent laws: p  p  p, p  p  p De Morgan’s laws: ~(p  q)  ~p  ~q, ~(p  q)  ~p  ~q Universal bound laws: p  t  t, p  c  c Absorption laws: p  (p  q)  p, p  (p  q)  p Negation of t and c: ~t  c, ~c  t 16

Logical Equivalence Use Theorem to verify the logical equivalence of  (  p  q)  (p  q)  p  (  p  q)  (p  q)  (  (  p)   q)  (p  q)DM laws  (p   q)  (p  q)Double negative law  p  (  q  q)Distributive law  p  (q   q)Commutative law for   p  cNegation law  pIdentity law 17

Exercises Write truth table for: (p  (~p  q))  ~(q  ~r) Simplify: ~(~p  q)  (p  q) Simplify: ~(p  ~q)  (~p  ~ q)  ~p 18

Answers (p  (~p  q))  ~(q  ~r) pqr  p  p  qp  (  p  q)  r  (q   r) (p  (~p  q))  ~(q  ~r) FFFTTTTTT FFTTTTFTT FTFTTTTFF FTTTTTFTT TFFFFTTTT TFTFFTFTT TTFFTTTFF TTTFTTFTT 19

Answers ~(p  ~q)  (~p  ~ q)  ~p  (p   q)  (  p   q)  (  p   (  q))  (  p   q)DM law  (  p  q)  (  p   q)Double negative law   p  (q   q)Distributive law   p  tNegation law   pIdentity law 20

Conditional Statements “If something, then something”: p  q, p is called the hypothesis and q is called the conclusion The formal definition of truth values for p  q is based on its everyday, intuitive meaning Eg: You go for an interview, and the boss promise you, “If you show up for work Monday morning, then you will get the job” Under what circumstances, the above sentence is false? 21

Conditional Statements Ans: You do show up for work Monday morning and you do not get the job What happen when you do not show up for work Monday morning? The boss’ promise ONLY say you will get the job if a certain condition (showing up for work) is met It says nothing about what will happen if the condition is not met So if the condition is not met, you can not simply say the promise is false regardless of whether or not you get the job 22

Conditional Statements The only combination of circumstances in which a conditional sentence is false is when the hypothesis is true and the conclusion is false A conditional statements is called vacuously true or true by default when its hypothesis is false 23 pq p  q FFT FTT TFF TTT

Conditional Statements Among , , ~ and  operations,  has the lowest priority Show that (p  q)  r  (p  r)  (q  r) by using truth table Representation of  : p  q  ~p  q Re-write using if-then: Either you get in class on time, or you risk missing some material 24

Conditional Statements Ans: ~p  q, Let ~p be you get in class on time and q be you risk missing some material So, the equivalent if-then version, p  q is If you do not get in class on time, then you risk missing some material Negation of  : ~(p  q)  p  ~q 25

Conditional Statements Contrapositive of the statement p  q is another conditional statement, ~q  ~p A conditional statement is equivalent to its contrapositive Write in contrapositive form: If today is Easter, then tomorrow is Monday. Ans: If tomorrow is not Monday, then today is not Easter. 26 Easter is a Christian celebration celebrated on Sunday

Conditional Statements The converse of p  q is q  p The inverse of p  q is ~p  ~q Conditional statement and its converse are NOT equivalent Conditional statement and its inverse are NOT equivalent The converse and inverse of a statement are logically equivalent to each other Write the converse and inverse: If today is Easter, then tomorrow is Monday –Converse: If tomorrow is Monday, then today is Easter –Inverse: If today is not Easter, then tomorrow is not Monday 27

Exercises Write contrapositive, converse and inverse statements for: –If P is a square, then P is a rectangle –If n is prime, then n is odd or n is 2 –If x is nonnegative, then x is positive or x is 0 –If n is divisible by 6, then n is divisible by 2 and n is divisible by 3 28

Answers If P is a square, then P is a rectangle Contrapositive: If P is not a rectangle, then P is not a square Converse: If P is a rectangle, then P is a square Inverse: If P is not a square, then P is not a rectangle 29

Conditional Statements Biconditional of p and q means “p if and only if q” (iff) and is denoted as p  q True when both statement have the same truth values 30 pq p  q FFT FTF TFF TTT

Conditional Statements “p only if q” means p occurs only if q also occurs Means ~q  ~p, or p  q Re-write using if-then: You will get an A only if you get 80 marks. Ans 1: If you do not get 80 marks, then you will not get an A. Ans 2: If you get an A, then you will have to get 80 marks. 31

Conditional Statements p  q  (p  q)  (q  p) r is a sufficient condition for s means “if r then s” r is a necessary condition for s means “if not r then not s” and “if s then r” r is a necessary and sufficient condition for s means “r if and only if s” 32

Order of Operations for Logical Operators 1.  Evaluate negation first 2. ,  Evaluate  and  second. When both are present, parentheses may be needed 3. ,  Evaluate  and  third. When both are present, parentheses may be needed 33

Arguments An argument is a sequence of statements. All statements except the final one are called premises (or assumptions or hypotheses). The final statement is called the conclusion If Ali is a man, then Ali is mortal. Ali is a man.  Ali is mortal. An argument is considered valid if from the truth of all premises, the conclusion must also be true. The conclusion is said to be inferred or deduced from the truth of the premises

Arguments Test to determine the validity of the argument: –Identify the premises and conclusion of the argument –Construct the truth table for all premises and the conclusion –Find critical rows in which all the premises are true –If the conclusion is true in all critical rows then the argument is valid, otherwise it is invalid

Invalid Argument Example of invalid argument form: –Premises: p  q  ~r and q  p  r, conclusion: p  r 36 p  q   rq  p  rp  r TTT TFF FTT TTF TFT TFT TTT TTT This row shows it is possible for this argument to have true premises and false conclusion. Hence this form of argument is invalid

Valid Argument Example of valid argument form: –Premises: p  (q  r) and ~r, conclusion: p  q 37 p  (q  r) rrp  r TFT TTT TFT TTT TFT TTT TFF FTF

Rules of Inference An argument consisting of two premises and a conclusion is called a syllogism A rule of inference is a form of argument that is valid Modus ponens (method of affirming): Has the form p  q pq TTT FTF TFT TFF If p then q. p.  q

Rules of Inference Modus tollens (method of denying): Has the form Use ponens or tollens to make arguments valid: –If 5 is divisible by 6, the it is divisible by 3. 5 is not divisible by 3.  _________________________________ –If this is a while loop, then the body of the loop may never be executed. ______________________  The body of the loop may never be executed If p then q.  q.   p

RulesRelated logical implicationName of rule p  q p  q [(p  q)  p]  q Modus Ponens (Rule of Detachment) p  q  q   p [(p  q)   q]   p Modus Tollens p  p  q q  p  q p  p  q q  p  q Generalization (Disjunctive Amplification) p  q  p p  q  q p  q  p p  q  q Specialization (Conjunctive Simplification) p q  p  q Conjunction p  q  q  p p  q  p  q [(p  q)   q]  p [(p  q)   p]  q Elimination (Disjunctive Syllogism) p  q q  r  p  r [(p  q)  (q  r)]  (p  r) Transitivity (Law of the Syllogism) p  q p  r q  r  r [(p  q)  (p  r)  (q  r)]  r Proof by Division into Cases  p  c  p (  p  c)  p Contradiction Rule

Complex Deduction (1) Premises: a)Rita is baking a cake. b)If Rita is baking a cake, then she is not practicing her flute. c)If Rita is not practicing her flute, then her father will not buy her a car. d)Therefore Rita’s father will not buy her a car. Consider and validate 41

Answer Letp = Rita is baking a cake q = She is practicing her flute r = Her father will not buy her a car Translate question into premises: (a) p(b) p   q(c)  q   r The following deductions can be made: 1.p by (a) p   q by (d)   q by modus ponens  q by the conclusion of  q   r by (c)   r by modus ponens

Complex Deduction (2) Premises: a)If my glasses are on the kitchen table, then I saw them at breakfast b)I was reading the newspaper in the living room or I was reading the newspaper in the kitchen c)If I was reading the newspaper in the living room, then my glasses are on the coffee table d)I did not see my glasses at breakfast e)If I was reading my book in bed, then my glasses are on the bed table f)If I was reading the newspaper in the kitchen, then my glasses are on the kitchen table Where are the glasses?

Answer Letp = My glasses are on the kitchen table q = I saw them at breakfast r = I was reading the newspaper in the living room s = I was reading the newspaper in the kitchen t = My glasses are on the coffee table u = I was reading my book in bed v = My glasses are on the bed table Translate question into premises: (a) p  q(b) r  s(c) r  t (d)  q(e) u  v(f) s  p 44

Answer 1.p  q by (a)  q by (d)   p by modus tollens 2.s  p by (f)  p by the conclusion of 1   s by modus tollens 3.r  s by (b)  s by the conclusion of 2  r by elimination 45 4.r  t by (c) r by the conclusion of 3  t by modus ponens Hence t is true and the glasses are on the coffee table. The following deductions can be made:

Fallacies A fallacy is an error in reasoning that results in an invalid argument Three common fallacies: –Vague or ambiguous premises –Begging the question (assuming what is to be proved) –Jumping to conclusions without adequate grounds Converse Error: –Premises: p  q and q, conclusion: p Inverse Error: –Premises: p  q and ~p, conclusion: ~q