Math.3336: Discrete Mathematics. Nested Quantifiers

Similar documents
Announcements. CS311H: Discrete Mathematics. Introduction to First-Order Logic. A Motivating Example. Why First-Order Logic?

Math.3336: Discrete Mathematics. Propositional Equivalences

Math.3336: Discrete Mathematics. Nested Quantifiers/Rules of Inference

Math.3336: Discrete Mathematics. Applications of Propositional Logic

Math.3336: Discrete Mathematics. Chapter 9 Relations

Math.3336: Discrete Mathematics. Proof Methods and Strategy

Math.3336: Discrete Mathematics. Mathematical Induction

Mat 243 Exam 1 Review

Math.3336: Discrete Mathematics. Cardinality of Sets

Math.3336: Discrete Mathematics. Combinatorics: Basics of Counting

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

Introduction to Sets and Logic (MATH 1190)

Propositional Logic Not Enough

Math.3336: Discrete Mathematics. Advanced Counting Techniques

ICS141: Discrete Mathematics for Computer Science I

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Section Summary. Section 1.5 9/9/2014

Predicate Logic. CSE 191, Class Note 02: Predicate Logic Computer Sci & Eng Dept SUNY Buffalo

2/2/2018. CS 103 Discrete Structures. Chapter 1. Propositional Logic. Chapter 1.1. Propositional Logic

Predicate Calculus lecture 1

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

CS 220: Discrete Structures and their Applications. Predicate Logic Section in zybooks

Discrete Structures for Computer Science

Math Fundamentals of Higher Math

Lecture 4. Predicate logic

Discrete Mathematics and Its Applications

MAT2345 Discrete Math

Math.3336: Discrete Mathematics. Primes and Greatest Common Divisors

First order Logic ( Predicate Logic) and Methods of Proof

Proposi'onal Logic Not Enough

Today s Lecture. ICS 6B Boolean Algebra & Logic. Predicates. Chapter 1: Section 1.3. Propositions. For Example. Socrates is Mortal

Quantifiers Here is a (true) statement about real numbers: Every real number is either rational or irrational.

! Predicates! Variables! Quantifiers. ! Universal Quantifier! Existential Quantifier. ! Negating Quantifiers. ! De Morgan s Laws for Quantifiers

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

Mathematical Logic Part Three

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Course Staff. Textbook

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Announcements CompSci 102 Discrete Math for Computer Science

Predicate Logic & Quantification

THE LOGIC OF QUANTIFIED STATEMENTS. Predicates and Quantified Statements I. Predicates and Quantified Statements I CHAPTER 3 SECTION 3.

Predicate Logic. Example. Statements in Predicate Logic. Some statements cannot be expressed in propositional logic, such as: Predicate Logic

Recall that the expression x > 3 is not a proposition. Why?

Math 3336: Discrete Mathematics Practice Problems for Exam I

Section Summary. Predicates Variables Quantifiers. Negating Quantifiers. Translating English to Logic Logic Programming (optional)

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

3/29/2017. Logic. Propositions and logical operations. Main concepts: propositions truth values propositional variables logical operations

Propositional and Predicate Logic

Lecture 3 : Predicates and Sets DRAFT

Logic and Proof. Aiichiro Nakano

Section 2.1: Introduction to the Logic of Quantified Statements

Propositional and Predicate Logic

Thinking of Nested Quantification

Review: Potential stumbling blocks

Mathematical Logic Part Two

DISCRETE MATHEMATICS BA202

THE LOGIC OF QUANTIFIED STATEMENTS

Discrete Structures Lecture 5

Predicates and Quantifiers. Nested Quantifiers Discrete Mathematic. Chapter 1: Logic and Proof

Mathematical Logic Part Three

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

Predicate Calculus - Syntax

Announcement. Homework 1

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Introduction to Decision Sciences Lecture 2

1.3 Predicates and Quantifiers

Chapter 2: The Logic of Quantified Statements. January 22, 2010

2/18/14. What is logic? Proposi0onal Logic. Logic? Propositional Logic, Truth Tables, and Predicate Logic (Rosen, Sections 1.1, 1.2, 1.

Propositional Functions. Quantifiers. Assignment of values. Existential Quantification of P(x) Universal Quantification of P(x)

For all For every For each For any There exists at least one There exists There is Some

Discrete Structures Lecture Predicates and Quantifiers

Transparencies to accompany Rosen, Discrete Mathematics and Its Applications Section 1.3. Section 1.3 Predicates and Quantifiers

CS100: DISCRETE STRUCTURES. Lecture 5: Logic (Ch1)

Predicate Logic: Sematics Part 1

Predicates, Quantifiers and Nested Quantifiers

Discrete Mathematical Structures. Chapter 1 The Foundation: Logic

EECS 1028 M: Discrete Mathematics for Engineers

CS Module 1. Ben Harsha Apr 12, 2017

Computer Science 280 Spring 2002 Homework 2 Solutions by Omar Nayeem

PREDICATE LOGIC. Schaum's outline chapter 4 Rosen chapter 1. September 11, ioc.pdf

CSCI-2200 FOUNDATIONS OF COMPUTER SCIENCE

III. Elementary Logic

CSI30. Chapter 1. The Foundations: Logic and Proofs Nested Quantifiers

Logic. Logic is a discipline that studies the principles and methods used in correct reasoning. It includes:

Predicate Logic Thursday, January 17, 2013 Chittu Tripathy Lecture 04

Mathematical Logic Part Three

Intro to Logic and Proofs

THE LOGIC OF QUANTIFIED STATEMENTS

Mathematical Logic Part Three

Predicate Logic. Andreas Klappenecker

MATH 22 INFERENCE & QUANTIFICATION. Lecture F: 9/18/2003

Solutions to Exercises (Sections )

THE LOGIC OF QUANTIFIED STATEMENTS

Why Learning Logic? Logic. Propositional Logic. Compound Propositions

Tools for reasoning: Logic. Ch. 1: Introduction to Propositional Logic Truth values, truth tables Boolean logic: Implications:

Logic. Stephen G. Ware CSCI 4525 / 5525

Lecture 3. Logic Predicates and Quantified Statements Statements with Multiple Quantifiers. Introduction to Proofs. Reading (Epp s textbook)

Rosen, Discrete Mathematics and Its Applications, 6th edition Extra Examples

Today we will probably finish Course Notes 2.3: Predicates and Quantifiers.

PROBLEM SET 3: PROOF TECHNIQUES

Transcription:

Math.3336: Discrete Mathematics Nested Quantifiers Instructor: Dr. Blerina Xhabli Department of Mathematics, University of Houston https://www.math.uh.edu/ blerina Email: blerina@math.uh.edu Fall 2018 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 1/22

Assignments to work on Homework #2 due Wednesday, 9/5, 11:59pm No credit unless turned in by 11:59pm on due date Late submissions not allowed, but lowest homework score dropped when calculating grades Homework will be submitted online in your CASA accounts. You can find the instructions on how to upload your homework in our class webpage. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 2/22

Chapter 1 - The Foundations: Logic and Proofs Chapter 1 - Overview Propositional Logic The Language of Propositions Section 1.1 Applications* Section 1.2 Logical Equivalences Section 1.3 Predicate Logic The Language of Quantifiers Section 1.4 Logical Equivalences Section 1.4 Nested Quantifiers Section 1.5 Proofs Rules of Inference Section 1.6 Proof Methods Section 1.7 Proof Strategy Section 1.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 3/22

Chapter 1 - The Foundations: Logic and Proofs Chapter 1 - Overview Propositional Logic The Language of Propositions Section 1.1 Applications* Section 1.2 Logical Equivalences Section 1.3 Predicate Logic The Language of Quantifiers Section 1.4 Logical Equivalences Section 1.4 Nested Quantifiers Section 1.5 Proofs Rules of Inference Section 1.6 Proof Methods Section 1.7 Proof Strategy Section 1.8 Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 4/22

Part II Predicate Logic Predicate Logic Summary The Language of Quantifiers Logical Equivalences Nested Quantifiers Translation from Predicate Logic to English Translation from English to Predicate Logic Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 5/22

Section 1.4 Predicate Logic (continued) Predicate Logic uses these new features: Variables: x, y, z Predicates: P(x), M (x) Quantifiers: universal, existential Propositional functions are a generalization of propositions. They contain variables and a predicate, eg. P(x). Variables can be replaced by elements from their domain (also known as universe of discourse) Propositional functions become propositions (and have truth values) when their variables are each replaced by a value from the domain or bound by a quantifier. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 6/22

Quantified Propositions Predicate logic lets us to make statements about groups of objects. To do this, we use special quantified expressions. There are two quantifiers in predicate logic: 1 Universal quantifier ( ): refers to all objects Example: All UH CS-major graduates have to pass Math.3336 2 Existential quantifier ( ): refers to some object Example: Some UH CS-major students graduate with honor. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 7/22

Universal Quantifier/Existential Quantifier Universal quantification of P(x), x P(x), is the proposition P(x) holds for all objects x in the universe of discourse. x P(x) is true if predicate P is true for every object in the universe of discourse, and false otherwise Existential quantification of P(x), written x P(x), is There exists an element x in the domain such that P(x) is true. x P(x) is true if there is at least one element in the domain such that P(x) is true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 8/22

Quantifiers Summary Statement When True? When False? x P(x) P(x) is true for every x P(x) is false for some x x P(x) P(x) is true for some x P(x) is false for every x Consider finite universe of discourse with objects o 1,..., o n x.p(x) is true iff P(o 1 ) P(o 2 )... P(o n ) is true x.p(x) is true iff P(o 1 ) P(o 2 )... P(o n ) is true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 9/22

More Examples of Quantified Formulas Consider the domain of integers and the predicates even(x) and div4(x) which represents if x is divisible by 4 What is the truth value of the following quantified formulas? x (div4(x) even(x)) true x (even(x) div4(x)) false x ( div4(x) even(x)) true x ( div4(x) even(x)) true x ( div4(x) even(x)) false Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 10/22

Precedence of Quantifiers The quantifiers and have higher precedence than all the other logical operators. For example, x P(x) Q(x) means ( x P(x)) Q(x). x (P(x) Q(x)) means something different. Unfortunately, often people write x P(x) Q(x) when they mean x (P(x) Q(x)). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 11/22

Translating English Into Quantified Formulas Assume freshman(x) means x is a freshman and Math3336(x) x is taking Math3336. Then express the following in predicate logic notation: Someone in Math3336 is a freshman x (freshman(x) Math3336(x)) No one in Math3336 is a freshman ( x (freshman(x) Math3336(x)) Everyone taking Math3336 are freshman ( x (Math3336(x) freshman(x)) Every freshman is taking Math3336 ( x (freshman(x) Math3336(x)) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 12/22

Translation with Quantifiers Let A(x) and S(x) be two predicates. Universal quantifiers usually go with implications All A(x) is S(x): No A(x) is S(x): x (A(x) S(x)) x (A(x) S(x)) Existential quantifiers usually go with conjunctions Some A(x) is S(x): x (A(x) S(x)) Some A(x) is not S(x): x (A(x) S(x)) Observation: Universal quantifiers usually go with implications, and existential quantifiers go with conjunctions Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 13/22

DeMorgan s Laws for Quantifiers Learned about De Morgan s laws for propositional logic: (p q) p q (p q) p q DeMorgan s laws extend to predicate logic, e.g., (even(x) div4(x)) ( even(x) div4(x)) Two new De Morgan s laws for quantifiers: x P(x) x P(x) x P(x) x P(x) When you push negation in, flips to and vice versa Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 14/22

Using DeMorgan s Laws Expressed Noone in Math3336 is a freshman as x (Math3336(x) freshman(x)) Let s apply DeMorgan s law to this formula: x ( Math3336(x) freshman(x)) Using the fact that p q is equivalent to p q, we can write this formula as: x (Math3336(x) freshman(x)) Therefore, these two formulas are equivalent! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 15/22

Section 1.5 Nested Quantifiers Sometimes, more than one quantifier may be necessary to capture the meaning of a statement in the predicate logic. Example: Every real number has an additive inverse. Translation: a real number is denoted x and its additive inverse y A predicate P(x, y) denotes x + y = 0 Then, we can write x y P(x, y). Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 16/22

More Nested Quantifier Examples Using the loves(x,y) predicate which represents x loves y, how can we say the following? Everyone loves someone x y loves(x, y) Someone loves everyone x y loves(x, y) There is someone who doesn t love anyone x y loves(x, y) There is someone who is not loved by anyone x y loves(y, x) Everyone loves everyone x y loves(x, y) There is someone who doesn t love herself/himself. x loves(x, x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 17/22

Summary of Nested Quantifiers Statement x y P(x, y) y x P(x, y) x y P(x, y) x y P(x, y) x y P(x, y) y x P(x, y) When True? P(x, y) is true for every pair x, y For every x, there is a y for which P(x, y) is true There is an x for which P(x, y) is true for every y There is a pair x, y for which P(x, y) is true Observe: Order of quantifiers is only important if quantifiers are of different kinds! Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 18/22

Understanding Quantifiers Which formulas are true/false? If false, give a counterexample x y (sameshape(x, y) differentcolor(x, y)) false x y (samecolor(x, y) differentshape(x, y)) true x (triangle(x) ( y (circle(y) samecolor(x, y)))) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 19/22

Understanding Quantifiers, cont. Which formulas are true/false? If false, give a counterexample x y ((triangle(x) square(y)) samecolor(x, y)) false x y sameshape(x, y) false x (circle(x) ( y ( circle(y) samecolor(x, y)))) true Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 20/22

Satisfiability, Validity in Predicate Logic The concepts of satisfiability, validity also important in Predicate Logic A predicate logic formula F is satisfiable if there exists some domain and some interpretation such that F evaluates to true Example: Prove that x P(x) Q(x) is satisfiable. D = { }, P( ) = true, Q( ) = true A predicate logic formula F is valid if, for all domains and all interpretations, F evaluates to true Prove that x P(x) Q(x) is not valid. D = { }, P( ) = true, Q( ) = false Formulas that are satisfiable, but not valid are contingent, e.g., x P(x) Q(x) Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 21/22

Equivalence Two formulas F 1 and F 2 are equivalent if F 1 F 2 is valid In propositional logic, we could prove equivalence using truth tables, but not possible in predicate logic. However, we can still use known equivalences to rewrite one formula as the other. Example: Prove that ( x (P(x) Q(x))) and x (P(x) Q(x)) are equivalent. Example: Prove that x y P(x, y) and x y P(x, y) are equivalent. Instructor: Dr. Blerina Xhabli, University of Houston Math.3336: Discrete Mathematics Nested Quantifiers 22/22