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

Slides:



Advertisements
Similar presentations
Logic The study of correct reasoning.
Advertisements

PROOF BY CONTRADICTION
CSE 20 DISCRETE MATH Prof. Shachar Lovett Clicker frequency: CA.
CSE 311: Foundations of Computing Fall 2013 Lecture 3: Logic and Boolean algebra.
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
EE1J2 - Slide 1 EE1J2 – Discrete Maths Lecture 3 Syntax of Propositional Logic Parse trees revised Construction of parse trees Semantics of propositional.
Today’s Topics n Review Logical Implication & Truth Table Tests for Validity n Truth Value Analysis n Short Form Validity Tests n Consistency and validity.
From Chapter 4 Formal Specification using Z David Lightfoot
1 Section 1.1 Logic. 2 Proposition Statement that is either true or false –can’t be both –in English, must contain a form of “to be” Examples: –Cate Sheller.
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.
Satisfiability & Logical Truth PHIL /16/2001.
Adapted from Discrete Math
3.2 – Truth Tables and Equivalent Statements
CSE 20 – Discrete Mathematics Dr. Cynthia Bailey Lee Dr. Shachar Lovett Peer Instruction in Discrete Mathematics by Cynthia Leeis licensed under a Creative.
Conjunctions, Disjunctions, and Negations Symbolic Logic 2/12/2001.
Intro to Discrete Structures
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.
Discrete Maths 2. Propositional Logic Objective
Discrete Mathematics and Its Applications
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Truth Functions Relationships A function is a relation that links members of sets. The set of all x which are in relation R with some y is called the.
1 Introduction to Abstract Mathematics The Logic and Language of Proofs Instructor: Hayk Melikya Proposition: Informal introduction to.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 3 Introduction to Logic © 2008 Pearson Addison-Wesley. All rights reserved.
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.
Chapter 2: The Logic of Compound Statements 2.2 Conditional Statements
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
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
MAIN TOPIC : Statement, Open Sentences, and Truth Values Negation Compound Statement Equivalency, Tautology, Contradiction, and Contingency Converse, Inverse,
MLS 570 Critical Thinking Reading Notes for Fogelin: Propositional Logic Fall Term 2006 North Central College.
Chapter 8 – Symbolic Logic Professor D’Ascoli. Symbolic Logic Because the appraisal of arguments is made difficult by the peculiarities of natural language,
6.1 Logic Logic is not only the foundation of mathematics, but also is important in numerous fields including law, medicine, and science. Although the.
1/10/ Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta Office: CSEB 3043 Phone:
Logic UNIT 1.
Section 1.1 Propositions and Logical Operations. Introduction Remember that discrete is –the study of decision making in non-continuous systems. That.
Mathematics for Comter I Lecture 2: Logic (1) Basic definitions Logical operators Translating English sentences.
Logical Thinking CS 104 9/12/11. Agenda Today  College Board survey reminder  Note: Simple “how to” guide on Scratch posted on eLearning  Review HW.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
 2012 Pearson Education, Inc. Slide Chapter 3 Introduction to Logic.
3.3 – The Conditional A conditional statement is a compound statement that uses the connective if…then. The conditional is written with an arrow, so “if.
Propositional and predicate logic
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
Propositional Logic.
tautology checking continued
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Lecture 1 – Formal Logic.
Truth Tables and Equivalent Statements
Niu Kun Discrete Mathematics Chapter 1 The Foundations: Logic and Proof, Sets, and Functions Niu Kun 离散数学.
MATH 245 Spring 2009 This is mathematics for computer science
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
MATH 15A – Discrete Mathematics
The Lost Art of Argument
Propositional Calculus: Boolean Algebra and Simplification
Administrivia Course Web:
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett
Discrete Mathematics and Its Applications Kenneth H
Discrete Mathematics Lecture 2: Propositional Logic
MAT 3100 Introduction to Proof
Lecture 5 Binary Operation Boolean Logic. Binary Operations Addition Subtraction Multiplication Division.
Truth tables Mrs. Palmer.
Discrete Structures Prepositional Logic 2
Truth tables.
Presentation transcript:

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

Propositional logic 1. What is (and isn’t) a proposition? 2. Propositional variables 3. Propositional variables and formulas  not, and, or 4. Implication  implies (if/then), if and only if (iff) 2

1. What is (and isn’t) a proposition? 3

WHY isn’t “Where is the CSE 20 lecture room?” a proposition? A. Because only “yes/no” questions can be propositions (ex: “Do you like CSE 20?” would be a proposition). B. Because questions can never be propositions. C. Because the answer changes over time (CSE 20 is in different rooms each quarter). D. None/more/other. 4

Propositions  Sentences that are either true or false  = 7  = 7  My name is Scooby Doo  NO:  Questions  Is equal to 7?  Imperatives (commands)  Go to school.  For this class, we’ll not worry about differences of opinion  iPhones are better than Android phones. 5

3. Propositional variables 6

Back to the algebra analogy  2x + 6 ?= 2 (x + 3)  In Algebra, we study the forms of equations that are equal to each other (irrespective of what x is).  In logic, we study the forms of sentences that are equivalent to each other (irrespective of the particular facts/propositions in question).  In both Algebra and logic, we abstract these out by just assigning them a variable name. 7

Propositional variables  p = “You study.”  q = “You already knew all the material.”  r = “You will get an A in the class.” Propositional formulas  Use the variables to construct more complex relationships:  s = if (p or q) then r.  This newly constructed thing is also a sentence that is either true or false— also a proposition!  Is s (A) True or (B) False? 8

4. Propositional formulas 9

Logical connectives  and  or  not  if/then, implies  if and only if, iff  All these take two* propositions and connect them into a new proposition 10

Boolean logic can help you!  When you search the web, using logical connectives can help you narrow down your searches

Practice: Make an English sentence into a propositional formula  s = “If you want to learn logic, then you should take CSE 20.” A. p = “learn logic”, q = “CSE 20”, s = p IMPLIES q B. p = “If you want to learn logic”, q = “then you should take CSE 20”, s = p AND q C. p = “If you want to learn logic”, q = “then you should take CSE 20”, s = p IMPLIES q D. p = “you want to learn logic”, q = “you should take CSE 20,” s = p IMPLIES q E. p = “you want to learn logic”, q = “take CSE 20,” s = p AND q 12

Question: How do we know whether the new proposition is true?  If the answer is, “well, we have to read the proposition and decide if it seems true on a case-by-case basis,” then logic FAIL.  Our whole purpose in studying logic is to have a known way of determining this based on the form of the proposition’s composition and the truth of each input variable.  We summarize these “known ways of determining” in truth tables. “All these take two* propositions and connect them into a new proposition.” 13

Truth tables: not p¬p FT TF  If “I like CSE 20.” is true, then what do we know about the negation: “I do not like CSE 20.”?  We know it must be false.  It doesn’t matter what the sentence is, taking the negation of a true sentence will give you a false sentence. 14

Truth tables: AND A. T, F, F, T B. F, T, T, T C. F, F, F, T D. F, T, T, F E. None/more/other 15 pqp AND q FF FT TF TT I’m interested in seeing if this makes intuitive sense to you— can you explain why each output makes sense, using example sentences?

Truth tables: OR A. T, F, F, T B. F, T, T, T C. F, F, F, T D. F, T, T, F E. None/more/other 16 pqp OR q FF FT TF TT I’m interested in seeing if this makes intuitive sense to you— can you explain why each output makes sense, using example sentences?

Practice: IMPLIES  p = “I got an A on every assignment, exam, and other assessment in CSE 8A” (assume True)  q = “I got an A in CSE 8A” (assume True)  r = “My dog loves macaroni.” (assume True) Which of the following are true? A. p IMPLIES q B. r IMPLIES q C. q IMPLIES r D. None/More/Other 17

Note about implication and causality  In logic, we are looking at the form of the arguments  s = p IMPLIES q  To know if the proposition s is true, it is not necessary for p to cause q  To determine if s is true, we only care if p is true and if q is true (then look at the truth table) 18