CSE 20 DISCRETE MATH WINTER

Similar documents
CSE 20 DISCRETE MATH WINTER

HW1 graded review form? HW2 released CSE 20 DISCRETE MATH. Fall

Propositional Logic Basics Propositional Equivalences Normal forms Boolean functions and digital circuits. Propositional Logic.

CSE 20 DISCRETE MATH. Fall

CSE20: Discrete Mathematics for Computer Science. Lecture Unit 2: Boolan Functions, Logic Circuits, and Implication

Lecture 2. Logic Compound Statements Conditional Statements Valid & Invalid Arguments Digital Logic Circuits. Reading (Epp s textbook)

Section 1.1: Logical Form and Logical Equivalence

We last time we began introducing equivalency laws.

Solutions to Homework I (1.1)

Definition 2. Conjunction of p and q

Truth-Functional Logic

Tautologies, Contradictions, and Contingencies

Supplementary exercises in propositional logic

Section 1.2 Propositional Equivalences. A tautology is a proposition which is always true. A contradiction is a proposition which is always false.

Example. Logic. Logical Statements. Outline of logic topics. Logical Connectives. Logical Connectives

CSE 20: Discrete Mathematics

Recitation Week 3. Taylor Spangler. January 23, 2012

CSE 20 DISCRETE MATH. Winter

Solutions to Sample Problems for Midterm

CSC Discrete Math I, Spring Propositional Logic

Logic and Truth Tables

Topic 1: Propositional logic

CSE 20 DISCRETE MATH. Winter

Discrete Structures & Algorithms. Propositional Logic EECE 320 // UBC

Chapter 1, Section 1.1 Propositional Logic

Boolean Algebra. Philipp Koehn. 9 September 2016

CS Module 1. Ben Harsha Apr 12, 2017

Tecniche di Verifica. Introduction to Propositional Logic

CSE 240 Logic and Discrete Mathematics

Section 3.1 Statements, Negations, and Quantified Statements

Compound Propositions

CSE 105 THEORY OF COMPUTATION

MACM 101 Discrete Mathematics I. Exercises on Propositional Logic. Due: Tuesday, September 29th (at the beginning of the class)

Comp487/587 - Boolean Formulas

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

= x ( x 2 4 ) [factor out x] (2)

CS 220: Discrete Structures and their Applications. Propositional Logic Sections in zybooks

Announcements. CS243: Discrete Structures. Propositional Logic II. Review. Operator Precedence. Operator Precedence, cont. Operator Precedence Example

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

Propositional Logic. Spring Propositional Logic Spring / 32

Chapter 1: The Logic of Compound Statements. January 7, 2008

EECS 1028 M: Discrete Mathematics for Engineers

CprE 281: Digital Logic

Homework assignment 1: Solutions

CSE 20 DISCRETE MATH. Fall

CSE 20 DISCRETE MATH. Winter

Discrete Structures for Computer Science

CprE 281: Digital Logic

CprE 281: Digital Logic

Logic and Truth Tables

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

Propositional Resolution

Preparing for the CS 173 (A) Fall 2018 Midterm 1

cse 311: foundations of computing Spring 2015 Lecture 3: Logic and Boolean algebra

Automated Program Verification and Testing 15414/15614 Fall 2016 Lecture 2: Propositional Logic

Sec$on Summary. Tautologies, Contradictions, and Contingencies. Logical Equivalence. Normal Forms (optional, covered in exercises in text)

CSE 311: Foundations of Computing. Lecture 3: Digital Circuits & Equivalence

Announcements. CS311H: Discrete Mathematics. Propositional Logic II. Inverse of an Implication. Converse of a Implication

Midterm Exam Solution

CHAPTER 1 - LOGIC OF COMPOUND STATEMENTS

Chapter 4: Classical Propositional Semantics

CprE 281: Digital Logic

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Propositional Logic: Equivalence

THE LOGIC OF COMPOUND STATEMENTS

CSCI Homework Set 1 Due: September 11, 2018 at the beginning of class

Boolean Algebra, Gates and Circuits

Math.3336: Discrete Mathematics. Propositional Equivalences

Propositional Logic 1

C241 Homework Assignment 4

Propositional Logic and Semantics

Chapter Summary. Propositional Logic. Predicate Logic. Proofs. The Language of Propositions (1.1) Applications (1.2) Logical Equivalences (1.

Chapter 4, Logic using Propositional Calculus Handout

CS 486: Lecture 2, Thursday, Jan 22, 2009

2.2: Logical Equivalence: The Laws of Logic

Chapter 1, Part I: Propositional Logic. With Question/Answer Animations

Logic and Proofs. Jan COT3100: Applications of Discrete Structures Jan 2007

CS206 Lecture 03. Propositional Logic Proofs. Plan for Lecture 03. Axioms. Normal Forms

Propositional Logic: Semantics

1 Propositional Logic

Announcements Monday, September 18

AI Programming CS S-09 Knowledge Representation

CS156: The Calculus of Computation Zohar Manna Autumn 2008

Section 1.1: Propositions and Connectives

Boolean Logic. CS 231 Dianna Xu

NP-Completeness Part II

What is Logic? Introduction to Logic. Simple Statements. Which one is statement?

Propositional and Predicate Logic

Today s Topic: Propositional Logic

Propositional Logic:

Propositional Equivalence

Course Staff. Textbook

MAT2345 Discrete Math

Propositional and Predicate Logic

n logical not (negation) n logical or (disjunction) n logical and (conjunction) n logical exclusive or n logical implication (conditional)

Write the negation of each of the following propositions without using any form of the word not :

Introduction Propositional Logic

THE LOGIC OF COMPOUND STATEMENTS

CS173 Lecture B, September 10, 2015

Propositional Logic. Fall () Propositional Logic Fall / 30

Transcription:

CSE 20 DISCRETE MATH WINTER 2017 http://cseweb.ucsd.edu/classes/wi17/cse20-ab/

Reminders Homework 3 due Sunday at noon Exam 1 in one week One note card can be used. Bring photo ID. Review sessions Thursday in class Saturday January 28 11am-12:50pm PETER108 Recommended textbook qs Monday January 30 8pm-9:50pm SOLIS107 Exam Practice Sheet Assigned seats: seat map on Piazza shortly Office hours

Today's learning goals Identify when and prove that a statement is a tautology or contradiction Prove propositional equivalences using truth tables Prove propositional equivalences using other known equivalences, e.g. DeMorgan s laws Double negation laws Distributive laws, etc. Compute the CNF and DNF of a given compound proposition. Relate boolean operations to applications Combinatorial circuits Logic puzzles

Tautology and contradiction Rosen p. 25 Tautology: compound proposition that is always T Contradiction: compound proposition that is always F p q F T T T F T T F F T F T F T F F F T Which of the following is a tautology? A. B. C. D. E. Clicker frequency: AC

Logical equivalences Rosen p. 25 Compound propositions that have the same truth values in all possible cases are logically equivalent, denoted. p q T T? T F? F T? F F? Notice: A and B are logically equivalent iff Aß à B is a tautology

De Morgan Laws Rosen p. 26 Replacing the main connective!

(Some) Useful equivalences Rosen p. 26-28. 32 equivalences listed in book! Can replace p and q with any (compound) proposition

(Some) Useful equivalences Rosen p. 26-28 For constructing (minimal) circuits with specified gates only NOTs? only ANDs?. 32 equivalences listed in book! Can replace p and q with any (compound) proposition

(Some) Useful equivalences Rosen p. 26-28 For simplying and evaluating complicated compound propositions Remove parentheses? Reduce subexpressions to simpler ones. 32 equivalences listed in book! Can replace p and q with any (compound) proposition

(Some) Useful equivalences Rosen p. 26-28 For devising proofs of statements Translate using existing logical structure. Try to apply known proof strategy. Rewrite in equivalent way to apply additional proof strategies. (more on this later). 32 equivalences listed in book! Can replace p and q with any (compound) proposition

Sample equivalence proof Prove that is logically equivalent to Are these compound propositions logically equivalent to? You'll decide in HW3!

Other laws of equivalence Rosen p. 29-31 Any compound proposition can be translated to one using A. only ANDs. B. only ORs. C. only IFs. D. only NOTs. E. None of the above

Other laws of equivalence Rosen p. 35 #42-53 Any compound proposition can be translated to one using A. only ANDs. B. only ORs. C. only IFs. D. only NOTs. E. None of the above Functionally complete collection of connectives.

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT Example:

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT Example:

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT Example:

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT Example:

Functionally complete set of connectives Rosen p. 35 #42-53 Claim: The connectives AND, NOT are functionally complete. Any compound proposition can be rewritten as a logically equivalent one that only has the operators AND, NOT Example:

Functionally complete set of connectives Rosen p. 35 #42-53 Rewriting compound propositions using only NOT, AND 1. Work from the inside out 2. For each connective, replace it with an equivalent form that uses only NOT, AND: If the connective is NOT or AND, do nothing. If the connective is OR: replace with If the connective is IF..THEN: replace If the connective is IFF: replace with If the connective is XOR: replace with with

Functionally complete set of connectives Rosen p. 35 #42-53 Example: express as a logically equivalent compound proposition that only uses ANDs and NOTs.

Functionally complete set of connectives Rosen p. 35 #42-53 Example: express as a logically equivalent compound proposition that only uses ANDs and NOTs. Use to rewrite intermediate step:

Functionally complete set of connectives Rosen p. 35 #42-53 Example: express as a logically equivalent compound proposition that only uses ANDs and NOTs. Use to rewrite intermediate step: Use to rewrite: Simplify double negation and use associativity:

Sample questions Given compound proposition What is its main connective? Is it a tautology? a contradiction? Construct its truth table. Construct a combinatorial circuit using. that produces the values of this proposition as output. Is it logically equivalent to.? Find its negation and "simplify". Find a logically equivalent compound proposition that

Going backwards Given compound proposition, use Truth tables Logical equivalences to compute truth values. Reverse? Given truth table settings, want compound proposition with that output. E.g. Think back to HW2 Q5

CNF and DNF Rosen p. 35 #42-53 Conjunctive normal form: AND of ORs (of variables or their negations). Disjunctive normal form: OR of ANDs (of variables or their negations). Which of the following is in CNF? A. B. C. D. E. More than one of the above. In this context, the propositional variable A can be interpreted as an AND (of itself), and as an OR (of itself)

Reverse-engineering p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 1: classify rows based on one variable p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form DNF: when is output T? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F LAND IN THESE ROWS!

Reverse-engineering Approach 2: algorithmically convert to normal form DNF: when is output T? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form DNF: when is output T? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form DNF: when is output T? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form DNF: when is output T? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form CNF: when is output F? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F AVOID THESE ROWS!

Reverse-engineering Approach 2: algorithmically convert to normal form CNF: when is output F? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F AVOID THESE ROWS!

Reverse-engineering Approach 2: algorithmically convert to normal form CNF: when is output F? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Reverse-engineering Approach 2: algorithmically convert to normal form CNF: when is output F? p q r? T T T T T T F T T F T F T F F T F T T F F T F F F F T T F F F F

Payoff Any output column of a truth table (assignment of T/F to each combination of T/F input values) can be realized as a compound proposition. The collection is functionally complete.

Normal forms Rosen p. 35 #42-53 Compound proposition Proposition in normal form Added benefit: If want to reduce connectives further to prove a new collection of connectives is functionally complete, only need to consider those used in normal form.

Puzzle: Muddy children Rosen Example 8, page 20 Two kids play in the mud outside. When they are done, their parent says at least one of you has a muddy forehead. The children can t see themselves but can see each other. If the older child sees mud on the younger child's forehead A. The older child knows both of them have muddy foreheads. B. The older child knows the younger child has a muddy forehead. C. The older child knows that they themselves have a muddy forehead. D. None of the above they can t be sure. E. I don t know.

Puzzle: Muddy children Rosen Example 8, page 20 Two kids play in the mud outside. When they are done, their parent says at least one of you has a muddy forehead. The children can t see themselves but can see each other. If the older child (even being a perfect reasoner) doesn't have enough information to tell whether s/he has mud on their forehead A. The younger child knows the older one has muddy forehead. B. The younger child knows the older one has no mud. C. The younger child knows s/he himself has no mud. D. None of the above they can t be sure. E. I don't know.

Reminders Homework 3 due Sunday at noon Exam 1 in one week One note card can be used. Bring IDs. Review sessions In class Thursday On the weekend TBA (if we get a lecture hall) Monday January 30 8pm-9:50pm Assigned seats: seat map on Piazza shortly Office hours listed on class calendar