DISCRETE MATHEMATICS I LECTURES CHAPTER 3 Dr. Adam P. Anthony Spring 2011 Some material adapted from lecture notes provided by Dr. Chungsim Han and Dr.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

Discrete Mathematics I Lectures Chapter 6
© by Kenneth H. Rosen, Discrete Mathematics & its Applications, Sixth Edition, Mc Graw-Hill, 2007 Chapter 1: (Part 2): The Foundations: Logic and Proofs.
First-Order Logic Chapter 8.
First-Order Logic (FOL) aka. predicate calculus. First-Order Logic (FOL) Syntax User defines these primitives: –Constant symbols (i.e., the "individuals"
Elementary Number Theory and Methods of Proof
RMIT University; Taylor's College This is a story about four people named Everybody, Somebody, Anybody and Nobody. There was an important job to be done.
22C:19 Discrete Structures Logic and Proof Spring 2014 Sukumar Ghosh.
Discrete Structures Chapter 1 Part B Fundamentals of Logic Nurul Amelina Nasharuddin Multimedia Department 1.
Discrete Mathematics Lecture 2 Alexander Bukharovich New York University.
First Order Logic (chapter 2 of the book) Lecture 3: Sep 14.
Formal Logic Mathematical Structures for Computer Science Chapter 1 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesFormal Logic.
Harper Langston New York University Summer 2015
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
First Order Logic. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order.
CS 2210 (22C:019) Discrete Structures Logic and Proof Spring 2015 Sukumar Ghosh.
DISCRETE MATHEMATICS I LECTURES CHAPTER 4 Dr. Adam Anthony Spring 2011 Some material adapted from lecture notes provided by Dr. Chungsim Han and Dr. Sam.
Predicates and Quantifiers
CSci 2011 Discrete Mathematics Lecture 3 CSci 2011.
The Foundations: Logic and Proofs
CSCI 115 Chapter 2 Logic. CSCI 115 §2.1 Propositions and Logical Operations.
 Predicate: A sentence that contains a finite number of variables and becomes a statement when values are substituted for the variables. ◦ Domain: the.
Week 3 - Monday.  What did we talk about last time?  Predicate logic  Multiple quantifiers  Negating multiple quantifiers  Arguments with quantified.
Review I Rosen , 3.1 Know your definitions!
Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers.
(CSC 102) Lecture 7 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Chap. 2 Fundamentals of Logic. Proposition Proposition (or statement): an declarative sentence that is either true or false, but not both. e.g. –Margret.
Proofs1 Elementary Discrete Mathematics Jim Skon.
Chapter 2 The Logic of Quantified Statements. Section 2.4 Arguments with Quantified Statements.
Fall 2002CMSC Discrete Structures1 Let’s get started with... Logic !
1 Sections 1.5 & 3.1 Methods of Proof / Proof Strategy.
1 Math/CSE 1019C: Discrete Mathematics for Computer Science Fall 2011 Suprakash Datta Office: CSEB 3043 Phone: ext
Arguments with Quantified Statements M Universal Instantiation If some property is true for everything in a domain, then it is true of any particular.
First Order Logic Lecture 2: Sep 9. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Fundamentals of Logic 1. What is a valid argument or proof? 2. Study system of logic 3. In proving theorems or solving problems, creativity and insight.
January 30, 2002Applied Discrete Mathematics Week 1: Logic and Sets 1 Let’s Talk About Logic Logic is a system based on propositions.Logic is a system.
Hazırlayan DISCRETE COMPUTATIONAL STRUCTURES Propositional Logic PROF. DR. YUSUF OYSAL.
(CSC 102) Lecture 8 Discrete Structures. Previous Lectures Summary Predicates Set Notation Universal and Existential Statement Translating between formal.
Predicates and Quantified Statements
1 Introduction to Abstract Mathematics Chapter 2: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 2.3.
4.1 Proofs and Counterexamples. Even Odd Numbers Find a property that describes each of the following sets E={…, -4, -2, 0, 2, 4, 6, …} O={…, -3, -1,
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.
1 Introduction to Abstract Mathematics Predicate Logic Instructor: Hayk Melikya Purpose of Section: To introduce predicate logic (or.
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
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.
First Order Logic Lecture 3: Sep 13 (chapter 2 of the book)
1 CMSC 250 Chapter 2, Predicate Logic. 2 CMSC 250 Definitions l Subject / predicate John / went to the store. The sky / is blue. l Propositional logic-
Chapter 2 Fundamentals of Logic 1. What is a valid argument or proof?
22C:19 Discrete Structures Logic and Proof Fall 2014 Sukumar Ghosh.
CS104:Discrete Structures Chapter 2: Proof Techniques.
Week 4 - Friday.  What did we talk about last time?  Floor and ceiling  Proof by contradiction.
1 Chapter 2.1 Chapter 2.2 Chapter 2.3 Chapter 2.4 All images are copyrighted to their respective copyright holders and reproduced here for academic purposes.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
1 Introduction to Abstract Mathematics Chapter 3: The Logic of Quantified Statements. Predicate Calculus Instructor: Hayk Melikya 3.1.
Section 1.4. Propositional Functions Propositional functions become propositions (and have truth values) when their variables are each replaced by a value.
Discrete Mathematical Structures: Theory and Applications 1 Logic: Learning Objectives  Learn about statements (propositions)  Learn how to use logical.
Week 2 - Friday.  What did we talk about last time?  Predicate logic  Negation  Multiple quantifiers.
Harper Langston New York University Summer 2017
CS 2210:0001 Discrete Structures Logic and Proof
3. The Logic of Quantified Statements Summary
Chapter 3 The Logic of Quantified Statements
CMSC Discrete Structures
Chapter 1 The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
First Order Logic Rosen Lecture 3: Sept 11, 12.
Predicates and Quantifiers
Discrete Mathematics Lecture 4 Logic of Quantified Statements
CS201: Data Structures and Discrete Mathematics I
Presentation transcript:

DISCRETE MATHEMATICS I LECTURES CHAPTER 3 Dr. Adam P. Anthony Spring 2011 Some material adapted from lecture notes provided by Dr. Chungsim Han and Dr. Sam Lomonaco

This Week  Introduction to First Order Logic (Sections 3.1—3.3)  Predicates and Logic Functions  Quantifiers  Basic Logic Using Quantifiers  Implication, negation rules for quantifiers

Propositional Functions  Propositional function (open sentence):  Statement involving one or more variables,  e.g.: P(x) = x-3 > 5.  Let us call this propositional function P(x), where P is the predicate and x is the variable. What is the truth value of P(2) ? false What is the truth value of P(8) ? What is the truth value of P(9) ? false true

Propositional Functions  Let us consider the propositional function Q(x, y, z) defined as:  Q(x, y, z) = x + y = z.  Here, Q is the predicate and x, y, and z are the variables. What is the truth value of Q(2, 3, 5) ? true What is the truth value of Q(0, 1, 2) ? What is the truth value of Q(9, -9, 0) ? false true

Function Domains  Propositional functions are just like mathematical functions, they must have a domain:  Real numbers  Integers  People Students Professors Stock Traders?  Domains are used to clarify the purpose of the predicate  Let x be the set of all Students. Let FT(x) = x is a full time student  Sometimes domains are extremely important, particularly with if- then statements

Universal Quantification  Let P(x) be a propositional function.  Universally quantified sentence:  For all x in the universe of discourse P(x) is true.  Using the universal quantifier  :   x P(x) “for all x P(x)” or “for every x P(x)”  (Note:  x P(x) is either true or false, so it is a proposition, not a propositional function.)

Universal Quantification  Example:  S(x): x is a B-W student.  G(x): x is a genius.  What does  x (S(x)  G(x)) mean ?  “If x is a UMBC student, then x is a genius.”  OR  “All UMBC students are geniuses.”

Existential Quantification  Existentially quantified sentence:  There exists an x in the universe of discourse for which P(x) is true.  Using the existential quantifier  :   x P(x) “There is an x such that P(x).”  “There is at least one x such that P(x).”  (Note:  x P(x) is either true or false, so it is a proposition, not a propositional function.)

Existential Quantification  Example:  P(x): x is a B-W professor.  G(x): x is a genius.  What does  x (P(x)  G(x)) mean ?  “There is an x such that x is a UMBC professor and x is a genius.” OR  “At least one B-W professor is a genius.”

Quantifiers, Predicates and Domains  A properly defined quantified statement will have predicates and domains clearly specified  How do we say there is a value for x that makes (5x =3) true? Let x be the set of all real numbers R Let P(x) = (5x = 3)  x P(x)  Sometimes, this is more trouble than it’s worth to be this clear so we’ll use shorthand:  x in real numbers such that 5x = 3 Or, even shorter:  x in R, 5x = 3  Finally, if predicates are used (particularly with implication) but no quantifier is given, then assume  is used: P(x) → Q(x) ≡ ∀ x P(x) → Q(x)

Exercise  Re-write each statement using  and  (sometimes both!) as appropriate: a) There Exists a negative real x such that x 2 =8 a) For every nonzero real a, there is a real b such that ab = 1 a) All even integers are positive a) Some integers are prime a) If n 2 =4 then n = 2

Exercise  Determine the truth values of the following statements: a) For all real numbers x, x 2 ≥ 0 a) For all real numbers x, x 2 > 0 a) There is an integer n such that n 2 = 4 a) There is an integer n such that n 2 = 3 b) For all integers x, If x = 2 then x 2 = 4 a) If x 2 = 4 then x = 2

Truth Values of Quantified Statements  Take the statement:  ∀ vertebrates a, Bird(a) → Fly(a)  Is it True?  Disproof by Counter-example  Take the statement:  ∃ species s, Pig(s) ∧ Fly(s)  Is it True? How do we disprove this one?  Disproof by exhaustive search Picking domains carefully here can make search easier In Reality, ∀ is a generalized version of AND ( ∧ ) and ∃ is a generalized version of OR ∨ : To say ∀ x P(x) means we are saying P(x) is true for everything in the world at the same time ∀ x P(x) ≡ P(x 1 ) ∧ P(x 2 ) ∧ … ∧ P(x n ) To say that ∃ x P(x) means we are saying that P(x) is true for at least one (or more or ALL) thing in the world ∃ x P(x) ≡ P(x 1 ) ∨ P(x 2 ) ∨ … ∨ P(x n ) In Reality, ∀ is a generalized version of AND ( ∧ ) and ∃ is a generalized version of OR ∨ : To say ∀ x P(x) means we are saying P(x) is true for everything in the world at the same time ∀ x P(x) ≡ P(x 1 ) ∧ P(x 2 ) ∧ … ∧ P(x n ) To say that ∃ x P(x) means we are saying that P(x) is true for at least one (or more or ALL) thing in the world ∃ x P(x) ≡ P(x 1 ) ∨ P(x 2 ) ∨ … ∨ P(x n )

Generalized DeMorgan’s  DeMorgan’s law can apply to longer expressions as long as the connective used is the same throughout:  ¬(p ∧ q ∧ r ∧ z) ≡ ¬p ∨ ¬q ∨ ¬r ∨ ¬z  Repeatedly apply associative laws to see how this works  So if ∀ and ∃ are just short-hand for ∧ and ∨ then what happens if we negate them?

Negating Quantified Statements  ∀ x P(x) ≡ P(x 1 ) ∧ P(x 2 ) ∧ … ∧ P(x n )  ∃ x P(x) ≡ P(x 1 ) ∨ P(x 2 ) ∨ … ∨ P(x n )  ¬( ∀ x P(x)) ≡ ¬(P(x 1 ) ∧ P(x 2 ) ∧ … ∧ P(x n )) ≡ ¬P(x 1 ) ∨ ¬P(x 2 ) ∨ … ∨ ¬P(x n ) ≡ ∃ x ¬P(x)  ¬( ∃ x P(x)) ≡ ¬(P(x 1 ) ∨ P(x 2 ) ∨ … ∨ P(x n )) ≡ ¬P(x 1 ) ∧ ¬P(x 2 ) ∧ … ∧ ¬P(x n ) ≡ ∀ x ¬P(x)

Tying It All Together  Things seem strange now…logic functions…predicates…quantifiers…  Everything we learned before today is still applicable:  Theorem (laws for simplification)  Implication elimination/negation  Converse/contrapositive/inverse  Any other equivalences/tautologies/contradictions  Truth tables can be used, but less frequently at this point

Exercise  Write negations for the following statements: a) For all numbers x, x 2 > 0 b) There is an integer n such that n 2 = 3 c) All even integers are positive d) Some integers are prime

Exercise cont. a) For any real x, if x ≥ 0, then x 2 ≥x b) For any integer n, if n 2 =n, then n = c) Some dogs go to hell d) EVERYBODY fails MTH 161!

Exercise  Rewrite the following using ∀ and ∃, then determine the truth value of each statement (hint: negating the statement can help—HOW?): a) All even integers are positive b) Some integers are prime c) There is a positive real x such that x 2 ≥ x 3 d) For any real x, if x ≥ 1, then x 2 ≥ x

2.1.4 continued a) For any integer n, if n 2 = n, then n = 0 b) For any real x, if x 2 = -1, then x = -1 c) If n 2 = 4, then n = 2

Major Pitfalls with Conditionals  Remember how we interpret implication  If you can’t prove me wrong, then I’m right  For what things in the world is student(x) → smart(x) true?  Smart students  Anybody who is not a student (vacuously true case)  When is ∀ people x, student(x) → smart(x) true? When is it false?  When is ∃ person x, student(x) → smart(x) true? When is it false?  If we meant to say, ‘there exists a student who is smart’ how do we fix this?

Common Uses of Quantifiers  Universal quantifiers are often used with “implies” to form “rules”: (  x) student(x)  smart(x) means “All students are smart”  Universal quantification is rarely used to make blanket statements about every individual in the world: (  x)student(x)  smart(x) means “Everyone in the world is a student and is smart”  Existential quantifiers are usually used with “and” to specify a list of properties about an individual: (  x) student(x)  smart(x) means “There is a student who is smart”

Using Multiple Variables, Quantifiers  We already saw a multivariable predicate: Q(x, y, z) = x + y = z.  We can quantify this as (for example):  ∃ real x ∃ real y ∃ real z, such that Q(x,y,z)  Read this as: there exist real number values x, y, and z such that the sum of x and y is z  We can also mix-and-match quantifiers, but it’s trickier and in English it can be confusing:  ‘There is a person supervising every detail of the production process’  Work out on the board

Understanding Mixed Quantifiers  Here’s how you could ‘determine’ the truth of the following:  ∀ x in D, ∃ y in E such that P(x,y) Have a friend pick anything in D, then you have to find something in E that makes P(x,y) true If you ever fail, then the statement is false (counterexample).  ∃ x in D such that ∀ y in E, P(x,y) You need to pick a ‘trump card’: Pick one item from D such that no matter what someone picks out of E, P(x,y) will be true Your friend should always fail to prove you wrong

Exercise  Express the following using ∀ and ∃, then evaluate the truth of the expression a) For any real x, there is a real y such that x + y = 0 b) There is a real x such that for any real y, x ≤ y c) For any real x, there is a real y such that y < x

Less Mathematical Practice (2.2.2) Every gardener likes the sun.  x gardener(x)  likes(x,Sun) You can fool some of the people all of the time.  x  t person(x)  time(t)  can-fool(x,t) You can fool all of the people some of the time.  x  t (person(x)  time(t)  can-fool(x,t))  x (person(x)   t (time(t)  can-fool(x,t)) All purple mushrooms are poisonous.  x (mushroom(x)  purple(x))  poisonous(x) No purple mushroom is poisonous.  x purple(x)  mushroom(x)  poisonous(x)  x (mushroom(x)  purple(x))   poisonous(x)

Logic to English Translation (2.2.3) a)  x person(x)  male(x) v female(x) b)  x male(x) ^  person(x) c)  x boy(x)  male(x) ^ young(x)

Negating Mixed Quantifiers  Easy: just apply the negation rule we learned earlier for quantifiers, moving the negation in bit- by-bit:  ¬( ∀ x in D, ∃ y in E such that P(x,y)) ≡ ∃ x in D, ¬(E y in E such that P(x,y)) ≡ ∃ x in D, ∀ y in E such that ¬P(x,y)  Works same for ∃ x in D such that ∀ y in E, P(x,y)  Work out on board!

Exercise  Negate the following until all negation signs are touching a predicate: a) ∀ x ∀ y, P(x,y) b) ∀ x ∃ y, (P(x) ∧ Z(x,y)) c) ∃ x ∀ y, (P(x) → R(y))

Order Matters (half the time)!  If all your quantifiers are the same, you can put them in any order and the meaning remains:  ∀ reals x, ∀ reals y, x + y = y + x ≡ ∀ reals y, ∀ reals x, x + y = y + x  Similar for ∃  You have to be VERY careful about the order of mixed quantifiers:  What is the difference between: ∀ people x, ∃ a person y such that loves(x,y) ∃ person x such that ∀ people y, loves(x,y)

Valid Arguments Using Quantifiers  Quantifiers help avoid having to name everything in the domain  But what if we reach a point where we are looking at a particular item?  What can we conclude about that item, if all we have a quantified statements?

Universal Instantiation  Rule of Universal Instantiation:  If some property is true of EVERYTHING in a domain, then it is true of any PARTICULAR thing in that domain   x in D, P(x) is TRUE for all things in the domain D  Now, observe an item a from the domain D:  Can we conclude anything?  P(a) has to be true

Universal Modus Ponens   x in D, P(x)  Q(x) P(a) is true for a particular a in D Therefore, Q(a) is true  Universal instantiation makes this work. How?

Universal Modus Tollens   x in D, P(x)  Q(x)  Q(a) for some particular a in D Therefore,  P(a)  Same Reasoning about Universal Instantiation here, as well!

Universal Modus Ponens or Universal Modus Tollens? a) All good cars are expensive A smarty is not expensive Therefore, a smarty is not a good car b) Any sum of two rational numbers is rational The numbers a and b are rational Therefore, a + b is rational

Fill In The Blanks (Modus Ponens or Modus Tollens)  If n is even, then n = 2k for some integer k (4x + 2) is even Therefore, _________________  If m is odd, then m = 2k + 1 for some integer k r  2i + 1 for any integer I Therefore, __________________  n is even if and only if n = 2k for some integer k (m + 1) 2 = 2l and l is an integer Therefore, __________________

Other Quantified Arguments  All of the arguments we looked at in CH 2 have a quantified version of one form or another  Universal Transitivity:   x P(x)  Q(x)  x Q(x)  R(x)  x P(x)  R(x)  Invalid arguments can be quantified as well, so be careful!  Don’t forget about Converse, Inverse error

Diagrams For Analyzing Arguments  All good cars are expensive A smarty is not an expensive car Therefore, a smarty is not a good car Expensive Cars Smarty Expensive Cars Good Cars

Diagram Example 1  All CS Majors are smart Pam is not a CS Major Therefore, Pam is not smart

Diagram Example 2  If a product of two numbers is 0, then at least one of the numbers is 0. x  0 and y  0 Therefore, xy  0

Diagram Example 3  No college cafeteria food is good No good food is wasted Therefore, No college cafeteria food is wasted

Diagram Example 4  All teachers occasionally make mistakes No gods ever make mistakes Therefore, No teachers are gods