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

Slides:



Advertisements
Similar presentations
Logic The study of correct reasoning.
Advertisements

CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
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
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.
2/17/2008Sultan Almuhammadi1 ICS Logic & Sets (An Overview) Week 1.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Discussion #10 1/16 Discussion #10 Logical Equivalences.
Propositional Logic Lecture 2: Sep 9. Conditional Statement If p then q p is called the hypothesis; q is called the conclusion “If your GPA is 4.0, then.
CSE 311 Foundations of Computing I Autumn 2011 Lecture 2 More Propositional Logic Application: Circuits Propositional Equivalence.
Chapter 3 Introduction to Logic © 2008 Pearson Addison-Wesley. All rights reserved.
Chapter 2: The Logic of Compound Statements 2.1 Logical Forms and Equivalence 12.1 Logical Forms and Equivalences Logic is a science of the necessary laws.
Logic Truth Tables, Propositions, Implications. Statements Logic is the tool for reasoning about the truth or falsity of statements. –Propositional logic.
3.2 – Truth Tables and Equivalent Statements
Logic ChAPTER 3.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Chapter 3 – Introduction to Logic The initial motivation for the study of logic was to learn to distinguish good arguments from bad arguments. Logic is.
CSCI2110 – Discrete Mathematics Tutorial 8 Propositional Logic Wong Chung Hoi (Hollis)
Normal or Canonical Forms Rosen 1.2 (exercises). Logical Operators  - Disjunction  - Conjunction  - Negation  - Implication p  q   p  q  - Exclusive.
Propositional Logic.
Intro to Discrete Structures
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.
Conditional Statements M Deductive Reasoning Proceeds from a hypothesis to a conclusion. If p then q. p  q hypothesis  conclusion.
The Foundations: Logic and Proofs
Discrete Maths 2. Propositional Logic Objective
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
MATH 102 Contemporary Math S. Rook
Normal Forms, Tautology and Satisfiability 2/3/121.
CS1502 Formal Methods in Computer Science
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
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.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Discrete Mathematics Lecture1 Miss.Amal Alshardy.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Circuit Design.
CSNB143 – Discrete Structure LOGIC. Learning Outcomes Student should be able to know what is it means by statement. Students should be able to identify.
CSS 342 Data Structures, Algorithms, and Discrete Mathematics I
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.
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.
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?
Review Given p: Today is Thursday q: Tomorrow is Friday
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSNB143 – Discrete Structure Topic 4 – Logic. Learning Outcomes Students should be able to define statement. Students should be able to identify connectives.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Mathematics for Computing Lecture 2: Computer Logic and Truth Tables Dr Andrew Purkiss-Trew Cancer Research UK
TRUTH TABLES Edited from the original by: Mimi Opkins CECS 100 Fall 2011 Thanks for the ppt.
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
Aim 1.4: To work with conditionals and biconditionals Do Now: Determine the truth value of the following sentences: 1.9 is a prime number and New York.
Chapter 1 Logic and proofs
Simple Logic.
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
MATH 15A – Discrete Mathematics
Elementary Metamathematics
Information Technology Department
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Disjunctive Normal Form
PROPOSITIONAL LOGIC - SYNTAX-
Presentation transcript:

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

Today’s Topics: More Propositional Logic 1. Necessary and sufficient 2. Negating a Disjunctive or Conjunctive Proposition  DeMorgan’s Law 3. Converting from Truth Table to Proposition 2

1. Necessary and sufficient Or, how to sound smart and win arguments on Reddit or other blog/forum of your choice 3

Necessary and Sufficient 4  p is NECESSARY for q  ¬p→¬q(“no p, no q!”)  p is SUFFICIENT for q  p→q(“p is all we need to know!”)  Note that ¬p→¬q is equivalent to q→p  So if p is necessary and sufficient for q, then p iff q.

Your turn: Practice i. p = Get an A on the final. ii. q = Get an A in the class. iii. r = Do the homework. iv. s = Get an A on everything.  p is necessary for q  p is sufficient for q  r is necessary for p  r is sufficient for s  s is sufficient for q How many of the necessary / sufficient sentences are true? A. 0 or 1 B. 2 C. 3 D. 4 E. 5 5

Be a beacon of rational thought in the online world  1 point extra credit on the midterm:  Make correct, good, topical use necessary or sufficient (1/2 pt each) in an online discussion  Link to your comment/post on TED to collect your points. Obviously no venues or topics that are NSFW/racist/sexist/etc.  Max 1pt per person 6

2. Negating a Disjunctive or Conjunctive Proposition DeMorgan’s Law 7

My opponent says I have 10 speeding tickets and took bribes from that oil company. That is not true! p = has 10 speeding tickets q = took bribes Which of the following is equivalent to  (p ∧ q)? A. ¬p ∧ ¬q B. ¬p ∨ ¬q C. ¬p ¬ ∧ ¬q D. ¬p → ¬q E. p ∨ q 8 Be the fact-checker!

Laws to memorize 9  DeMorgan’s   (p ∧ q) ≡ ¬p ∨ ¬q   (p ∨ q) ≡ ¬p ∧ ¬q  Distributive  Associative

2. Converting from Truth Table to Proposition Disjunctive and Conjunctive Normal Forms 10

DNF and CNF  DNF: Disjunctive Normal Form  OR of ANDs (terms) e.g. (p ∧ ¬q) ∨ (¬p ∧ ¬r)  CNF: Conjunctive Normal Form  AND of ORs (clauses) e.g. (p ∨ ¬q) ∧ (¬p ∨ ¬r) 11

DNF and CNF I. (p ∧ ¬q) ∨ (¬p ∧ ¬r) II. (¬p ∧ (p ∨ q) ∧ ¬r) ∨ (p ∧ r) III. (p ∧ r) ∨ ¬(r ∧ ¬q) IV. (p ∨ q ∨ r) ∧ (p ∨ ¬q) Categorize the above propositions: A. I is CNF and IV is DNF B. I and III are DNF and IV is CNF C. I is DNF and IV is CNF D. I, II and III are DNF and IV is CNF E. None/more/other 12

Equivalence of p → q and ¬p ∨ q 13  When we write a proposition, we are trying to describe what is true  One way to think about this:  Look for the rows that are true  Describe the input values for that row  “or” them together pq¬pp → q ¬p ∨ q TTFTT TFFFF FTTTT FFTTT

Disjunctive normal form (DNF) 14 pqp → q TT T TFF FT T FF T pqpq pqpq pqpq p  q  (p  q)  (  p  q)  (  p   q) OR

Disjunctive normal form (DNF) 15  Convert the predicate p  q to DNF A. (p  q)  (  p   q) B. (p  q)  (  p   q) C. (p  q)  (  p   q) D. (p  q)  (  p  q) E. None/more/other

Conjunctive normal form (CNF) 16 pq p  q TTT TF F FT F FFT pqpq p  q  (  p  q)  (p   q) AND p qp q

Conjunctive normal form (CNF) 17  Convert the predicate p  q to CNF A. p   q B. p   q C. (p  q)  (  p   q) D. (p  q)  (  p  q) E. None/more/other

CNF vs DNF  Every predicate can be written both as a CNF and as a DNF  Which one is more effective (requires less connectives to write): A. CNF B. DNF C. Both require the same number D. Depends on predicate E. None/more/other

Negating a CNF  Say s is a predicate with a DNF s  (p  q)  (  p  r)  (p   r)  (  p   q)  We want to compute  s. Which one of the following is easiest to compute: A. CNF for  s B. DNF for  s C. Both are equally easy to compute D. None/more/other