Predicates and Quantifiers. Predicates (aka propositional functions) Propositions (things that are true or false) that contain variables P(-2) is false.

Slides:



Advertisements
Similar presentations
Nested Quantifiers Section 1.4.
Advertisements

Nested Quantifiers Needed to express statements with multiple variables Example 1: “x+y = y+x for all real numbers”  x  y(x+y = y+x) where the domains.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations.
Section 1.3. More Logical Equivalences Constructing New Logical Equivalences We can show that two expressions are logically equivalent by developing.
Chapter 1: The Foundations: Logic and Proofs 1.1 Propositional Logic 1.2 Propositional Equivalences 1.3 Predicates and Quantifiers 1.4 Nested Quantifiers.
Predicates and Quantifiers
Predicate Calculus Formal Methods in Verification of Computer Systems Jeremy Johnson.
1 Predicate Logic Rosen 6 th ed., § Predicate Logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
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.
Quantifiers and Negation Predicates. Predicate Will define function. The domain of a function is the set from which possible values may be chosen for.
Lecture # 21 Predicates & Quantifiers
Discrete Math 6A Max Welling. Recap 1. Proposition: statement that is true or false. 2. Logical operators: NOT, AND, OR, XOR, ,  3. Compound proposition:
1 Predicates and Quantifiers CS 202, Spring 2007 Epp, Sections 2.1 and 2.2 Aaron Bloomfield.
Predicates and Quantifiers
Predicates & Quantifiers Goal: Introduce predicate logic, including existential & universal quantification Introduce translation between English sentences.
Predicates and Quantifiers
Chapter 1: The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS 103 Discrete Structures Lecture 05
Predicates and Quantified Statements M , 3.2.
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.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
Lecture 1.2: Equivalences, and Predicate Logic* CS 250, Discrete Structures, Fall 2011 Nitesh Saxena *Adopted from previous lectures by Cinda Heeren, Zeph.
CS203 Discrete Mathematical Structures Logic (2).
Math 51/COEN 19 Day 3, 1.4 Quantifiers 1. 3 Predicates A lot like functions that return booleans Let P(x) denote x
Discrete Mathematics. Predicates - the universal quantifier 11/28/2015 Suppose P(x) is a predicate on some universe of discourse. Ex. B(x) = “x is carrying.
Predicates and Quantified Statements
Nested Quantifiers Section 1.5.
1 Sections 1.3 and 1.4 Predicates & Quantifiers. 2 Propositional Functions In a mathematical assertion, such as x < 3, there are two parts: –the subject,
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:
Lecture 7 – Jan 28, Chapter 2 The Logic of Quantified Statements.
Lecture 1.3: Predicate Logic CS 250, Discrete Structures, Fall 2012 Nitesh Saxena Adopted from previous lectures by Cinda Heeren.
Discrete Mathematics CS 2610 August 22, Agenda Last class Propositional logic Logical equivalences This week Predicate logic & rules of inference.
Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.
CS 285- Discrete Mathematics Lecture 4. Section 1.3 Predicate logic Predicate logic is an extension of propositional logic that permits concisely reasoning.
Predicates and Quantifiers
Copyright © Peter Cappello 2011 Predicates & Quantifiers.
321 Section, Week 2 Natalie Linnell. Extra Credit problem.
PREDICATES AND QUANTIFIERS COSC-1321 Discrete Structures 1.
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.
Section 1.5. Section Summary Nested Quantifiers Order of Quantifiers Translating from Nested Quantifiers into English Translating Mathematical Statements.
Discrete Mathematical الرياضيات المتقطعة. Example 12 June OR Q(x,y): x+y=x-y a) Q(1,1): 2=0 False b) Q(2,0): 2+0=2-0 True c) Q(1,y): 1+y=1-y False(take.
Chapter 1, Part II: Predicate Logic With Question/Answer Animations 1.
رياضيات متقطعة لعلوم الحاسب MATH 226. Chapter 1 Predicates and Quantifiers 1.4.
The Foundations: Logic and Proofs
Predicates & Quantifiers
The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS203 Discrete Mathematical Structures
Chapter 1 The Foundations: Logic and Proofs
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
CS 220: Discrete Structures and their Applications
Mathematics for Computer Science MIT 6.042J/18.062J
Nested Quantifiers Nested quantifiers are often necessary to express the meaning of sentences in English as well as important concepts in computer science.
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
Lecture 1.3: Predicate Logic
Discrete Mathematics Lecture 4 & 5: Predicate and Quantifier
George Boole English Mathematician
Predicates and Quantifiers
The Foundations: Logic and Proofs
CS201: Data Structures and Discrete Mathematics I
The Foundations: Logic and Proofs
Lecture 1.3: Predicate Logic
Presentation transcript:

Predicates and Quantifiers

Predicates (aka propositional functions) Propositions (things that are true or false) that contain variables P(-2) is false P(42) is true P(0) is false … predicates become propositions (true or false) if variables are bound with values from domain of discourse U variables are quantified (more in a minute) The above predicate, we need to state what values x can take, i.e. what is its domain of discourse? Let U = Z, the set of integers {…,-2,-1,0,1,2,…}

Predicates (aka propositional functions) Let U = Z, the set of integers {…,-2,-1,0,1,2,…} Not a proposition. Variable y is unbound

Predicates (aka propositional functions) Let U = Z, the set of integers {…,-2,-1,0,1,2,…} Put another way: “Let the domain of discourse be the set of all integers” What is: R(2,-1,3) ? R(x,3,z) ? R(3,6,9) ?

What is a predicate/propositional function? A boolean function, i.e. delivers as a result true or false isOdd(x), isEven(x), isMarried(x), isWoman(x) … isGreaterThan(x,y) sumsToOneHundred(a,b,c,d,e) In Claire (a nice language) [P(x:integer) : boolean -> x > 3] In Claire (a nice language) [R(x:integer,y:integer,z:integer) : boolean -> x + y = z] isGoingMad(x) hasALife(x) oddP(x)

Some Examples [P(x:integer) : boolean -> x > 3] [Q(x:integer,y:integer) : boolean -> x + y = 0] [R(x:integer,y:integer,z:integer) : boolean -> x + y = z] For P, Q, and R universe of discourse (domain) is set of integers

Some Examples

Quantifiers (universal) The universal quantifier asserts that a property holds for all values of a variable in a given domain of discourse “for all” “for all x P(x) holds” But what’s the domain of discourse? We must state this! Could also do this For all integers, P(x) holds

Quantifiers (universal) Same thing! AND

Quantifiers (existential) The existential quantifier asserts that a property holds for some values of a variable in a given domain of discourse “there exists” “there exists a value of x such that P(x) holds” But what’s the domain of discourse? We must state this! Could also do this There is an integer value of x such that P(x) holds

Quantifiers (existential) Same thing! OR

Quantifiers Let the universe of discourse U be the set of real numbers True or false? So, we can nest quantifiers: example overleaf

Quantifiers Let the universe of discourse U be the set of integers Nesting: what do these mean?

Quantifiers Nesting: what do these mean?

Quantifiers Nesting: what do these mean?

Quantifiers Nesting: what do these mean?

Quantifiers Nesting: what do these mean?

Quantifiers and negation

Some Examples public static boolean P(int x){return x > 3;} public static boolean Q(int x, int y){return x + y == 0;} public static boolean R(int x, int y, int z){return x + y = z;} For P, Q, R universe of discourse (domain) is set of integers There is no single value of y for this This is false Yip! Y will equal x! NOTE: sensitivity of order of quantification

Forgive me for misusing java conventions

That’s okay Bad Karma! Beware!

NOTE!

Examples P(x): x is a lion Q(x): x is fierce R(x): x drinks coffee Universe of discourse all creatures, great and small All lions are fierce Some lions don’t drink coffee Some fierce creatures do not drink coffee

Even more examples Everyone has a best friend B(x,y): x’s best friend is y Universe of discourse people Yikes!

When will these examples stop?! If somebody is a female and she’s a parent then she is someone’s mother F(x): x is a female P(x): x is a parent M(x,y): x is the mother of y Universe of discourse people

Can I think of this stuff in some concrete way? Okay := true for x in U while okay do for y in U while okay do okay := P(x,y) okay

Can I think of this stuff in some concrete way? Okay := true for x in U while okay do begin okay := false for y in U while not(okay) do okay := P(x,y) end okay

Can I think of this stuff in some concrete way? Okay := false for x in U while not(okay) do begin okay := true for y in U while okay do okay := P(x,y) end okay

Can I think of this stuff in some concrete way? Okay := false for x in U while not(okay) do for y in U while not(okay) do okay := P(x,y) okay

Non-trivial example: arc-consistency “For any pair of variables (i,j), for all values in the domain of variable i there will exist at least one value in the domain of variable j such that we can instantiate variable i to the value x and variable j to the value y and it will be consistent” Is this an arc-consistent state?

3 45 B8CD EA An min ultrametric tree and its min ultrametric matrix As we go down a branch values on interior nodes increase Matrix value is the value of the most recent common ancestor of two leaf nodes Matrix is symmetric

ultrametric 3 45 B8CD EA