Administrivia Course Web:

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

Propositional Equivalences
Foundations of Computing I CSE 311 Fall 2014 Foundations of Computing I Fall 2014.
CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
Microprocessors vs. Custom Digital Circuits
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
Discrete Mathematics Math 6A Instructor: M. Welling.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Propositional Calculus Math Foundations of Computer Science.
Week 1 - Wednesday.  Course overview  Propositional logic  Truth tables  AND, OR, NOT  Logical equivalence.
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.
CSE 311 Foundations of Computing I Spring 2013, Lecture 3 Propositional Logic, Boolean Logic/Boolean Algebra 1.
Boolean Algebra and Computer Logic Mathematical Structures for Computer Science Chapter 7.1 – 7.2 Copyright © 2006 W.H. Freeman & Co.MSCS Slides Boolean.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Logic Gates Shashidhara H S Dept. of ISE MSRIT. Basic Logic Design and Boolean Algebra GATES = basic digital building blocks which correspond to and perform.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
September1999 CMSC 203 / 0201 Fall 2002 Week #1 – 28/30 August 2002 Prof. Marie desJardins.
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 1: The Foundations: Logic and Proofs
Week 1 - Wednesday.  Course overview  Propositional logic  Truth tables  AND, OR, NOT  Logical equivalence.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
Module Code MA0003NI: Computing mathematics Lecture for Week Autumn.
Chapter 1 Propositional Logic
Morgan Kaufmann Publishers
2. The Logic of Compound Statements Summary
Logic Gates.
Propositional Logic.
The Foundations: Logic and Proofs
Advanced Algorithms Analysis and Design
Propositional Equivalence
Discrete Mathematics Lecture 1 Logic of Compound Statements
CSNB 143 Discrete Mathematical Structures
CSCE 235 Introduction to Discrete Structures
Citra Noviyasari, S.Si, MT
MATH 245 Spring 2009 This is mathematics for computer science
CSE 311 Foundations of Computing I
Logic Gates.
COT 3100, Spr Applications of Discrete Structures
(CSC 102) Discrete Structures Lecture 2.
CPCS222 Discrete Structures I
Mathematics for Computing
The Foundations: Logic and Proofs
Sets and Logic…. Chapter 2
CSCI 3310 Mathematical Foundation of Computer Science
CSE 311 Foundations of Computing I
Propositional Calculus: Boolean Algebra and Simplification
Propositional Equivalences
Information Technology Department
Propositional Equivalence (§1.2)
CS 220: Discrete Structures and their Applications
CS201: Data Structures and Discrete Mathematics I
CSE 311 Foundations of Computing I
Logic Gates.
Propositional Equivalences
CSE 311 Foundations of Computing I
CSE 311 Foundations of Computing I
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
Lecture 2: Propositional Equivalences
CSE 321 Discrete Structures
1.2 Propositional Equivalences
The Foundations: Logic and Proofs
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
Discrete Structures Prepositional Logic 2
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Concepts of Computation
Presentation transcript:

Administrivia Course Web: http://www.cs.washington.edu/311 Office Hours: 10 hours available; check web Homework #1: Posted. Turn in (stapled) at the start of class on Wednesday (Oct 1) Extra Credit: Not required to get a 4.0. Counts separately. In total, may raise grade by ~0.1

Last Time: Logical Connectives p q p  q T F p  p T F NOT AND p q p  q T F p q p  q T F OR XOR

Last Time: 𝑝→𝑞 “If p, then q” is a promise: p  q F T “If p, then q” is a promise: Whenever p is true, then q is true Ask “has the promise been broken”

If it’s raining, then I have my umbrella. Last Time: 𝑝→𝑞 p q p  q F T “If p, then q” is a promise: Whenever p is true, then q is true Ask “has the promise been broken” If it’s raining, then I have my umbrella.

Last Time: Related Implications Implication: p  q Converse: q  p Contrapositive:  q   p Inverse:  p   q How do these relate to each other?

p implies q and q implies p Last Time: 𝑝↔𝑞 p iff q p is equivalent to q p implies q and q implies p p q p  q T F

CSE 311: Foundations of Computing Fall 2014 Lecture 2: Digital Circuits & More Logic

Digital Circuits Computing With Logic Gates T corresponds to 1 or “high” voltage F corresponds to 0 or “low” voltage Gates Take inputs and produce outputs (functions) Several kinds of gates Correspond to propositional connectives (most of them)

And Gate AND Connective AND Gate vs. p q p  q p q p  q T F p q 1 OUT AND q p  q p q p  q T F p q OUT 1 q p OUT AND “block looks like D of AND”

Or Gate OR Connective OR Gate vs. p q p  q p q p  q T F p q 1 OUT OR q p  q p q p  q T F p q OUT 1 p q OR OUT “arrowhead block looks like V”

Not Gates NOT Gate NOT Connective vs. p  p  p Also called inverter p OUT  p NOT Also called inverter p  p T F p OUT 1 p OUT NOT

Blobs are Okay! You may write gates using blobs instead of shapes! p q AND OUT q p OR OUT q p OUT NOT

Combinational Logic Circuits NOT AND NOT AND OR Values get sent along wires connecting gates

Combinational Logic Circuits AND NOT OR AND Wires can send one value to multiple gates!

Logical Equivalence Terminology: A compound proposition is a… Tautology if it is always true Contradiction if it is always false Contingency if it can be either true or false p   p p  p (p  q)  p (p  q)  (p   q)  ( p  q)  ( p   q)

Logical Equivalence A and B are logically equivalent if and only if A  B is a tautology i.e. A and B have the same truth table The notation A  B denotes A and B are logically equivalent Example: p    p p  p   p p    p

A  B vs. A  B A  B says that two propositions A and B always mean the same thing A  B is a single proposition that may be true or false depending on the truth values of the variables in A and B but A  B and (A  B)  T have the same meaning Note: Why write A  B and not A=B ? We use A=B to say that A and B are precisely the same proposition (same sequence of symbols)

 (p  q)   p   q  (p  q)   p   q De Morgan’s laws  (p  q)   p   q  (p  q)   p   q My code compiles or there is a bug.

Example:  (p  q)  ( p   q) De Morgan’s laws Example:  (p  q)  ( p   q) p q  p  q  p   q p  q  (p  q)  (p  q)  ( p   q) T F

 (p  q)   p   q  (p  q)   p   q De Morgan’s laws  (p  q)   p   q  (p  q)   p   q if !(front != null && value > front.data) front = new ListNode(value, front); else { ListNode current = front; while !(current.next == null || current.next.data >= value) current = current.next; current.next = new ListNode(value, current.next); }

Law of Implication (p  q)  ( p  q) p q p  q  p  p  q

Computing Equivalence Describe an algorithm for computing if two logical expressions/circuits are equivalent. What is the run time of the algorithm?

Some Familiar Properties of Arithmetic 𝑥+𝑦=𝑦+𝑥 (Commutativity) 𝑥⋅ 𝑦+𝑧 =𝑥⋅𝑦+𝑥⋅𝑧 (Distributivity) 𝑥+𝑦 +𝑧=𝑥+(𝑦+𝑧) (Associativity) Logic has similar properties!

Some Familiar Properties of Arithmetic 𝑥+𝑦=𝑦+𝑥 (Commutativity) 𝑝∨𝑞≡𝑞∨𝑝 𝑝∧𝑞≡𝑞∧𝑝 𝑥⋅ 𝑦+𝑧 =𝑥⋅𝑦+𝑥⋅𝑧 (Distributivity) 𝑝∧ 𝑞∨𝑟 ≡ 𝑝∧𝑞 ∨(𝑝∧𝑟) 𝑝∨ 𝑞∧𝑟 ≡ 𝑝∨𝑞 ∧(𝑝∨𝑟) 𝑥+𝑦 +𝑧=𝑥+(𝑦+𝑧) (Associativity) 𝑝∨𝑞 ∨𝑟≡𝑝∨ 𝑞∨𝑟 𝑝∧𝑞 ∧𝑟≡𝑝∧(𝑞∧𝑟)

Properties of Logical Connectives We will always give you this list! Properties of Logical Connectives Identity Associative 𝑝∧T≡𝑝 𝑝∨𝑞 ∨𝑟≡𝑝∨ 𝑞∨𝑟 𝑝∨F≡𝑝 𝑝∧𝑞 ∧𝑟≡𝑝∧(𝑞∧𝑟) Domination Distributive 𝑝∨T≡T 𝑝∧ 𝑞∨𝑟 ≡ 𝑝∧𝑞 ∨(𝑝∧𝑟) 𝑝∧F≡F 𝑝∨ 𝑞∧𝑟 ≡ 𝑝∨𝑞 ∧(𝑝∨𝑟) Idempotent Absorption 𝑝∨𝑝≡𝑝 𝑝∨ 𝑝∧𝑞 ≡𝑝 𝑝∧𝑝≡𝑝 𝑝∧ 𝑝∨𝑞 ≡𝑝 Commutative Negation 𝑝∨𝑞≡𝑞∨𝑝 𝑝∨¬𝑝≡T 𝑝∧𝑞≡𝑞∧𝑝 𝑝∧¬𝑝≡F

Some Equivalences Related to Implication p  q   p  q p  q   q   p p  q  (p q)  (q  p) p  q   p   q

Understanding Connectives Reflect basic rules of reasoning and logic Allow manipulation of logical formulas Simplification Testing for equivalence Applications Query optimization Search optimization and caching Artificial Intelligence Program verification