CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.

Slides:



Advertisements
Similar presentations
TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Advertisements

Logic & Critical Reasoning
Prof. Shachar Lovett Clicker frequency: CA CSE 20 Discrete math Prof. Shachar Lovett
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE115/ENGR160 Discrete Mathematics 01/26/12 Ming-Hsuan Yang UC Merced 1.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
CS128 – Discrete Mathematics for Computer Science
CS61C L16 Representations of Combinatorial Logic Circuits (1) Beamer, Summer 2007 © UCB Scott Beamer Instructor inst.eecs.berkeley.edu/~cs61c CS61C :
CS61C L22 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2008 © UCB 100 MPG Car contest!  The X Prize Foundation has put up two prizes;
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Logic: Connectives AND OR NOT P Q (P ^ Q) T F P Q (P v Q) T F P ~P T F
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
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Discrete Mathematics Math 6A Instructor: M. Welling.
CS 61C L22 Representations of Combinatorial Logic Circuits (1) Garcia, Spring 2004 © UCB Lecturer PSOE Dan Garcia inst.eecs.berkeley.edu/~cs61c.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Logic 7/16/ Propositional Logic A proposition is a statement that is either true or false. We give propositions names such as p, q,
Propositional Calculus Math Foundations of Computer Science.
CS61C L25 Representations of Combinational Logic Circuits (1) Garcia, Spring 2013 © UCB Android Brain on Robots!  “Half the weight of some robots is.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
The Foundations: Logic and Proofs
Intro to Discrete Structures
Discrete Maths 2. Propositional Logic Objective
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
MATH 224 – Discrete Mathematics
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
Math 240: Transition to Advanced Math Deductive reasoning: logic is used to draw conclusions based on statements accepted as true. Thus conclusions are.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
COS 150 Discrete Structures Assoc. Prof. Svetla Boytcheva Fall semester 2014.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
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.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Conditional Statements
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.
How do I show that two compound propositions are logically equivalent?
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Conditional Statements Lecture 2 Section 1.2 Fri, Jan 20, 2006.
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.
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.
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.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Discrete Structures for Computer Science Presented By: Andrew F. Conn Slides adapted from: Adam J. Lee Lecture #1: Introduction, Propositional Logic August.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Senior Lecturer SOE Dan Garcia
Lecture 1 – Formal Logic.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
MATH 15A – Discrete Mathematics
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
TA David “The Punner” Eitan Poll
Lecturer SOE Dan Garcia
Presentation transcript:

CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett

Today’s Topics: 1. Step-by-step equivalence proofs 2. Equivalence of logical operators 2

1. Step-by-Step Equivalence Proofs 3

Two ways to show two propositions are equivalent 1. Using a truth table  Make a truth table with a column for each variable, formula  Equivalent iff the T/F values in each row are identical between the two columns 2. Using known logical equivalences  Step-by-step, proof-style approach  Equivalent iff it is possible to evolve one to the other using only the known logical equivalence properties 4

Equivalence Rules

Inference Rules: 6

Logical Equivalences 1. (p ∧ q ∧ r) ∨ (p ∧ ¬q ∧ ¬r) ∨ (¬p ∧ q ∧ r) ∨ (¬p ∧ ¬q ∧ ¬r) ≡(p ∧ (q ∧ r)) ∨ (p ∧ (¬q ∧ ¬r)) ∨ (¬p ∧ (q ∧ r)) ∨ (¬p ∧ (¬q ∧ ¬r)) 2. ≡ (p ∧ ((q ∧ r) ∨ (¬q ∧ ¬r))) ∨ (¬p ∧ ((q ∧ r) ∨ (¬q ∧ ¬r))) a) Substitute s = (q ∧ r) ∨ (¬q ∧ ¬r) gives (p ∧ s) ∨ (¬p ∧ s) b) ≡ (s ∧ p) ∨ (s ∧ ¬p) c) ≡ s ∧ (p ∨ ¬p) d) ≡ s ∧ t e) ≡ s, substitute back for s gives: 3. ≡ (q ∧ r) ∨ (¬q ∧ ¬r) Which law is NOT used? A.Commutative B.Associative C.Distributive D.Identity E.DeMorgan’s 7

Legal steps in proof sequences  Consider the following simplification step (modus ponens) p  (p  q)  q Why is it correct to use it? A. Because p is necessary for q B. Because p is sufficient for q C. Because (p  (p  q))  q is a contradiction D. Because (p  (p  q))  q is a tautology E. None/other

Legal steps in proof sequences  A simplification step (formula 1)  (formula 2) is a correct step, if the formula (formula 1)  (formula 2) is a tautology  Equivalently, if we assume formula 1 is correct, then we can deduce that formula 2 is correct

Applications of proof sequences  Formal verification: a proof that a certain program, or a certain circuit, works correctly  Express the statement “the circuit works correctly” as a formal propositional formula, and then prove it  Typical formulas have millions of inputs, so cannot hope to prove by truth tables. The only way is to find clever ways of building proof sequences

2. Equivalence of Logical Operators Do we really need IMPLIES and XOR? 11

Are all the logical connectives really necessary?  You already know that IMPLIES is not necessary  p → q ≡ ¬p ∨ q  What about IFF? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. IFF is necessary 12

Are all the logical connectives really necessary?  You already know that IMPLIES is not necessary  p → q ≡ ¬p ∨ q  What about XOR? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. XOR is necessary 13

Are all the logical connectives really necessary?  You already know that IMPLIES is not necessary  p → q ≡ ¬p ∨ q  What about AND? A. Replace with ¬(¬p ∨ ¬q) B. Replace with (¬p ∧ ¬q) ∨ (p ∧ q) C. Replace with ¬(p ∧ q) ∧ (p ∨ q) D. Replace with something else E. AND is necessary 14

Are all the logical connectives really necessary?  Not necessary:  IF  IFF  XOR  AND  We can replicate all these using just two:  OR  NOT  Can we get it down to just one?? A.YES, just OR B.YES, just NOT C.NO, there must be at least 2 connectives D.Other 15

It turns out, yes, you can manage with just one!  But it is one we haven’t learned yet:  NAND (NOT AND)  Another option is NOR (NOT OR)  Their truth tables look like this:  Ex: p OR q ≡ (p NAND p) NAND (q NAND q) 16 pqP NAND q TTF TFT FTT FFT pqP NOR q TTF TFF FTF FFT

Using NAND to simulate the other connectives 17 pqP NAND q TTF TFT FTT FFT “NOT p” is equivalent to A. p NAND p B. (p NAND p) NAND p C. p NAND (p NAND p) D. NAND p E. None/more/other

Using NAND to simulate the other connectives 18 pqP NAND q TTF TFT FTT FFT “p AND q” is equivalent to A. p NAND q B. (p NAND p) NAND (q NAND q) C. (p NAND q) NAND (p NAND q) D. None/more/other

Using NAND to simulate the other connectives 19 pqP NAND q TTF TFT FTT FFT “p OR q” is equivalent to A. p NAND q B. (p NAND p) NAND (q NAND q) C. (p NAND q) NAND (p NAND q) D. None/more/other

Can we just use AND, OR?  We saw we can use OR,NOT as primitive connectives – they generate all the rest  Similarly, we can just use NAND  Can we just use AND, OR? A. Yes B. No

Monotone predicates  A predicate is monotone if replacing an input variable from F to T can never change the value of the predicate from T to F  Example: AND; OR; At least one out of three  But not: NOT; NAND

Monotone predicates  Theorem: a predicate is monotone if and only if it can be described using just AND,OR connectives  We will see the proof in later sessions, after we learn a bit about how to prove theorems  Can you prove it yourself now?