Discrete Maths 2. Propositional Logic Objective

Slides:



Advertisements
Similar presentations
Logic The study of correct reasoning.
Advertisements

Propositional Equivalences
The Foundations: Logic and Proofs
1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: The Moon is made of green cheese. Trenton.
Logic Chapter 2. Proposition "Proposition" can be defined as a declarative statement having a specific truth-value, true or false. Examples: 2 is a odd.
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
TRUTH TABLES. Introduction Statements have truth values They are either true or false but not both Statements may be simple or compound Compound statements.
Normal or Canonical Forms Rosen 1.2 (exercises). Logical Operators  - Disjunction  - Conjunction  - Negation  - Implication p  q   p  q  - Exclusive.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
The Foundations: Logic and Proofs
Propositions and Truth Tables
1.1 Sets and Logic Set – a collection of objects. Set brackets {} are used to enclose the elements of a set. Example: {1, 2, 5, 9} Elements – objects inside.
Chapter 1 Section 1.4 More on Conditionals. There are three statements that are related to a conditional statement. They are called the converse, inverse.
Section 1.5 Implications. Implication Statements If Cara has a piano lesson, then it is Friday. If it is raining, then I need to remember my umbrella.
The Foundations: Logic and Proofs
Section 1-4 Logic Katelyn Donovan MAT 202 Dr. Marinas January 19, 2006.
2009/9 1 Logic and Proofs §1.1 Introduction §1.2 Propositional Equivalences §1.3 Predicates and Quantifiers §1.4 Nested Quantifiers §1.5~7 Methods of Proofs.
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Ch.1 (Part 1): The Foundations: Logic and Proofs Introduction.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
Chapter 1: The Foundations: Logic and Proofs
CS 103 Discrete Structures Lecture 02
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
Review I Rosen , 3.1 Know your definitions!
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Introductory Lecture Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the prior written consent of McGraw-Hill.
Propositional Equivalences
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
(CSC 102) Lecture 3 Discrete Structures. Previous Lecture Summary Logical Equivalences. De Morgan’s laws. Tautologies and Contradictions. Laws of Logic.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
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.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Chapter 7 Logic, Sets, and Counting
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.
MAIN TOPIC : Statement, Open Sentences, and Truth Values Negation Compound Statement Equivalency, Tautology, Contradiction, and Contingency Converse, Inverse,
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
How do I show that two compound propositions are logically equivalent?
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Chapter 1: The Foundations: Logic and Proofs
Conditional Statements – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Conditional Statements Reading: Kolman, Section 2.2.
Section 1.1. Section Summary Propositions Connectives Negation Conjunction Disjunction Implication; contrapositive, inverse, converse Biconditional Truth.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
Joan Ridgway. If a proposition is not indeterminate then it is either true (T) or false (F). True and False are complementary events. For two propositions,
The Foundations: Logic and Proofs
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Section 1.1. Propositions A proposition is a declarative sentence that is either true or false. Examples of propositions: a) The Moon is made of green.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Conditional statement or implication IF p then q is denoted p ⇒ q p is the antecedent or hypothesis q is the consequent or conclusion ⇒ means IF…THEN.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Chapter 1, Part I: Propositional Logic With Question/Answer Animations.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
Chapter 1 Logic and proofs
Logical Operators (Connectives) We will examine the following logical operators: Negation (NOT,  ) Negation (NOT,  ) Conjunction (AND,  ) Conjunction.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
CSNB 143 Discrete Mathematical Structures
Ch.1 (Part 1): The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Information Technology Department
Discrete Mathematics and Its Applications Kenneth H
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Presentation transcript:

Discrete Maths 2. Propositional Logic Objective 242-213, Semester 2, 2014-2015 2. Propositional Logic Objective to re-introduce propositional logic

1. Propositions A proposition is a sentence that is either true or false. Examples The Moon is made of green cheese. Bangkok is the capital of Thailand. 1 + 0 = 1 0 + 0 = 2 Examples that are not propositions: Sit down! What time is it? x + 1 = 2 x + y = z

Propositional variables: p, q, r, s, … A proposition that is always true = T A proposition that is always false = F Logical connectives (operators): Negation ¬ Conjunction ∧ Disjunction ∨ Implication → Biconditional ↔ Compound Propositions are built from logical operators and smaller propositions: p ∧ q (p ∨ q) → s

2. Negation (not, ¬) The negation of p is ¬p and has the truth table: Example: If p is “The earth is round”, then ¬p is “The earth is not round” p ¬p T F

Venn Diagram for ¬ Draw p as a set inside the universal domain U. So ¬p is true in the gray area: U P

3. Conjunction (and, ∧) The conjunction of p and q is p ∧ q Example: If p is “I am at home” and q is “It is raining” then p ∧q is “I am at home and it is raining” p q p ∧ q T F

Venn Diagram for ∧ Represent p and q as sets. p ∧ q is true in the gray area:

4. Disjunction (or, ∨) The disjunction of p and q is p ∨q Example: If p is “I am at home” and q is “It is raining” then p ∨q is “I am at home or it is raining” p q p ∨q T F

Venn Diagram for ∨ Represent p and q as sets. p ∨ q is true in the gray area: Note, that ∨ has a bigger true area than ∧

5. Implication (if-then, →) p →q is an implication which can be read as “if p then q ” Example: If p is “I am at home” and q is “It is raining” then p →q is “If I am at home then it is raining” p q p →q T F

Logical Jargon for p →q p can be called the hypothesis (or antecedent or premise) q can be called the conclusion (or consequent)

Many Ways of Saying p →q if p then q p implies q p only if q q unless ¬p q when p q if p q whenever p p is sufficient for q q follows from p q is necessary for p Very confusing, and if-then is extra confusing because it is NOT the same as a programming if-then or English if-then

→ Confusion when p = F The following implications are true (i.e p → q is T) but make no sense as English “If the moon is made of green cheese then I have more money than Bill Gates. ” “If 1 + 1 = 3 then my grandmother is old” p = F q = F p = F q = T

Two Ways to Avoid Confusion Do not think of p → q as if-then. Instead: 1. Translate → into simpler logical connectives (usually ¬ and ∨). or 2. Draw a venn diagram

p → q is the same as ¬p ∨ q There are many other ways of rewriting →, but memorize this one.

Venn Diagram of p → q as ¬p ∨ q The easiest way of drawing a Venn diagram for → is to use ¬p ∨ q. It is true in the gray area: 1 2 is like 3 4

Example p = "it is raining"; q = " I have an umbrella" Being able to draw a dot means p  q is true for this case. p = "it is raining"; q = " I have an umbrella" There are four cases to draw: It is raining and I have an umbrella It is raining and I do not have an umbrella It is not raining and I have an umbrella It not is raining and I do not have an umbrella No example, so p  q is false for this case

6. Converse, Inverse, Contrapositive More uses of , with special names: q →p is the converse of p →q ¬ p → ¬ q is the inverse of p →q ¬q → ¬ p is the contrapositive of p →q useful later

Examples “If it is sunny then I go shopping” (p  q) Converse: If I go shopping then it is sunny Contrapositive: If I do not go shopping, then it is not sunny Inverse: If it is not sunny, then I do not go shopping.

7. Biconditional (iff, ↔) The biconditional p ↔q is read as “p if and only if q ” or "p iff q" True when p and q have the same value. If p is “I am at home.” and q is “It is raining.” then p ↔q is “I am at home if and only if it is raining.” p q p ↔q T F

Also known as Equivalence () p  q is true when p and q have the same value. Also called logical equality.  is used when defining equivalences between propositional statements (see section 10 and later).

8. Tautologies, Contradictions A tautology is a proposition which is always true. Example: p ∨¬p A contradiction is a proposition which is always false. Example: p ∧¬p p ¬p p ∨¬p p ∧¬p T F

9. Bigger Truth Tables A truth table for p q r r p  q p  q → r T F

Truth Tables do not Scale Up How many rows are there in a truth table with n propositional variables? 2n (true and false cases for each variable) Truth tables cannot easily be written for more complex propositions.

10. Proving Equivalences We can prove equivalences using truth tables. Example: is ¬(p ∧ q)  ¬p ∨ ¬q ? lhs  rhs T T T T yes, the same

Example: is ¬(p ∧ q)  ¬p ∧ ¬q ? lhs  rhs T F F T no, not the same

De Morgan’s Laws Augustus De Morgan 1806-1871 This truth table shows that De Morgan’s Second Law holds. p q ¬p ¬q (p∨q) ¬(p∨q) ¬p∧¬q T F the same

Implication and contrapositive are equivalent. Also, converse and inverse are equivalent the same the same

Equivalence is Very Useful If we have: complicated proposition  simple proposition Then we can replace the complex one with the simple one. Equivalence is also useful for replacing logical operators. See the circuit examples in the next section.

Proving Equivalences with Truth Tables We can prove equivalences using truth tables but tables become very big for complex propositions. We need a different technique for proving the equivalence of larger propositions. rewrites; see section 13

11. Logic Circuits Electronic circuits; each input/output signal can be viewed as a 0 or 1. 0 represents False 1 represents True Complicated circuits are constructed from three basic circuits called gates. The inverter (NOT gate) takes an input bit and produces the negation of that bit. The OR gate takes two input bits and produces the value equivalent to the disjunction of the two bits. The AND gate takes two input bits and produces the value equivalent to the conjunction of the two bits. continued

More complicated digital circuits can be constructed by combining these basic circuits . For example:

Simplifying Circuits  Simplify circuits (i.e. use less gates), by using equivalences. p p  q and not q or not ¬(p ∧ q)  ¬p ∨ ¬q Two gates compared to three gates; different gates; less wiring

 p p q or and p ∨ (p ∧ q)  p Zero gates compared to two gates; less wiring

12 continued

More Logical Equivalences

13. Equivalence Proofs Using Rewrites To prove that , we produce a series of equivalences beginning with A and ending with B. Each line rewrites the left-hand side (lhs) to the right-hand side (rhs) by using the logic equivalences from section 12. A1  A2

 Example: Is Solution: ? Yes

Example: Is In English, is the proposition a tautology. Solution: ? Yes

14. More Information Discrete Mathematics and its Applications Kenneth H. Rosen McGraw Hill, 2007, 7th edition chapter 1, sections 1.1 – 1.3