ICS141: Discrete Mathematics for Computer Science I

Similar documents
Propositional Logic Not Enough

Topic #3 Predicate Logic. Predicate Logic

ICS141: Discrete Mathematics for Computer Science I

Predicate Calculus lecture 1

Proposi'onal Logic Not Enough

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

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

Introduction to Sets and Logic (MATH 1190)

Logical Operators. Conjunction Disjunction Negation Exclusive Or Implication Biconditional

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

Predicates and Quantifiers. CS 231 Dianna Xu

Section Summary. Section 1.5 9/9/2014

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

Discrete Mathematics and Its Applications

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

University of Aberdeen, Computing Science CS2013 Predicate Logic 4 Kees van Deemter

ICS141: Discrete Mathematics for Computer Science I

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

Bits and Bit Operations. Today s topics

Logic and Propositional Calculus

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

Discrete Structures Lecture Predicates and Quantifiers

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

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

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

Discrete Structures for Computer Science

Packet #2: Set Theory & Predicate Calculus. Applied Discrete Mathematics

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

Predicate Logic & Quantification

1.3 Predicates and Quantifiers

Nested Quantifiers. Predicates and. Quantifiers. Agenda. Limitation of Propositional Logic. Try to represent them using propositional.

Math.3336: Discrete Mathematics. Nested Quantifiers

Discrete Mathematics & Mathematical Reasoning Predicates, Quantifiers and Proof Techniques

Predicate Calculus - Syntax

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

Lecture Predicates and Quantifiers 1.5 Nested Quantifiers

Review. Propositional Logic. Propositions atomic and compound. Operators: negation, and, or, xor, implies, biconditional.

2. Use quantifiers to express the associative law for multiplication of real numbers.

Logic and Propositional Calculus

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

First order Logic ( Predicate Logic) and Methods of Proof

Announcements CompSci 102 Discrete Math for Computer Science

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

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

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

Introduction to Predicate Logic Part 1. Professor Anita Wasilewska Lecture Notes (1)

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

DISCRETE MATHEMATICS BA202

Chapter 1, Part II: Predicate Logic

MACM 101 Discrete Mathematics I. Exercises on Predicates and Quantifiers. Due: Tuesday, October 13th (at the beginning of the class)

Thinking of Nested Quantification

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

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

Predicate in English. Predicates and Quantifiers. Predicate in Logic. Propositional Functions: Prelude. Propositional Function

Conjunction: p q is true if both p, q are true, and false if at least one of p, q is false. The truth table for conjunction is as follows.

ICS141: Discrete Mathematics for Computer Science I

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

2-4: The Use of Quantifiers

Logic and Proof. Aiichiro Nakano

COMP 2600: Formal Methods for Software Engineeing

Predicates, Quantifiers and Nested Quantifiers

Lecture 4. Predicate logic

Solutions to Homework I (1.1)

Predicate Logic: Sematics Part 1

Chapter 2: The Logic of Quantified Statements

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

LING 501, Fall 2004: Quantification

cse 311: foundations of computing Fall 2015 Lecture 6: Predicate Logic, Logical Inference

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

CPSC 121: Models of Computation. Module 6: Rewriting predicate logic statements

4 Quantifiers and Quantified Arguments 4.1 Quantifiers

Mat 243 Exam 1 Review

AMTH140 Lecture 8. Symbolic Logic

Predicate Logic: Introduction and Translations

Review: Potential stumbling blocks

Philosophy 240 Symbolic Logic Russell Marcus Hamilton College Fall 2014

Lecture 3 : Predicates and Sets DRAFT

Predicate Calculus - Semantics 1/4

Rules Build Arguments Rules Building Arguments

LIN1032 Formal Foundations for Linguistics

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

Propositional and First-Order Logic

Solutions to Exercises (Sections )

Department of Computer Science & Software Engineering Comp232 Mathematics for Computer Science

Predicate Logic. Andreas Klappenecker

Formal Logic: Quantifiers, Predicates, and Validity. CS 130 Discrete Structures

Predicate Logic. Predicates. Math 173 February 9, 2010

Predicate Calculus. Formal Methods in Verification of Computer Systems Jeremy Johnson

With Question/Answer Animations. Chapter 2

1 The Foundation: Logic and Proofs

Discrete Mathematics and Probability Theory Spring 2014 Anant Sahai Note 1

Section 2.1: Introduction to the Logic of Quantified Statements

Logic and Proofs. (A brief summary)

Logical equivalences 12/8/2015. S T: Two statements S and T involving predicates and quantifiers are logically equivalent

Variable Names. Some Ques(ons about Quan(fiers (but answers are not proven just stated here!) x ( z Q(z) y P(x,y) )

ICS141: Discrete Mathematics for Computer Science I

Solutions to Exercises (Sections )

Quantifiers. P. Danziger

The Fundamentals of Logic. Foundations of Logic. Foundations of Logic. CMSC 302 Propositional Logic. In Rosen, ~98 slides, ~3 lectures

ICS141: Discrete Mathematics for Computer Science I

Transcription:

ICS141: Discrete Mathematics for Computer Science I Dept. Information & Computer Sci., Originals slides by Dr. Baek and Dr. Still, adapted by J. Stelovsky Based on slides Dr. M. P. Frank and Dr. J.L. Gross Provided by McGraw-Hill 4-1

Lecture 4 Chapter 1. The Foundations 1.3 Predicates and Quantifiers 4-2

Topic #3 Predicate Logic Previously In predicate logic, a predicate is modeled as a proposional function P( ) from subjects to propositions. P(x): x is a prime number (x: any subject) P(3): 3 is a prime number. (proposition!) Propositional functions of any number of arguments, each of which may take any grammatical role that a noun can take P(x,y,z): x gave y the grade z P(Mike,Mary,A): Mike gave Mary the grade A. 4-3

Topic #3 Predicate Logic Universe of Discourse (U.D.) The power of distinguishing subjects from predicates is that it lets you state things about many objects at once. e.g., let P(x) = x + 1 x. We can then say, For any number x, P(x) is true instead of (0 + 1 0) (1 + 1 1) (2 + 1 2)... The collection of values that a variable x can take is called x s universe of discourse or the domain of discourse (often just referred to as the domain). 4-4

Quantifier Expressions Topic #3 Predicate Logic Quantifiers provide a notation that allows us to quantify (count) how many objects in the universe of discourse satisfy the given predicate. is the FOR LL or universal quantifier. x P(x) means for all x in the domain, P(x). is the XISTS or existential quantifier. x P(x) means there exists an x in the domain (that is, 1 or more) such that P(x). 4-5

The Universal Quantifier x P(x): For all x in the domain, P(x). x P(x) is Topic #3 Predicate Logic true if P(x) is true for every x in D (D: domain of discourse) false if P(x) is false for at least one x in D For every real number x, x 2 0 TRUE For every real number x, x 2 1 0 FALSE A counterexample to the statement x P(x) is a value x in the domain D that makes P(x) false What is the truth value of x P(x) when the domain is empty? TRUE 4-6

Topic #3 Predicate Logic The Universal Quantifier If all the elements in the domain can be listed as x 1, x 2,, x n then, x P(x) is the same as the conjunction: P(x 1 ) P(x 2 ) P(x n ) Example: Let the domain of x be parking spaces at UH. Let P(x) be the statement x is full. Then the universal quantification of P(x), x P(x), is the proposition: All parking spaces at UH are full. or Every parking space at UH is full. or For each parking space at UH, that space is full. 4-7

Topic #3 Predicate Logic The Existential Quantifier x P(x): There exists an x in the domain (that is, 1 or more) such that P(x). x P(x) is true if P(x) is true for at least one x in the domain false if P(x) is false for every x in the domain What is the truth value of x P(x) when the domain is empty? FALSE If all the elements in the domain can be listed as x 1, x 2,, x n then, x P(x) is the same as the disjunction: P(x 1 ) P(x 2 ) P(x n ) 4-8

Topic #3 Predicate Logic The Existential Quantifier Example: Let the domain of x be parking spaces at UH. Let P(x) be the statement x is full. Then the existential quantification of P(x), x P(x), is the proposition: Some parking spaces at UH are full. or There is a parking space at UH that is full. or At least one parking space at UH is full. 4-9

Free and Bound Variables Topic #3 Predicate Logic An expression like P(x) is said to have a free variable x (meaning, x is undefined). A quantifier (either or ) operates on an expression having one or more free variables, and binds one or more of those variables, to produce an expression having one or more bound variables. 4-10

Example of Binding Topic #3 Predicate Logic P(x,y) has 2 free variables, x and y. x P(x,y) has 1 free variable, and one bound variable. [Which is which?] P(x), where x = 3 is another way to bind x. An expression with zero free variables is a bona-fide (actual) proposition. An expression with one or more free variables is not a proposition: e.g. x P(x,y) = Q(y) 4-11

Topic #3 Predicate Logic Quantifiers with Restricted Domains Sometimes the universe of discourse is restricted within the quantification, e.g., x 0 P(x) is shorthand for For all x that are greater than zero, P(x). = x (x 0 P(x)) x 0 P(x) is shorthand for There is an x greater than zero such that P(x). = x (x 0 P(x)) 4-12

Translating from English Express the statement Every student in this class has studied calculus using predicates and quantifiers. Let C(x) be the statement: x has studied calculus. If domain for x consists of the students in this class, then it can be translated as x C(x) or If domain for x consists of all people Let S(x) be the predicate: x is in this class Translation: x (S(x) C(x)) 4-13

Translating from English Express the statement Some students in this class has visited Mexico using predicates and quantifiers. Let M(x) be the statement: x has visited Mexico If domain for x consists of the students in this class, then it can be translated as x M(x) or If domain for x consists of all people Let S(x) be the statement: x is in this class Then, the translation is x (S(x) M(x)) 4-14

Translating from English Express the statement Every student in this class has visited either Canada or Mexico using predicates and quantifiers. Let C(x) be the statement: x has visited Canada and M(x) be the statement: x has visited Mexico If domain for x consists of the students in this class, then it can be translated as x (C(x) M(x)) 4-15

Negations of Quantifiers x P(x): Every student in the class has taken a course in calculus (P(x): x has taken a course in calculus ) Not every student in the class calculus x P(x) x P(x) Consider x P(x): There is a student in the class who has taken a course in calculus There is no student in the class who has taken a course in calculus x P(x) x P(x) 4-16

Topic #3 Predicate Logic Negations of Quantifiers Definitions of quantifiers: If the domain = {a, b, c, } x P(x) P(a) P(b) P(c) x P(x) P(a) P(b) P(c) From those, we can prove the laws: x P(x) (P(a) P(b) P(c) ) P(a) P(b) P(c) x P(x) x P(x) (P(a) P(b) P(c) ) P(a) P(b) P(c) x P(x) Which propositional equivalence law was used to prove this? 4-17

Negations of Quantifiers Theorem: Generalized De Morgan's laws for logic 1. x P(x) x P(x) 2. x P(x) x P(x) 4-18

Negations: Examples What are the negations of the statements x (x 2 x) and x (x 2 = 2)? x (x 2 x) x (x 2 = 2) Show that x(p(x) Q(x)) and x(p(x) Q(x)) are logically equivalent. x(p(x) Q(x)) x (x 2 x) x (x 2 x) x (x 2 = 2) x (x 2 2) x (P(x) Q(x)) x ( P(x) Q(x)) x (P(x) Q(x)) 4-19

Summary 4-20