CSci 2011 Recap ^Propositional operation summary not andorconditionalBi-conditional pq ppqqpqpqpqpqpqpqpqpq TTFFTTTT TFFTFTFF FTTFFTTF FFTTFFTT.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
Propositions and Connectives Conditionals and Bi-conditionals Quantifiers.
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
Discrete Mathematics Math 6A Instructor: M. Welling.
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
Logic Truth Tables, Propositions, Implications. Statements Logic is the tool for reasoning about the truth or falsity of statements. –Propositional logic.
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
Logical Equivalence & Predicate Logic
MATH 213 A – Discrete Mathematics for Computer Science Dr. (Mr.) Bancroft.
Mathematical Structures A collection of objects with operations defined on them and the accompanying properties form a mathematical structure or system.
1 Logic Logic is a discipline that studies the principles and methods used in correct reasoning It includes: A formal language for expressing statements.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
CSci 2011 Textbook ^Discrete Mathematics and Its Applications,  Rosen  6th Edition  McGraw Hill  2006.
Review I Rosen , 3.1 Know your definitions!
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
1 Predicates and Quantifiers CS/APMA 202, Spring 2005 Rosen, section 1.3 Aaron Bloomfield.
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
CSci 2011 Discrete Mathematics Lecture 6
1 Boolean Logic CS 202, Spring 2007 Epp, sections 1.1 and 1.2 Aaron Bloomfield.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Chapter 1, Part II With Question/Answer Animations Copyright © McGraw-Hill Education. All rights reserved. No reproduction or distribution without the.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Chapter 2 Logic 2.1 Statements 2.2 The Negation of a Statement 2.3 The Disjunction and Conjunction of Statements 2.4 The Implication 2.5 More on Implications.
Chapter 1: The Foundations: Logic and Proofs
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
Discrete Structures – CNS 2300
Chapter 2 Symbolic Logic. Section 2-1 Truth, Equivalence and Implication.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
1 Boolean Logic CS/APMA 202, Spring 2005 Rosen, section 1.1 Aaron Bloomfield.
Predicate Logic One step stronger than propositional logic Copyright © Curt Hill.
CSci 2011 Discrete Mathematics Lecture 4 CSci 2011.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
رياضيات متقطعة لعلوم الحاسب MATH 226. Text books: (Discrete Mathematics and its applications) Kenneth H. Rosen, seventh Edition, 2012, McGraw- Hill.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Introduction to Predicates and Quantified Statements I Lecture 9 Section 2.1 Wed, Jan 31, 2007.
CSci 2011 Discrete Mathematics Lecture 5 CSci 2011.
Introduction to Discrete Mathematics Discrete Mathematics: is the part of mathematics devoted to the study of discrete objects. Discrete Mathematics is.
Chapter 1 Logic and proofs
Propositional Equivalences
The Foundations: Logic and Proofs
CSE15 Discrete Mathematics 01/23/17
CSNB 143 Discrete Mathematical Structures
CS 202, Spring 2008 Epp, sections 1.1 and 1.2
6/20/2018 Arab Open University Faculty of Computer Studies M131 - Discrete Mathematics 6/20/2018.
Citra Noviyasari, S.Si, MT
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
Propositional Equivalences
CS100: Discrete structures
Information Technology Department
CS 220: Discrete Structures and their Applications
Introduction to Predicates and Quantified Statements I
CSE 321 Discrete Structures
Cs Discrete Mathematics
Predicates and Quantifiers
Discrete Structures Prepositional Logic 2
The Foundations: Logic and Proofs
Presentation transcript:

CSci 2011 Recap ^Propositional operation summary not andorconditionalBi-conditional pq ppqqpqpqpqpqpqpqpqpq TTFFTTTT TFFTFTFF FTTFFTTF FFTTFFTT

CSci 2011 Precedence of operators ^Just as in algebra, operators have precedence  4+3*2 = 4+(3*2), not (4+3)*2 ^Precedence order (from highest to lowest): ¬   → ↔  The first three are the most important ^This means that p  q  ¬r → s ↔ t yields: (p  (q  (¬r)) → s) ↔ (t) ^Not is always performed before any other operation

CSci 2011 Translating English Sentences ^Question 7 from Rosen, p. 17  p = “It is below freezing”  q = “It is snowing” ^It is below freezing and it is snowing ^It is below freezing but not snowing ^It is not below freezing and it is not snowing ^It is either snowing or below freezing (or both) ^If it is below freezing, it is also snowing ^It is either below freezing or it is snowing, but it is not snowing if it is below freezing ^That it is below freezing is necessary and sufficient for it to be snowing pqpq p¬qp¬q ¬p¬q¬p¬q pqpq p→qp→q ((pq)¬(pq))(p → ¬q) p↔qp↔q

CSci 2011 Translation Example 2 ^Heard on the radio:  A study showed that there was a correlation between the more children ate dinners with their families and lower rate of substance abuse by those children  Announcer conclusions:  If children eat more meals with their family, they will have lower substance abuse  If they have a higher substance abuse rate, then they did not eat more meals with their family

CSci 2011 Translation Example 3 ^“I have neither given nor received help on this exam” ^Let p = “I have given help on this exam” ^Let q = “I have received help on this exam” ^¬p¬q^¬p¬q

CSci 2011 Translation Example 4 ^You can access the Internet from campus only if you are a computer science major or you are not a freshman.  a  (c   f) ^You cannot ride the roller coaster if you are under 4 feet tall unless you are older than 16 years old.  (f   s)   r  r  ( f  s)

CSci 2011 Boolean Searches (2011 OR 5471) AND yongdae AND “computer science” ^Note that Google requires you to capitalize Boolean operators ^Google defaults to AND; many others do not

CSci 2011 Bit Operations ^Boolean values can be represented as 1 (true) and 0 (false) ^A bit string is a series of Boolean values. Length of the string is the number of bits.  is eight Boolean values in one string ^We can then do operations on these Boolean strings  Each column is its own Boolean operation 

ch1.2 Propositional Equivalences CSci 2011

Tautology, Contradiction, Equivalence ^Tautology: a statement that’s always true  p   p will always be true ^Contradiction: a statement that’s always false  p   p will always be false ^A logical equivalence means that the two sides always have the same truth values  Symbol is ≡  or  (we’ll use ≡ )

CSci 2011 Examples  Identity law p  T  p  Commutative law p  q  q  p pT pTpT TTT FTF pq pqpqqpqp TTTT TFFF FTFF FFFF

CSci 2011 Examples  Associative law (p  q)  r  p  (q  r) pqr pqpq(pq)rqrqrp(qr) TTTTTTT TTFTFFF TFTFFFF TFFFFFF FTTFFTF FTFFFFF FFTFFFF FFFFFFF

CSci 2011 Interesting… ^“This statement is false”  Is this proposition? ^“I am lying now.”  Greek philosopher, Eubulides of Miletus  A man says that he is lying. Is what he says true or false?  The following sentence is true. The preceding sentence is false. ^

CSci 2011 Logical Equivalences p  T  p p  F  p Identity Laws (p  q)  r  p  (q  r) (p  q)  r  p  (q  r) Associative laws p  T  T p  F  F Domination Law p  (q  r)  (p  q)  (p  r) p  (q  r)  (p  q)  (p  r) Distributive laws p  p  p p  p  p Idempotent Laws  (p  q)   p   q  (p  q)   p   q De Morgan’s laws ( p)  p Double negation law p  (p  q)  p p  (p  q)  p Absorption laws p  q  q  p p  q  q  p Commutative Laws p   p  T p   p  F Negation lows pq  pq Definition of Implication p  q  (p  q)  (q  p) Definition of Biconditional

CSci 2011 Proof using Logical Equivalence (p  r)  (q  r)  (p  q)  r Definition of implication Associative Commutative Associative De Morgan, Idempotent Definition of implication  ( p  r)  ( q  r)   p  r   q  r   p   q  r  r  ( p   q)  (r  r)   (p  q)  r

CSci 2011 Example  Show that (p  q)  (p  q) is a Tautology. (Proof) (p  q)  (p  q)   (p  q)  (p  q) Implication  ( p   q)  (p  q) De Morgan  ( p  p)  ( q  q) Commutative, Associative  T  T Negation  T Identity

CSci 2011 Example ^At a trial:  Bill says: “Sue is guilty and Fred is innocent.”  Sue says: “If Bill is guilty, then so is Fred.”  Fred says: “I am innocent, but at least one of the others is guilty.” ^Let b = Bill is innocent, f = Fred is innocent, and s = Sue is innocent ^Statements are:  ¬s  f  ¬b → ¬f  f  (¬b  ¬s) ^Can all of their statements be true???

CSci 2011 Example (cnt)  (s  f)  (b  f)  (f  (b  s))  T LHS ( s  f)  (b   f)  (f  ( b   s))  (( s  f)  (f  ( b   s)))  (b   f)  ( s  f  ( b   s))  (b   f)  (( s  f   b)  ( s  f))  (b   f)  ( s  f)  (b   f)  ( s  f  b)  s  f   f)  ( s  f  b) F   s  f  b ^So what is the conclusion?

ch1.3 Predicates and Quantifiers CSci 2011

This Section ^How can we express  “every computer in CS department is protected by intrusion detection system”  “There exists at least one student who has a red hair”. ^“x is greater than 3”  x: subject  “is greater than 3”: predicate  P(x): propositional function P at x

CSci 2011 Propositional Functions ^Consider P(x) = x < 5  P(x) has no truth values (x is not given a value)  P(1) is true: The proposition 1<5 is true  P(10) is false: The proposition 10<5 is false ^P(x) will create a proposition when given a value ^Let P(x) = “x is a multiple of 5”  For what values of x is P(x) true? ^Let P(x) = x + 3  For what values of x is P(x) true?

CSci 2011 Anatomy of a propositional function P(x) = x + 5 > x variablepredicate

CSci 2011 Propositional functions 3 ^Functions with multiple variables:  P(x,y) = x + y == 0  P(1,2) is false, P(1,-1) is true  P(x,y,z) = x + y == z  P(3,4,5) is false, P(1,2,3) is true  P(x 1,x 2,x 3 … x n ) = …

CSci 2011 Quantifiers ^Why quantifiers?  Many things (in this course and beyond) are specified using quantifiers ^A quantifier is “an operator that limits the variables of a proposition” ^Two types:  Universal  Existential

CSci 2011 Universal quantifiers 1 ^Represented by an upside-down A:   It means “for all”  Let P(x) = x+1 > x ^We can state the following:  x P(x)  English translation: “for all values of x, P(x) is true”  English translation: “for all values of x, x+1>x is true”

CSci 2011 Universal quantifiers 2 ^But is that always true?  x P(x) ^Let x = the character ‘a’  Is ‘a’+1 > ‘a’? ^Let x = the state of Minnesota  Is Minnesota+1 > Minnesota? ^You need to specify your universe!  What values x can represent  Called the “domain” or “universe of discourse” by the textbook

CSci 2011 Universal quantifiers 3 ^Let the universe be the real numbers. ^Let P(x) = x/2 < x  Not true for the negative numbers!  Thus, x P(x) is false  When the domain is all the real numbers ^In order to prove that a universal quantification is true, it must be shown for ALL cases ^In order to prove that a universal quantification is false, it must be shown to be false for only ONE case

CSci 2011 Universal quantification 4 ^Given some propositional function P(x) ^And values in the universe x 1.. x n ^The universal quantification x P(x) implies: P(x 1 )  P(x 2 )  …  P(x n )

CSci 2011 Existential quantification 1 ^Represented by an backwards E:   It means “there exists”  Let P(x) = x+1 > x ^We can state the following:  x P(x)  English translation: “there exists (a value of) x such that P(x) is true”  English translation: “for at least one value of x, x+1>x is true”

CSci 2011 Existential quantification 2 ^Note that you still have to specify your universe ^Let P(x) = x+1 < x  There is no numerical value x for which x+1<x  Thus, x P(x) is false

CSci 2011 Existential quantification 3 ^Let P(x) = x+1 > x  There is a numerical value for which x+1>x  In fact, it’s true for all of the values of x!  Thus,  x P(x) is true ^In order to show an existential quantification is true, you only have to find ONE value ^In order to show an existential quantification is false, you have to show it’s false for ALL values

CSci 2011 Existential quantification 4 ^Given some propositional function P(x) ^And values in the universe x 1.. x n ^The existential quantification x P(x) implies: P(x 1 )  P(x 2 )  …  P(x n )

CSci 2011 Interesting!!! ^Theorem: All numbers are equal to 0. (Proof) Suppose a = b. Then a 2 = a b. Then a 2 - b 2 = ab - b 2. Then (a-b)(a+b) = b(a-b). Then a+b = b. Therefore, a = 0.

CSci 2011 A note on quantifiers ^Recall that P(x) is a propositional function  Let P(x) be “x == 0” ^Recall that a proposition is a statement that is either true or false  P(x) is not a proposition ^There are two ways to make a propositional function into a proposition:  Supply it with a value  For example, P(5) is false, P(0) is true  Provide a quantification  For example, x P(x) is false and x P(x) is true –Let the universe of discourse be the real numbers

CSci 2011 Binding variables ^Let P(x,y) be x > y ^Consider: x P(x,y)  This is not a proposition!  What is y?  If it’s 5, then x P(x,y) is false  If it’s x-1, then x P(x,y) is true ^Note that y is not “bound” by a quantifier

CSci 2011 Binding variables 2 ^(x P(x))  Q(x)  The x in Q(x) is not bound; thus not a proposition ^(x P(x))  (x Q(x))  Both x values are bound; thus it is a proposition ^(x P(x)  Q(x))  (y R(y))  All variables are bound; thus it is a proposition ^(x P(x)  Q(y))  (y R(y))  The y in Q(y) is not bound; this not a proposition

CSci 2011 Negating quantifications ^Consider the statement:  All students in this class have red hair ^What is required to show the statement is false?  There exists a student in this class that does NOT have red hair ^To negate a universal quantification:  You negate the propositional function  AND you change to an existential quantification  ¬x P(x) = x ¬P(x)

CSci 2011 Negating quantifications 2 ^Consider the statement:  There is a student in this class with red hair ^What is required to show the statement is false?  All students in this class do not have red hair ^Thus, to negate an existential quantification:  To negate the propositional function  AND you change to a universal quantification  ¬x P(x) = x ¬P(x)

CSci 2011 Translating from English ^What about if the universe of discourse is all students (or all people?)  Every student in this class has studied calculus.  x (S(x)C(x))  This is wrong! Why?  x (S(x) → C(x))

CSci 2011 Translating from English 3 ^Consider:  “Some students have visited Mexico”  “Every student in this class has visited Canada or Mexico” ^Let:  S(x) be “x is a student in this class”  M(x) be “x has visited Mexico”  C(x) be “x has visited Canada”

CSci 2011 Translating from English 4 ^Consider: “Some students have visited Mexico”  Rephrasing: “There exists a student who has visited Mexico” ^x M(x)  True if the universe of discourse is all students ^What about if the universe of discourse is all people?  x (S(x) → M(x))  This is wrong! Why?  x (S(x)  M(x))

CSci 2011 Translating from English 5 ^Consider: “Every student in this class has visited Canada or Mexico” ^x (M(x)C(x))  When the universe of discourse is all students ^x (S(x) → (M(x)C(x))  When the universe of discourse is all people

CSci 2011 Negating quantifications ^Consider the statement:  All students in this class have red hair ^What is required to show the statement is false?  There exists a student in this class that does NOT have red hair ^To negate a universal quantification:  You negate the propositional function  AND you change to an existential quantification  ¬x P(x) = x ¬P(x)

CSci 2011 Negating quantifications 2 ^Consider the statement:  There is a student in this class with red hair ^What is required to show the statement is false?  All students in this class do not have red hair ^Thus, to negate an existential quantification:  To negate the propositional function  AND you change to a universal quantification  ¬x P(x) = x ¬P(x)

CSci 2011 Translating from English ^What about if the universe of discourse is all students (or all people?)  Every student in this class has studied calculus.  x (S(x)C(x))  This is wrong! Why?  x (S(x) → C(x))

CSci 2011 Translating from English 3 ^Consider:  “Some students have visited Mexico”  “Every student in this class has visited Canada or Mexico” ^Let:  S(x) be “x is a student in this class”  M(x) be “x has visited Mexico”  C(x) be “x has visited Canada”

CSci 2011 Translating from English 4 ^Consider: “Some students have visited Mexico”  Rephrasing: “There exists a student who has visited Mexico” ^x M(x)  True if the universe of discourse is all students ^What about if the universe of discourse is all people?  x (S(x) → M(x))  This is wrong! Why?  x (S(x)  M(x))

CSci 2011 Translating from English 5 ^Consider: “Every student in this class has visited Canada or Mexico” ^x (M(x)C(x))  When the universe of discourse is all students ^x (S(x) → (M(x)C(x))  When the universe of discourse is all people