Reading: Chapter 4 (44-59) from the text book

Slides:



Advertisements
Similar presentations
Copyright 2008, Scott Gray1 Propositional Logic 3) Truth Tables.
Advertisements

Propositional Equivalences
Grading Lecture attendance: -1% per 2 unexcused absences
Propositional Equivalences. L32 Agenda Tautologies Logical Equivalences.
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
08 March 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department Introduction.
CS128 – Discrete Mathematics for Computer Science
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
From Chapter 4 Formal Specification using Z David Lightfoot
Introduction to Logic Logical Form: general rules
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
Copyright © Cengage Learning. All rights reserved.
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Propositions and Truth Tables
Propositions and Truth Tables. Proposition: Makes a claim that may be either true or false; it must have the structure of a complete sentence.
Chapter 3 Section 4 – Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Chapter 2 – Fundamentals of Logic. Outline Basic Connectives and Truth Tables Logical Equivalence: The Laws of Logic Ligical Implication: Rules of Inference.
Week 1 - Wednesday.  Course overview  Propositional logic  Truth tables  AND, OR, NOT  Logical equivalence.
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.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Chapter 3 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
Discrete Mathematics. Propositional Logic 10/8/2015 What’s a proposition? PropositionsNot Propositions = 32Bring me coffee! CS173 is Bryan’s favorite.
Review I Rosen , 3.1 Know your definitions!
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.
Tautologies, contradictions, contingencies
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.
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
Section 1.2: Propositional Equivalences In the process of reasoning, we often replace a known statement with an equivalent statement that more closely.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proof, Sets, and Foundations PROPOSITIONS A proposition is a declarative sentence that is either True or False, but not the.
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?
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
Symbolic Logic The Following slide were written using materials from the Book: The Following slide were written using materials from the Book: Discrete.
LECTURE 1. Disrete mathematics and its application by rosen 7 th edition THE FOUNDATIONS: LOGIC AND PROOFS 1.1 PROPOSITIONAL LOGIC.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Discrete Mathematics Lecture # 4. Conditional Statements or Implication  If p and q are statement variables, the conditional of q by p is “If p then.
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.
CS104 The Foundations: Logic and Proof 1. 2 What is Discrete Structure?  Discrete Objects  Separated from each other (Opposite of continuous)  e.g.,
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.
Law of logic Lecture 4.
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Logic.
2. The Logic of Compound Statements Summary
DISCRETE MATHEMATICS CHAPTER I.
(CSC 102) Discrete Structures Lecture 2.
Mathematics for Computing
Discrete Structures for Computer Science
Principles of Computing – UFCFA3-30-1
Chapter 8 Logic Topics
Propositional Equivalences
Information Technology Department
CS201: Data Structures and Discrete Mathematics I
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
Foundations of Discrete Mathematics
COMP 1380 Discrete Structures I Thompson Rivers University
CS201: Data Structures and Discrete Mathematics I
Concepts of Computation
Presentation transcript:

Reading: Chapter 4 (44-59) from the text book Logic Reading: Chapter 4 (44-59) from the text book

Propositions In arithmetic we work with numbers Similarly, the fundamental objects in logic are propositions Definition: A proposition is a statement that is either true or false. Whichever of these is the case, it is called truth value of the proposition.

Examples “1 Omani Rial = 300 Bisas” “The pass mark of IDM course is 50” “7 is greater than 5” “There are 8 days in a week” (2) & (3) are true – (1) & (4) are false “Stop talking” “What day of the week is it today” (1) is a command & (2) is a question so neither is proposition.

Predicates ‘x > 5’ is an example of a predicate. A predicate is a statement which contain one or more variables; it cannot be assigned a truth value until the value of the variables are specified. e.g. if x=7, the sentence is true, but if x=2, it is false.

Logical Structure of Propositions In logic, we will study propositions such as: ‘If the door and the window are not both closed, then the door is not closed or the window is not closed’ This proposition is true because of its logical structure. As well, any sentence with the same logical structure must also be true.

Connectives The statement: is a compound proposition. ‘If the door and the window are not both closed, then the door is not closed or the window is not closed’ is a compound proposition. It is built up from atomic proposition: ‘the door is closed’ & ‘the window is closed’ using the words and, or, not & if-then These words are called connectives.

Notation for Basic Connectives To identify the connectives and, or, not, etc.., we will underline them (and, or, not, etc…) Note that if-then is also known as implies and if-and-only-if is also known as is-equivalent-to The 5 connectives we will use, and their symbols are given in the following table:

if-and-only-if (or is-equivalent-to) Table of Connectives Connective Symbol and or not If-then (or implies) if-and-only-if (or is-equivalent-to)     

'It is snowing' 'I will go skiing'. Example of Notation Let p be the proposition ‘Cows are animals’ And let q denote: ‘Cows produce milk’. Then: p  q denotes the proposition ‘Cows are animals and cows produce milk’  p means ‘Cows are not animals’ Exercise : Let p and q denote respectively the propositions 'It is snowing' 'I will go skiing'. Write down English sentence corresponding to the proposition Express the proposition: ‘If I will not go skiing then it is snowing’ in symbolic form.

The Connective ‘and’ The everyday understanding of the term ‘and’ is that for p  q to be true, p & q must both be true. If p is false, or q is false, or both are false, then p  q is false This everyday understanding leads to the following truth table

Truth Table for ‘and’ p q p  q T F

The Connective ‘or’ In everyday language, ‘or’ has two meanings In ‘Ali will pass or fail’, it means the result will be either a pass or a fail, but not both. Here, ‘or’ is used exclusively –the possibility of both outcomes is excluded In logic, or means the inclusive ‘or’ –i.e. p  q means ‘p or q or both’

Truth Table for ‘or’ p q p  q T F

The Connectives ‘not’ & ‘if-then’ The truth table for not is straightforward. i.e. if p is T then p is F & if p is F then p is T Now look at the connective if-then Suppose p is the propn ‘Fatima attends tutorials’, & q is the propn ‘Fatima will pass Discrete Maths’ Then p  q is the propn ‘If Fatima attends tutorials, then she will pass Discrete Maths’

The Connective ‘if-then’ The claim is certainly true if Fatima attends tutorials & passes, so p  q is T if p is T & q is T However, if Fatima attends tutorials and doesn’t pass, the claim is false, so p  q is F if p is T & q is F What if p is false –i.e. Fatima doesn’t attend tutorials? The claim is true, because it says only what would happen if Fatima attended tutorials. Thus p  q is true whenever p is false.

Truth Table for ‘if-then’ p q p  q T F

The Connective ‘if-then’ The truth table can be interpreted as: ‘The only time the implication is false is if the premise is true & the conclusion is false’ Are the following propositions true or false?: ‘If the sky is yellow then cows have 6 legs’ ‘If the sky is blue then cows have 6 legs’

The Connective ‘if-and-only-if’ The connective  is defined to be true precisely when the 2 propositions it connects have the same truth value. i.e. p  q is true whenever p & q are both true or p & q are both false. Thus the proposition ‘Al-Aqsa is in India if and only if apples are blue’ is true.

Truth Table for ‘if-and-only-if’ p q p  q T F

Compound Propositions A compound proposition is a proposition built up from atomic (i.e. basic) propositions Example: Write in symbols: ‘Either Thomas Edison or Alexander Bell invented the telephone’ Solution: Firstly define the atomic propositions: p is ‘Thomas Edison invented the telephone’ q is ‘Alexander Bell invented the telephone’ Then the proposition is (p  q)  (p  q)

Logical Expressions With (p  q)  (p  q) we could find its truth value if we knew the truth values of: p = ‘Thomas Edison invented the telephone’ q = ‘Alexander Bell invented the telephone’ In logic, we will study expressions such as (p  q)  (p  q), where p & q are regarded as variables, rather than specific propositions

Logical Expressions and Truth Tables If this is done, (p  q)  (p  q) is a logical expression –it becomes a proposition only when p & q are replaced by propositions. This is exactly the same as algebra, x2 – 4 becomes a number only when x is replaced by a number The logical expression (p ∨ q) ∧ ¬(p ∧ q) can be analyzed using a truth table

Truth Table – Basic Connectives p q p  q p  q p p  q p  q T F

Truth Table for (p  q)  (p  q)

Truth Tables If a logical expression has 2 variables, its truth table will have 4 rows (as in the example) If an expression has 3 variables (p, q, r), its truth table will have 8 rows – i.e. 1 row for each of the 8 ways of allocating truth values to p, q & r

Tautologies Recall the proposition: ‘If the door and the window are not both closed, then the door is not closed or the window is not closed’ If p denotes ‘the door is closed’ & q is ‘the window is closed’, this proposition is ¬(p ∧ q) → (¬p ∨ ¬q) The truth table for this logical expression shows that it is always true, irrespective of the truth values of p and q Such an expression is called a tautology

Contradictions Consider the proposition p ∧ ¬(p ∨ q) The truth table for this logical expression shows that it is always false, irrespective of the truth values of p and q. Such an expression is called a contradiction. Exercise: Is the proposition p ∧ (¬p ∨ ¬q) a contradiction?

Logical Equivalence The table shows that for every combination of the truth values of p & q, the truth values of: p ∧ q and q ∧ (p ∨ ¬q) are the same. The expressions: p ∧ q and q ∧ (p ∨ ¬q) are said to be logically equivalent.

Definition of Logical Equivalence Definition: 2 expressions are logically equivalent if they have the same truth values for every combination of the truth values of the variables. Exercise: Use a truth table to show that ¬(p ∨ q) and ¬p ∧ ¬q are logically equivalent (so it doesn’t matter which expression is used for the proposition)

Logical Equivalence & Tautology If the two expressions A and B are logically equivalent, they always have the same truth values, this means that A ↔ B is always true. Therefore A ↔ B is a tautology So another way of saying that A and B are logically equivalent is to say that A ↔ B is a tautology

Implications Recall that if-then is also known as implies i.e. p → q can be read as ‘if p then q’ or ‘p implies q’ Expressions of the type p → q are called implications The converse of p → q is q → p The contrapositive of p → q is ¬q → ¬p

The Converse and Contrapositive Example: Consider the implication ‘If I am in Salalah, then I am in Oman’ Its converse is: ‘If I am in Oman, then I am in Salalah’ Its contrapositive is: ‘If I am not in Oman, then I am not in Salalah’ In this example, the original proposition is a true sentence, its converse is false, and its contrapositive is true

Truth Table for Converse & Contrapositive Now use a truth table to investigate the expressions p → q, q → p and ¬q → ¬p p q p  q q  p q p ¬q  p T F

Converse and Contrapositive The truth table shows (by columns 3 & 7): an implication and its contrapositive are logically equivalent. However (by columns 3 & 4): an implication and its converse are not logically equivalent. Thus the results of the Salalah/Oman example aren’t surprising.

Arguments in Logic The argument consists of some premises & a conclusion which is supposed to be a consequence of the premises An argument has the logical expression (P1∧ P2) → Q In (P1∧ P2) → Q, P1 and P2are the premises and Q is the conclusion

Validity of an Argument If the argument is valid, the conclusion should be true whenever all the premises are true This means that if P1∧ P2 is true, then Q must also be true Thus the argument is valid provided that (P1∧ P2) → Q is a tautology

Testing the Validity of an Argument Let’s test the validity of the argument: [(p → q) ∧ ¬p] → ¬q Is [(p → q) ∧ ¬p] → ¬q a tautology? To answer this, we’ll use a truth table, though the laws of logic could also be used

Truth Table for the Argument p q P1 p  q P2 p P1  P2 (pq)p Q q (P1  P2)  Q [(pq) p] q T F

Conclusion from the Truth Table By the truth table, (P1∧ P2) → Q is not always true (i.e. it’s not a tautology), so the original argument is not valid In fact, row 3 of the truth table tells us why the argument is not valid: The premises of the argument are satisfied, but the conclusion is not satisfied

Laws of Logic In a previous slide we showed: q ∧ (p ∨ ¬q) and p ∧ q are logically equivalent Thus the more complicated expression can be replaced by the simpler expression without affecting the truth value

Laws of Logic Aim to simplify logical expressions effectively Example: q ∧ (p ∨ ¬q) ≡ p ∧ q The symbol ≡ means ‘is logically equivalent to’ To do this, we establish a list of key pairs of expressions that are logically equivalent. The most important laws of logic follow

Laws of Logic Law(s) of Logic Name p ↔ q ≡ (p → q) ∧ (q → p) ¬¬p ≡ p equivalence implication double negation p  p ≡ p p  q ≡ q  p (p  q)  r ≡ p  (q  r) p  (q  r) ≡ (p  q)  (p  r) ¬(p  q) ≡ ¬p  ¬q p  T ≡ p p  F ≡ F p  ¬p ≡ F p  (p  q) ≡ p p  p ≡ p p  q ≡ q  p (p  q)  r ≡ p  (q  r) p  (q  r) ≡ (p  q) ∧ (p  r) ¬(p  q) ≡ ¬p  ¬q p  F ≡ p p  T ≡ T p  ¬p ≡ T p  (p  q) ≡ p idempotent commutative associative distributive de Morgan’s identity annihilation inverse absorption

The Laws of Logic The first two laws allow for the connectives ↔ and → to be removed from any expression All remaining laws involve just and, or & not Apart from the double negation law, all these remaining laws occur in pairs

Using the Laws of Logic We could use the laws of logic to simplify logical expressions Example: Use the laws of logic to simplify the expression: (p ∧ ¬q) ∨ q Solution: (p ∧ ¬q) ∨ q ≡ q ∨ (p ∧ ¬q) (2nd commutative law) ≡ (q ∨ p) ∧ (q ∨ ¬q) (2nd distributive law) ≡ (q ∨ p) ∧ T (2nd inverse law) ≡ q ∨ p (1st identity law) ≡ p ∨ q (2nd commutative law) Therefore (p ∧ ¬q)∨ q ≡ p∨ q

Why not Use Truth Tables? Note that we could not have used truth tables in the previous example. Truth tables can be used to verify logical equivalences, but the laws of logic are needed to determine the equivalences in the first place. Thus truth tables could be used to answer the question “Verify (p ∧ ¬q) ∨ q ≡ p ∨ q”

How to decide which law(s) to use There are no fixed rules to determine which law(s) to use when simplifying expressions However, begin by eliminating ↔ and → (if they appear) using the first 2 laws After this, try a law to see if it helps to simplify the expression – if it doesn’t, then try another law The process gets easier with practice!

Another Example Example: Simplify the expression ¬(p → ¬q) ∧ p Solution: ¬(p → ¬q) ∧ p ≡ ¬(¬p ∨ ¬q) ∧ p (implication law) ≡ (¬¬p ∧ ¬¬q) ∧ p (2nd de Morgan’s law) ≡ (p ∧ q) ∧ p (double negation law) ≡ p ∧ (p ∧ q) (1st commutative law) ≡ (p ∧ p) ∧ q (1st associative law) ≡ p ∧ q (1st idempotent law)

Yet More Examples Exercise: Simplify the logical expression ¬(p → ¬q) ∧ ¬p Example: Use truth tables to verify that p → q ≡ ¬p ∨ q Using truth tables may be a lengthy method, but it is a mechanical process that will always work. Using the laws of logic is usually shorter, but often it’s not easy to know which law to apply.