SlideShare a Scribd company logo
1 of 146
1/ 33
Introduction
Propositional Functions
Slides by Christopher M. Bourke
Propositional
Functions Instructor: Berthe Y. Choueiry
Quantifiers
Logic
Programming
Transcribing
English into
Logic Fall 2007
Predicate Logic and Quantifiers
2/ 33
Further Computer Science & Engineering 235
Examples &
Exercises Introduction to Discrete Mathematics
Sections 1.3–1.4 of Rosen cse235@cse.unl.edu
Introduction
Predicate
Logic and
Quantifiers
CSE235
Consider the following statements:
x > 3, x = y + 3, x + y = z
3/ 33
Propositional Functions
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Logic
Programming
Transcribing
English into Logic
Further
Examples &
Exercises
The truth value of these statements has no meaning without
specifying the values of x,y,z.
However, we can make propositions out of such statements.
A predicate is a property that is affirmed or denied about the
subject (in logic, we say “variable” or “argument”) of a
statement.
“ x is greater than 3”
|{z} | {z }
subject predicate
4/ 33
Terminology:
affirmed =
holds = is true;
denied = does not hold = is not true.
|{z} | {z }
Propositional
subject predicate
Functions
Predicate
Logic and
Quantifiers
CSE235
Introduction
To write in predicate logic:
“ x is greater than 3”
Propositional
Functions
Quantifiers
Logic
Programming
Transcribing
English into
We introduce a (functional) symbol for the predicate, and put
the subject as an argument (to the functional symbol): P(x)
Examples:
5/ 33
Propositional Functions
LogicFather(x): unary predicate Further
Brother(x,y): binary predicate
Examples &
Exercises
Sum(x,y,z): ternary predicate
P(x,y,z,t): n-ary predicate
Examples &
Exercises
6/ 33
Propositional Functions
Predicate
Logic and
Quantifiers Definition
CSE235
A statement of the form P(x1,x2,...,xn) is the value of the Introduction
propositional function P. Here, (x1,x2,...,xn) is an n-tuple Propositional and
P is a predicate.
Functions
Propositional
Universe of
Discourse
Quantifiers
You can think of a propositional function as a function that
Examples &
Exercises
7/ 33
Propositional Functions
Functions
Evaluates to true or false.
Logic Programming
Takes one or more arguments.
Transcribing
intoExpresses a predicate involving the argument(s).
English
Logic
Becomes a proposition when values are assigned to the
Further
arguments.
Examples &
Exercises
8/ 33
Propositional Functions
Example
Predicate
Logic and
Quantifiers Example
CSE235
Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is
Introduction the truth value of Q(3,4,5)? What is the truth value of
Propositional
Functions Q(2,2,3)? How many values of (x,y,z) make the predicate
Propositional true?
Examples &
Exercises
9/ 33
Propositional Functions
Functions
Universe of
Discourse
Quantifiers
Logic
Programming
Transcribing
English into Logic
Further
Example
Predicate
Logic and
Examples &
Exercises
10/ 33
Propositional Functions
Quantifiers Example
Universe of Discourse
Examples &
Exercises
11/ 33
Propositional Functions
CSE235
Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is
Introduction the truth value of Q(3,4,5)? What is the truth value of
Propositional
Quantifiers
Logic
Programming
Transcribing
English into Logic
Further
Since 32 + 42 = 25 = 52, Q(3,4,5) is true.
Since 22 + 22 = 8 6= 32 = 9, Q(2,2,3) is false.
There are infinitely many values for (x,y,z) that make this
propositional function true—how many right triangles are
there?
Examples &
Exercises
7/ 33
Propositional Functions
Functions Q(2,2,3)? How many values of (x,y,z) make the predicate
Propositional true?
Functions
Examples &
Exercises
6/ 33
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Consider the previous example. Does it make sense to assign to
x the value “blue”?
Intuitively, the universe of discourse is the set of all things we
Examples &
Exercises
7/ 33
Quantifiers
Logic
Programming
sensibly assign to a variable in a propositional function.
Transcribing
English into Logic
Further8/ 33
Examples &
Transcribing
English into
Logic
What would be the universe of discourse for the propositional
function P(x) = “The test will be on x the 23rd” be?
Examples &
Exercises
9/ 33
Universe of Discourse
Universe of wish to talk about; that is, the set of all objects that we can
Discourse
Further
Transcribing
English into Logic
Further10/ 33
Examples &
Universe of Discourse
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Moreover, each variable in an n-tuple may have a different
universe of discourse.
Let P(r,g,b,c) = “The rgb-value of the color c is (r,g,b)”.
Examples &
Exercises
11/ 33
Quantifiers
Logic
Programming
For example, P(255,0,0,red) is true, while P(0,0,255,green) is
false.
Transcribing
English into Logic
Further12/ 33
Examples &
Multivariate Functions
Universe of
Discourse
Transcribing
English into
Logic
What are the universes of discourse for (r,g,b,c)?
Examples &
Exercises
13/ 33
Further
Transcribing
English into Logic
Further14/ 33
Examples &
Quantifiers
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
A predicate becomes a proposition when we assign it fixed
values. However, another way to make a predicate into a
proposition is to quantify it. That is, the predicate is true (or
false) for all possible values in the universe of discourse or for
Examples &
Exercises
15/ 33
Introduction
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
some value(s) in the universe of discourse.
Such quantification can be done with two quantifiers: the
universal quantifier and the existential quantifier.
Variables
Negation
Transcribing
English into Logic
Further16/ 33
Examples &
Logic
Programming
Transcribing
English into Logic
Further17/ 33
Examples &
Universal Quantifier
Definition
Predicate
Transcribing
English into Logic
Further18/ 33
Examples &
Universal Quantifier
Example I
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Definition
P (x)
P (x) x
∀xP (x)
which can be read “for all x
Examples &
Universal Quantifier
Example I
Existential Quantifier
Transcribing
English into Logic
Further20/ 33
Examples &
Universal Quantifier
Example I
Propositional Functions
Quantifiers
Universal
Quantifier
∀xP(x) ⇐⇒ P(n1) ∧ P(n2) ∧ ··· ∧ P(nk)
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
If the universe of discourse is finite, say {n1,n2,...,nk}, then the
universal quantifier is simply the conjunction of all elements:
Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe
universe of
discourse
for both P(x)
and Q(x) is all PropositionalUNL students.
Functions Express the statement “Every computer science student
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Transcribing
English into Logic
Further22/ 33
Examples &
Universal Quantifier
Example I
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
Logic
Programming
Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Express the statement “Every computer science student
Transcribing
English into Logic
Further24/ 33
Examples &
Universal Quantifier
Example I
UniversalQuantifier ∀x(Q(x) → P(x))
Existential Quantifier
Mixing
Quantifiers
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Examples &
Universal Quantifier
Example I
Binding
Variables
Negation
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
Logic
Programming
Transcribing
English into Logic
Further10 /33
Examples &
Universal Quantifier
Example I
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Express the statement “Every computer science student
Examples &
Universal Quantifier
Example I
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Existential Quantifier
Mixing
Quantifiers
Examples &
Universal Quantifier
Example II
UniversalQuantifier ∀x(Q(x) → P(x))
Transcribing
English into Logic
Further10 /33
Predicate
Logic and
Quantifiers
CSE235
Let P(x) be the predicate “x must take a discrete
mathematics course” and let Q(x) be the predicate “x is a
computer science student”.
Binding
Variables
Negation
Logic
Programming
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
∀x(Q(x) ∨ P(x))
Examples &
Universal Quantifier
Example I
IntroductionThe universe of discourse for both P(x) and Q(x) is all
PropositionalUNL students.
Functions
Propositional
Functions
Quantifiers
must take a discrete mathematics course”.
Existential Quantifier
Mixing
Quantifiers
Examples &
Universal Quantifier
Example II
Express the statement “Every computer science student
UniversalQuantifier ∀x(Q(x) → P(x))
Predicate
Logic and
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further10 /33
Express the statement “Everybody must take a discrete
mathematics course or be a computer science student”.
∀x(Q(x) ∨ P(x))
Are hetse statements true or false?
Examples &
Universal Quantifier
Example I
Quantifiers
Express the statement “for every x and for every y, x+y > 10”
CSE235
Introduction
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Examples &
Universal Quantifier
Example II
Logic
Programming
Transcribing
English into Logic
Further11 /33
Examples &
Universal Quantifier
Example II
Predicate
Logic and
Quantifiers
Propositional Functions
Quantifiers
Examples &
Universal Quantifier
Example II
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
CSE235
Introduction
Propositional
Functions
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
Transcribing
English into Logic
Further11 /33
Examples &
Universal Quantifier
Example II
Further11 /33
Predicate
Logic and
Quantifiers
∀x∀yP(x,y)
Examples &
Universal Quantifier
Example II
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
Answer:
Transcribing
English into Logic
Further13 /33
Examples &
Universal Quantifier
Example II
Programming
Transcribing
English into Logic
Further11 /33
Predicate
Logic and
Examples &
Universal Quantifier
Example II
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Express the statement “for every x and for every y, x+y > 10”
Let P(x,y) be the statement x + y > 10 where the universe of
discourse for x,y is the set of integers.
Answer:
∀x∀yP(x,y)
Transcribing
English into Logic
Further15 /33
Examples &
Universal Quantifier
Example II
Universal
Quantifier
∀x,yP(x,y)
Logic
Programming
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Note that we can also use the shorthand
Transcribing
English into Logic
Further16 /33
Examples &
Existential Quantifier
Definition
Predicate
Transcribing
English into Logic
Further17 /33
Examples &
Existential Quantifier
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Definition
P (x)
x
P (x) is true.” We use the notation
∃xP (x)
which can be read “there exists anx
Transcribing
English into Logic
Further18 /33
Examples &
Existential Quantifier
Example II
Mixing
Quantifiers Again, if the universe of discourse is finite, {n1,n2,...,nk}, then
Transcribing
English into Logic
Further19 /33
Examples &
Existential Quantifier
Propositional Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
∃xP(x) ⇐⇒ P(n1) ∨ P(n2) ∨ ··· ∨ P(nk)
Binding
Variables
Negation
Logic
Programming
the existential quantifier is simply the disjunction of all
elements:
Transcribing
English into Logic
Further20 /33
Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Let P(x,y) denote the statement, “x + y = 5”.
What does the expression,
∃x∃yP(x,y)
Transcribing
English into Logic
Further21 /33
Examples &
Existential Quantifier
Example I
Existential mean?
Quantifier
Mixing
Quantifiers
Binding What universe(s) of discourse make it true?
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further22 /33
Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
Transcribing
English into Logic
Further23 /33
Examples &
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Examples &
Existential Quantifier
Example II
Predicate
Logic and
Quantifiers
Propositional
Functions Let P(x) be the statementwhere the universe
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
Propositional
Functions
Quantifiers
of discourse for x is the set of reals. Note here that a,b,c are all
fixed constants.
Examples &
Existential Quantifier
Example II Continued
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further14 /33
Predicate
Logic and
Quantifiers
Propositional
CSE235
Introduction
Express the statement “there exists a real solution to
ax2 + bx − c = 0”
Examples &
Existential Quantifier
Example II
Functions Let P(x) be the statementwhere the universe
The statement can thus be expressed as
Existential
Quantifier
Mixing
Propositional
Functions
Quantifiers
Universal
Quantifier
of discourse for x is the set of reals. Note here that a,b,c are all
fixed constants.
Examples &
Existential Quantifier
Example II Continued
Quantifiers
Binding
Variables
Negation
∃xP(x)
Logic
Programming
Transcribing
English into Logic
Further14 /33
Predicate
Logic and
Quantifiers
CSE235
Introduction Question: what is the truth value of ∃xP(x)?
Propositional Functions
Examples &
Existential Quantifier
Example II
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further15 /33
Examples &
Existential Quantifier
Example II Continued
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Question: what is the truth value of xP(x)?
Answer: it is false. For any real numbers such that b2 < 4ac,
there will only be complex solutions, for these cases no such
real number x can satisfy the predicate.
How can we make it so that it is true?
Transcribing
English into Logic
Further15 /33
Examples &
Existential Quantifier
Example II Continued
∃
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Transcribing
English into Logic
Further16 /33
Examples &
Logic
Programming
Transcribing
English into Logic
Further15 /33
Predicate
Logic and
Quantifiers
CSE235
Transcribing
English into Logic
Further17 /33
Examples &
Existential Quantifier
Example II Continued
∃
Existential
Quantifier
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Question: what is the truth value of xP(x)?
Answer: it is false. For any real numbers such that b2 < 4ac,
there will only be complex solutions, for these cases no such
real number x can satisfy the predicate.
How can we make it so that it is true?
Transcribing
English into Logic
Further18 /33
Examples &
Mixing
Quantifiers
Binding
Variables
Negation
Answer: change the universe of discourse to the complex
numbers, C.
Logic
Programming
Transcribing
English into Logic
Further19 /33
Examples &
Existential Quantifier
Example II Continued
Quantifiers
Truth Values
Functions
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
In general, when are quantified statements true/false?
Statement True When False When
Transcribing
English into Logic
Further20 /33
Examples &
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Logic
Programming
∀xP(x) P(x) is true for every
x.
There is an x for which
P(x) is false.
∃xP(x) There is an x for which
P(x) is true.
P(x) is false for every
x.
Quantifiers
Binding
Variables
Negation
Table: Truth Values of Quantifiers
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Predicate
Logic and
Quantifiers
CSE235
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
I
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Existential and universal quantifiers can be used together to
quantify a predicate statement; for example,
∀x∃yP(x,y)
is perfectly valid. However, you must be careful—it must be
read left to right.
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Mixing
Quantifiers
Logic
Programming
II
Binding
Variables
Negation
For example, ∀x∃yP(x,y) is not equivalent to ∃y∀xP(x,y).
Thus, ordering is important.
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Predicate Logic
and
Quantifiers
CSE235
For example:
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Those expressions do not mean the same thing!
Note that ∃y∀xP(x,y) → ∀x∃yP(x,y), but the converse does not
hold
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Binding However, you can commute similar quantifiers; ∃x∃yP(x,y) is
Transcribing
English into Logic
Further26 /33
Examples &
Mixing Quantifiers
Introduction∀x∃yLoves(x,y): everybody loves somebody
Propositional∃y∀xLoves(x,y): There is someone loved by everyone
Variables
Negation
Logic
Programming
equivalent to ∃y∃xP(x,y) (which is why our shorthand was
valid).
Transcribing
English into Logic
Further27 /33
Examples &
Mixing Quantifiers
Mixing
Quantifiers
Truth Values
Predicate
Logic and
Statement True When False When
Transcribing
English into Logic
Further28 /33
Examples &
Mixing Quantifiers
∀x∀yP(x,y) P(x,y) is true for every
pair x,y.
There is at least one
pair, x,y for which
P(x,y) is false.
∀x∃yP(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 false for
every y.
Transcribing
English into Logic
Further29 /33
Examples &
Mixing Quantifiers
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
∃x∀yP(x,y) There is an x for which
P(x,y) is true for every
y.
For every x, there is a
y for which P(x,y) is
false.
∃x∃yP(x,y) There is at least one
pair x,y for which
P(x,y) is true.
P(x,y) is false for every
pair x,y.
Transcribing
English into Logic
Further30 /33
Examples &
Mixing Quantifiers
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Table: Truth Values of 2-variate Quantifiers
Transcribing
English into Logic
Further31 /33
Examples &
Mixing Quantifiers
Example I
Predicate
Logic and
Quantifiers
CSE235
Express, in predicate logic, the statement that there are an
Introduction infinite number of integers.
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Examples &
Mixing Quantifiers
Example I
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Quantifiers
Examples &
Mixing Quantifiers
Example I
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Introduction
Propositional
Functions
Propositional
Functions
Express, in predicate logic, the statement that there are an
infinite number of integers.
Let P(x,y) be the statement that x < y. Let the universe of
discourse be the integers, Z.
Examples &
Mixing Quantifiers
Example I
Transcribing
English into Logic
Further20 /33
Predicate
Logic and
Quantifiers
Examples &
Mixing Quantifiers
Example I
CSE235
Mixing ∀x∃yP(x,y)
Quantifiers
Binding
Variables
Negation
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express, in predicate logic, the statement that there are an
infinite number of integers.
Let P(x,y) be the statement that x < y. Let the universe of
discourse be the integers, Z.
Then the statement can be expressed by the following.
Examples &
Mixing Quantifiers
Example I
Logic
Programming
Transcribing
English into Logic
Further20 /33
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Predicate
Logic and
Quantifiers
CSE235 Express the commutative law of addition for R.
Introduction
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the commutative law of addition for R.
We want to express that for every pair of reals, x,y the
following identity holds:
x + y = y + x
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express the commutative law of addition for R.
We want to express that for every pair of reals, x,y the
following identity holds:
x + y = y + x
Then we have the following:
Transcribing
English into Logic
Further21 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements
Mixing
QuantifiersBinding ∀x∀y(x + y = y + x)
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Predicate
Logic and
Quantifiers
CSE235
Express the multiplicative inverse law for (nonzero) rationals
Introduction
Q  {0}.
Propositional Functions
Propositional Functions
Quantifiers
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
CSE235
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Introduction
Propositional
Functions
Propositional
Functions
Express the multiplicative inverse law for (nonzero) rationals Q
 {0}.
We want to express that for every real number x, there exists a
real number y such that xy = 1.
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
CSE235
Mixing ∀x∃y(xy = 1)
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Express the multiplicative inverse law for (nonzero) rationals Q
 {0}.
We want to express that for every real number x, there exists a
real number y such that xy = 1.
Then we have the following:
Transcribing
English into Logic
Further22 /33
Examples &
Mixing Quantifiers
Example II: More Mathematical Statements Continued
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Predicate
Logic and
Quantifiers
CSE235
Introduction Is commutativity for subtraction valid over the reals?
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
CSE235
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Introduction
Propositional
Functions
Propositional
Functions
Is commutativity for subtraction valid over the reals?
That is, for all pairs of real numbers x,y does the identity x −
y = y − x hold? Express this using quantifiers.
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
CSE235
Mixing
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Is commutativity for subtraction valid over the reals?
That is, for all pairs of real numbers x,y does the identity x −
y = y − x hold? Express this using quantifiers.
The expression is
∀x∀y(x − y = y − x)
Transcribing
English into Logic
Further23 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Predicate
Logic and
Quantifiers
CSE235
Introduction Is there a multiplicative inverse law over the nonzero integers?
Propositional Functions
Propositional Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Functions
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Introduction
Propositional
Functions
Propositional
Is there a multiplicative inverse law over the nonzero integers?
That is, for every integer x does there exists a y such that xy =
1?
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
CSE235
Mixing statement held, then 5 = 1/y, but for any (nonzero) integer y,
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Existential
Quantifier
Is there a multiplicative inverse law over the nonzero integers?
That is, for every integer x does there exists a y such that xy =
1?
This is false, since we can find a counter example. Take any
integer, say 5 and multiply it with another integer, y. If the
Transcribing
English into Logic
Further24 /33
Examples &
Mixing Quantifiers
Example II: False Mathematical Statements Continued
Quantifiers
Binding Variables
|1/y| ≤ 1.
Negation
Logic
Programming
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Logic andPredicate Express the statement “there is a number x such that
Quantifiers when it is added to any number, the result is that CSE235
number, and if it is multiplied by any number, the Introduction
result is x” as a logical expression.
Propositional Functions
Propositional Solution:
Functions
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Universal
Quantifier
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Universal
Quantifier
Existential Quantifier
Mixing
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Let P(x,y) be the expression “x + y = y”.
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Logic
Programming
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
Existential Quantifier
Mixing
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding Variables
∃x∀y (P(x,y) ∧ Q(x,y))
Negation
Logic
Programming
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
QuantifiersLet P(x,y) be the expression “x + y = y”.
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Binding
∃x∀y (P(x,y) ∧ Q(x,y))
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
Quantifiers
Variables
Negation
Logic
Programming
Over what universe(s) of discourse does this statement
hold?
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
QuantifiersLet P(x,y) be the expression “x + y = y”.
UniversalQuantifierLet Q(x,y) be the expression “xy = x”.
ExistentialQuantifierThen the expression is
Mixing
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
Quantifiers
Binding
Variables
Negation
∃x∀y (P(x,y) ∧ Q(x,y))
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Express the statement “there is a number x such that
when it is added to any number, the result is that
number, and if it is multiplied by any number, the
result is x” as a logical expression.
Solution:
Transcribing
English into Logic
Further25 /33
Examples &
Mixing Quantifiers
Exercise
LogicOver what universe(s) of discourse does this statement
Programming
hold?
This is the additive identity law and holds for N,Z,R,Q but
does not hold for Z+.
Examples &
Binding Variables I
Propositional
Functions Example
Quantifiers In the expression ∃x∀yP(x,y) both x and y are bound.
Universal
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
When a quantifier is used on a variable x, we say that x is
bound. If no quantifier is used on a variable in a predicate
statement, it is called free.
Examples &
QuantifierExistential In the expression ∀xP(x,y), x is bound, but y is free.
Quantifier
Mixing
Quantifiers
BindingVariables A statement is called a well-formed formula, when all variables
Negation
are properly
quantified.
Logic
Programming
Transcribing
English into Logic
Further26 /33
Examples &
Binding Variables II
Propositional Example
Functions
Quantifiers In the expression ∃x,y∀zP(x,y,z,c) the scope of the
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
The set of all variables bound by a common quantifier is the
scope of that quantifier.
Examples &
UniversalQuantifier existential quantifier is {x,y}, the scope of the universal
ExistentialQuantifier quantifier is just z and c has no scope since it is free.
Mixing
Quantifiers
Binding
Variables
Negation
Logic
Programming
Transcribing
English into Logic
Further27 /33
Examples &
Predicate
Logic and
Quantifiers
CSE235
Introduction
Just as we can use negation with propositions, we can use
them with quantified expressions.
Examples &
Logic
fact if the universe of discourse is finite, it is exactly De
Examples &
Programming
Transcribing
English into
Logic
Morgan’s law).
Examples &
Negation
Lemma
P (x) be a predicate. Then the following hold.
¬∀xP (x) ≡∃ x¬P (x)
¬∃xP (x) ≡∀ x¬P (x)
Examples &
This is essentially a quantified version of De Morgan’s Law (in
Further28 /33
Negation
Truth Values
Predicate
Logic and
Quantifiers
CSE235
Introduction
Statement True When False When
Examples &
Propositional
Functions
Propositional
Functions
Quantifiers
Universal
Quantifier
Negation
Logic
Programming
Transcribing
English into Logic
Further29 /33
¬∃xP(x) ≡
∀x¬P(x)
For every x, P(x) is
false.
There is an x for which
P(x) is true.
¬∀xP(x) ≡
∃x¬P(x)
There is an x for which
P(x) is false.
P(x) is true for every x.
Existential Quantifier
Mixing
Quantifiers
Binding
Variables
Table: Truth Values of Negated Quantifiers
Prolog
FunctionsProlog allows the user to express facts and rules
PropositionalFacts are proposational functions: student(juana),
Functions
enrolled(juana,cse235),
instructor(patel,cse235),
etc.
Quantifiers
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Prolog (Programming in Logic) is a programming language
based on (a restricted form of) Predicate Calculus. It was
developped by the logicians of the artificial intelligence
community for symbolic reasoning.
Logic
Further
Examples &
Exercises
?enrolled(juana,cse478)
?enrolled(X,cse478)
?teaches(X,juana)
Rules are implications with conjunctions:
Logic Programming teaches(X,Y) :- instructor(X,Z), enrolled(Y,Z)
Transcribing
English intoProlog answers queries such as:
30 /33
by binding variables and doing theorem proving (i.e.,
applying inference rules) as we will see in Section 1.5.
32 /33
Conclusion
Predicate
Logic and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Logic
Programming
Logic is more precise than English.
Transcribing English to Logic and vice versa can be tricky.
When writing statements with quantifiers, usually the correct
meaning is conveyed with the following combinations:
Use ∀ with ⇒
Example: ∀xLion(x) ⇒ Fierce(x)
∀xLion(x) ∧ Fierce(x) means “everyone is a lion and
Further
Example: ∃xLion(x) ∧ Drinks(x,coffee): holds when you
32 /33
Conclusion
English into Logic
everyone is fierce”
Transcribing
English into
Logic Use ∃ with ∧
Examples &
Exercises have at least one lion that drinks coffee
∃xLion(x) ⇒ Drinks(x,coffee) holds when you have
people even though no lion drinks coffee.
31 /33
32 /33
Conclusion
Further
Examples &
Propositional
Logic
Exercises
Predicate Logic
and
Quantifiers
CSE235
Introduction
Examples? Exercises?
Rewrite the expression,
Functions
Propositional
Functions
Quantifiers
Logic
Programming
Transcribing
English into
Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...}
and y ∈ {2,3,4,...}. Let Q(y) denote
32 /33
Conclusion
“”. When is Q(y) true?
32 /33
Conclusion
Predicate Logic
and
Quantifiers
CSE235
Examples? Exercises?
Rewrite the expression,
Introduction
Propositional
Functions
Answer: Use the negated quantifiers and De Morgan’s law.
Propositional Functions
Further
Examples &
Exercises
32 /33
Conclusion
Quantifiers
Logic
“”. When is Q(y) true?
Predicate Logic
and
Quantifiers
CSE235
Examples? Exercises?
Rewrite the expression,
Introduction
Propositional Functions
Answer: Use the negated quantifiers and De Morgan’s law.
Logic
Programming
Transcribing
English into
Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...}
and y ∈ {2,3,4,...}. Let Q(y) denote
Propositional Functions
Quantifiers
Logic
“”. When is Q(y) true?
Answer: Only when y is a prime number.
Further
Examples &
Exercises
Logic
Programming
Transcribing
English into
Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...}
and y ∈ {2,3,4,...}. Let Q(y) denote
32 /33
Conclusion
Predicate Logic
and
Quantifiers
CSE235
Introduction
Propositional
Functions
Propositional
Functions
Quantifiers
Logic
Programming
Transcribing
English into
Logic
Some students wondered if
∀x,yP(x,y) ≡ ∀xP(x,y) ∧ ∀yP(x,y)
This is certainly not true. In the left-hand side, both x and y are
bound. In the right-hand side, x is bound in the first predicate,
but y is free. In the second predicate, y is bound but x is free.
All variables that occur in a propositional function must be
bound to turn it into a proposition.
Extra Question
Further Examples &
Exercises Thus, the left-hand side is a proposition, but the right-hand side
is not. How can they be equivalent?
33 /33

More Related Content

Similar to PredicatesQuantifiers.docx

1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.pptTejasAditya2
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introductionyashirraza123
 
Fuzzy logic andits Applications
Fuzzy logic andits ApplicationsFuzzy logic andits Applications
Fuzzy logic andits ApplicationsDrATAMILARASIMCA
 
SESSION-11 PPT.pptx
SESSION-11 PPT.pptxSESSION-11 PPT.pptx
SESSION-11 PPT.pptxNaniSarath
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrisonComputer Science Club
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Omnia A. Abdullah
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Introduction to Logic Spring 2007 Introduction to Discrete Structures.ppt
Introduction to Logic Spring 2007 Introduction to Discrete Structures.pptIntroduction to Logic Spring 2007 Introduction to Discrete Structures.ppt
Introduction to Logic Spring 2007 Introduction to Discrete Structures.pptyaniarianneyani
 
A Probabilistic Attack On NP-Complete Problems
A Probabilistic Attack On NP-Complete ProblemsA Probabilistic Attack On NP-Complete Problems
A Probabilistic Attack On NP-Complete ProblemsBrittany Allen
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiersallyn joy calcaben
 
CSci102_Module 4.ppt
CSci102_Module 4.pptCSci102_Module 4.ppt
CSci102_Module 4.pptHarleyGotardo
 

Similar to PredicatesQuantifiers.docx (20)

1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
01bkb04p.ppt
01bkb04p.ppt01bkb04p.ppt
01bkb04p.ppt
 
Fuzzy logic andits Applications
Fuzzy logic andits ApplicationsFuzzy logic andits Applications
Fuzzy logic andits Applications
 
SESSION-11 PPT.pptx
SESSION-11 PPT.pptxSESSION-11 PPT.pptx
SESSION-11 PPT.pptx
 
Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison20130928 automated theorem_proving_harrison
20130928 automated theorem_proving_harrison
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Introduction to Logic Spring 2007 Introduction to Discrete Structures.ppt
Introduction to Logic Spring 2007 Introduction to Discrete Structures.pptIntroduction to Logic Spring 2007 Introduction to Discrete Structures.ppt
Introduction to Logic Spring 2007 Introduction to Discrete Structures.ppt
 
A Probabilistic Attack On NP-Complete Problems
A Probabilistic Attack On NP-Complete ProblemsA Probabilistic Attack On NP-Complete Problems
A Probabilistic Attack On NP-Complete Problems
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiers
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
CSci102_Module 4.ppt
CSci102_Module 4.pptCSci102_Module 4.ppt
CSci102_Module 4.ppt
 
Discrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order LogicDiscrete Math Lecture 02: First Order Logic
Discrete Math Lecture 02: First Order Logic
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
 
Logic
LogicLogic
Logic
 
Logic DM
Logic DMLogic DM
Logic DM
 
Theory of computing
Theory of computingTheory of computing
Theory of computing
 

Recently uploaded

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...Call Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLDeelipZope
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 

Recently uploaded (20)

(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
High Profile Call Girls Nashik Megha 7001305949 Independent Escort Service Na...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Current Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCLCurrent Transformer Drawing and GTP for MSETCL
Current Transformer Drawing and GTP for MSETCL
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 

PredicatesQuantifiers.docx

  • 1. 1/ 33 Introduction Propositional Functions Slides by Christopher M. Bourke Propositional Functions Instructor: Berthe Y. Choueiry Quantifiers Logic Programming Transcribing English into Logic Fall 2007 Predicate Logic and Quantifiers
  • 2. 2/ 33 Further Computer Science & Engineering 235 Examples & Exercises Introduction to Discrete Mathematics Sections 1.3–1.4 of Rosen cse235@cse.unl.edu Introduction Predicate Logic and Quantifiers CSE235 Consider the following statements: x > 3, x = y + 3, x + y = z
  • 3. 3/ 33 Propositional Functions Introduction Propositional Functions Propositional Functions Quantifiers Logic Programming Transcribing English into Logic Further Examples & Exercises The truth value of these statements has no meaning without specifying the values of x,y,z. However, we can make propositions out of such statements. A predicate is a property that is affirmed or denied about the subject (in logic, we say “variable” or “argument”) of a statement. “ x is greater than 3” |{z} | {z } subject predicate
  • 4. 4/ 33 Terminology: affirmed = holds = is true; denied = does not hold = is not true. |{z} | {z } Propositional subject predicate Functions Predicate Logic and Quantifiers CSE235 Introduction To write in predicate logic: “ x is greater than 3” Propositional Functions Quantifiers Logic Programming Transcribing English into We introduce a (functional) symbol for the predicate, and put the subject as an argument (to the functional symbol): P(x) Examples:
  • 5. 5/ 33 Propositional Functions LogicFather(x): unary predicate Further Brother(x,y): binary predicate Examples & Exercises Sum(x,y,z): ternary predicate P(x,y,z,t): n-ary predicate
  • 6. Examples & Exercises 6/ 33 Propositional Functions Predicate Logic and Quantifiers Definition CSE235 A statement of the form P(x1,x2,...,xn) is the value of the Introduction propositional function P. Here, (x1,x2,...,xn) is an n-tuple Propositional and P is a predicate. Functions Propositional Universe of Discourse Quantifiers You can think of a propositional function as a function that
  • 7. Examples & Exercises 7/ 33 Propositional Functions Functions Evaluates to true or false. Logic Programming Takes one or more arguments. Transcribing intoExpresses a predicate involving the argument(s). English Logic Becomes a proposition when values are assigned to the Further arguments.
  • 8. Examples & Exercises 8/ 33 Propositional Functions Example Predicate Logic and Quantifiers Example CSE235 Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is Introduction the truth value of Q(3,4,5)? What is the truth value of Propositional Functions Q(2,2,3)? How many values of (x,y,z) make the predicate Propositional true?
  • 9. Examples & Exercises 9/ 33 Propositional Functions Functions Universe of Discourse Quantifiers Logic Programming Transcribing English into Logic Further Example Predicate Logic and
  • 10. Examples & Exercises 10/ 33 Propositional Functions Quantifiers Example Universe of Discourse
  • 11. Examples & Exercises 11/ 33 Propositional Functions CSE235 Let Q(x,y,z) denote the statement “x2 + y2 = z2”. What is Introduction the truth value of Q(3,4,5)? What is the truth value of Propositional Quantifiers Logic Programming Transcribing English into Logic Further Since 32 + 42 = 25 = 52, Q(3,4,5) is true. Since 22 + 22 = 8 6= 32 = 9, Q(2,2,3) is false. There are infinitely many values for (x,y,z) that make this propositional function true—how many right triangles are there?
  • 12. Examples & Exercises 7/ 33 Propositional Functions Functions Q(2,2,3)? How many values of (x,y,z) make the predicate Propositional true? Functions
  • 13.
  • 14. Examples & Exercises 6/ 33 Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Consider the previous example. Does it make sense to assign to x the value “blue”? Intuitively, the universe of discourse is the set of all things we
  • 15. Examples & Exercises 7/ 33 Quantifiers Logic Programming sensibly assign to a variable in a propositional function.
  • 16. Transcribing English into Logic Further8/ 33 Examples & Transcribing English into Logic What would be the universe of discourse for the propositional function P(x) = “The test will be on x the 23rd” be?
  • 17. Examples & Exercises 9/ 33 Universe of Discourse Universe of wish to talk about; that is, the set of all objects that we can Discourse Further
  • 18. Transcribing English into Logic Further10/ 33 Examples & Universe of Discourse Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Moreover, each variable in an n-tuple may have a different universe of discourse. Let P(r,g,b,c) = “The rgb-value of the color c is (r,g,b)”.
  • 19. Examples & Exercises 11/ 33 Quantifiers Logic Programming For example, P(255,0,0,red) is true, while P(0,0,255,green) is false.
  • 20. Transcribing English into Logic Further12/ 33 Examples & Multivariate Functions Universe of Discourse Transcribing English into Logic What are the universes of discourse for (r,g,b,c)?
  • 22. Transcribing English into Logic Further14/ 33 Examples & Quantifiers Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions A predicate becomes a proposition when we assign it fixed values. However, another way to make a predicate into a proposition is to quantify it. That is, the predicate is true (or false) for all possible values in the universe of discourse or for
  • 23. Examples & Exercises 15/ 33 Introduction Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding some value(s) in the universe of discourse. Such quantification can be done with two quantifiers: the universal quantifier and the existential quantifier. Variables Negation
  • 24. Transcribing English into Logic Further16/ 33 Examples & Logic Programming
  • 25. Transcribing English into Logic Further17/ 33 Examples & Universal Quantifier Definition Predicate
  • 26. Transcribing English into Logic Further18/ 33 Examples & Universal Quantifier Example I Logic and Quantifiers CSE235 Introduction Propositional Functions Definition P (x) P (x) x ∀xP (x) which can be read “for all x
  • 27. Examples & Universal Quantifier Example I Existential Quantifier
  • 28. Transcribing English into Logic Further20/ 33 Examples & Universal Quantifier Example I Propositional Functions Quantifiers Universal Quantifier ∀xP(x) ⇐⇒ P(n1) ∧ P(n2) ∧ ··· ∧ P(nk) Mixing Quantifiers Binding Variables Negation Logic Programming If the universe of discourse is finite, say {n1,n2,...,nk}, then the universal quantifier is simply the conjunction of all elements:
  • 29. Examples & Universal Quantifier Example I Predicate Logic and Quantifiers CSE235 Let P(x) be the predicate “x must take a discrete mathematics course” and let Q(x) be the predicate “x is a computer science student”. IntroductionThe universe of discourse for both P(x) and Q(x) is all PropositionalUNL students. Functions Express the statement “Every computer science student Propositional Functions Quantifiers must take a discrete mathematics course”.
  • 30. Transcribing English into Logic Further22/ 33 Examples & Universal Quantifier Example I Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Express the statement “Everybody must take a discrete mathematics course or be a computer science student”. Logic Programming
  • 31. Examples & Universal Quantifier Example I Predicate Logic and Quantifiers CSE235 Let P(x) be the predicate “x must take a discrete mathematics course” and let Q(x) be the predicate “x is a computer science student”. IntroductionThe universe of discourse for both P(x) and Q(x) is all PropositionalUNL students. Functions Express the statement “Every computer science student
  • 32. Transcribing English into Logic Further24/ 33 Examples & Universal Quantifier Example I UniversalQuantifier ∀x(Q(x) → P(x)) Existential Quantifier Mixing Quantifiers Propositional Functions Quantifiers must take a discrete mathematics course”.
  • 33. Examples & Universal Quantifier Example I Binding Variables Negation Express the statement “Everybody must take a discrete mathematics course or be a computer science student”. Logic Programming Transcribing English into Logic Further10 /33
  • 34. Examples & Universal Quantifier Example I Predicate Logic and Quantifiers CSE235 Let P(x) be the predicate “x must take a discrete mathematics course” and let Q(x) be the predicate “x is a computer science student”. IntroductionThe universe of discourse for both P(x) and Q(x) is all PropositionalUNL students. Functions Express the statement “Every computer science student
  • 35. Examples & Universal Quantifier Example I Propositional Functions Quantifiers must take a discrete mathematics course”. Existential Quantifier Mixing Quantifiers
  • 36. Examples & Universal Quantifier Example II UniversalQuantifier ∀x(Q(x) → P(x)) Transcribing English into Logic Further10 /33 Predicate Logic and Quantifiers CSE235 Let P(x) be the predicate “x must take a discrete mathematics course” and let Q(x) be the predicate “x is a computer science student”. Binding Variables Negation Logic Programming Express the statement “Everybody must take a discrete mathematics course or be a computer science student”. ∀x(Q(x) ∨ P(x))
  • 37. Examples & Universal Quantifier Example I IntroductionThe universe of discourse for both P(x) and Q(x) is all PropositionalUNL students. Functions Propositional Functions Quantifiers must take a discrete mathematics course”. Existential Quantifier Mixing Quantifiers
  • 38. Examples & Universal Quantifier Example II Express the statement “Every computer science student UniversalQuantifier ∀x(Q(x) → P(x)) Predicate Logic and Binding Variables Negation Logic Programming Transcribing English into Logic Further10 /33 Express the statement “Everybody must take a discrete mathematics course or be a computer science student”. ∀x(Q(x) ∨ P(x)) Are hetse statements true or false?
  • 39. Examples & Universal Quantifier Example I Quantifiers Express the statement “for every x and for every y, x+y > 10” CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation
  • 40. Examples & Universal Quantifier Example II Logic Programming Transcribing English into Logic Further11 /33
  • 41. Examples & Universal Quantifier Example II Predicate Logic and Quantifiers Propositional Functions Quantifiers
  • 42. Examples & Universal Quantifier Example II Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Transcribing English into Logic CSE235 Introduction Propositional Functions Express the statement “for every x and for every y, x+y > 10” Let P(x,y) be the statement x + y > 10 where the universe of discourse for x,y is the set of integers.
  • 43. Transcribing English into Logic Further11 /33 Examples & Universal Quantifier Example II Further11 /33 Predicate Logic and Quantifiers ∀x∀yP(x,y)
  • 44. Examples & Universal Quantifier Example II Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic CSE235 Introduction Propositional Functions Propositional Functions Express the statement “for every x and for every y, x+y > 10” Let P(x,y) be the statement x + y > 10 where the universe of discourse for x,y is the set of integers. Answer:
  • 45. Transcribing English into Logic Further13 /33 Examples & Universal Quantifier Example II Programming Transcribing English into Logic Further11 /33 Predicate Logic and
  • 46. Examples & Universal Quantifier Example II Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Express the statement “for every x and for every y, x+y > 10” Let P(x,y) be the statement x + y > 10 where the universe of discourse for x,y is the set of integers. Answer: ∀x∀yP(x,y)
  • 47. Transcribing English into Logic Further15 /33 Examples & Universal Quantifier Example II Universal Quantifier ∀x,yP(x,y) Logic Programming Existential Quantifier Mixing Quantifiers Binding Variables Negation Note that we can also use the shorthand
  • 48. Transcribing English into Logic Further16 /33 Examples & Existential Quantifier Definition Predicate
  • 49. Transcribing English into Logic Further17 /33 Examples & Existential Quantifier Logic and Quantifiers CSE235 Introduction Propositional Functions Definition P (x) x P (x) is true.” We use the notation ∃xP (x) which can be read “there exists anx
  • 50. Transcribing English into Logic Further18 /33 Examples & Existential Quantifier Example II Mixing Quantifiers Again, if the universe of discourse is finite, {n1,n2,...,nk}, then
  • 51. Transcribing English into Logic Further19 /33 Examples & Existential Quantifier Propositional Functions Quantifiers Universal Quantifier Existential Quantifier ∃xP(x) ⇐⇒ P(n1) ∨ P(n2) ∨ ··· ∨ P(nk) Binding Variables Negation Logic Programming the existential quantifier is simply the disjunction of all elements:
  • 52. Transcribing English into Logic Further20 /33 Examples & Existential Quantifier Example II Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Let P(x,y) denote the statement, “x + y = 5”. What does the expression, ∃x∃yP(x,y)
  • 53. Transcribing English into Logic Further21 /33 Examples & Existential Quantifier Example I Existential mean? Quantifier Mixing Quantifiers Binding What universe(s) of discourse make it true? Variables Negation Logic Programming
  • 54. Transcribing English into Logic Further22 /33 Examples & Existential Quantifier Example II Predicate Logic and Quantifiers Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier CSE235 Introduction Express the statement “there exists a real solution to ax2 + bx − c = 0”
  • 55. Transcribing English into Logic Further23 /33 Examples & Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming
  • 56. Examples & Existential Quantifier Example II Predicate Logic and Quantifiers Propositional Functions Let P(x) be the statementwhere the universe Universal Quantifier Existential Quantifier Mixing Quantifiers Binding CSE235 Introduction Express the statement “there exists a real solution to ax2 + bx − c = 0” Propositional Functions Quantifiers of discourse for x is the set of reals. Note here that a,b,c are all fixed constants.
  • 57. Examples & Existential Quantifier Example II Continued Variables Negation Logic Programming Transcribing English into Logic Further14 /33 Predicate Logic and Quantifiers Propositional CSE235 Introduction Express the statement “there exists a real solution to ax2 + bx − c = 0”
  • 58. Examples & Existential Quantifier Example II Functions Let P(x) be the statementwhere the universe The statement can thus be expressed as Existential Quantifier Mixing Propositional Functions Quantifiers Universal Quantifier of discourse for x is the set of reals. Note here that a,b,c are all fixed constants.
  • 59. Examples & Existential Quantifier Example II Continued Quantifiers Binding Variables Negation ∃xP(x) Logic Programming Transcribing English into Logic Further14 /33 Predicate Logic and Quantifiers CSE235 Introduction Question: what is the truth value of ∃xP(x)? Propositional Functions
  • 60. Examples & Existential Quantifier Example II Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Transcribing English into Logic Further15 /33
  • 61.
  • 62. Examples & Existential Quantifier Example II Continued Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Question: what is the truth value of xP(x)? Answer: it is false. For any real numbers such that b2 < 4ac, there will only be complex solutions, for these cases no such real number x can satisfy the predicate. How can we make it so that it is true?
  • 63. Transcribing English into Logic Further15 /33 Examples & Existential Quantifier Example II Continued ∃ Existential Quantifier Mixing Quantifiers Binding Variables Negation
  • 64. Transcribing English into Logic Further16 /33 Examples & Logic Programming Transcribing English into Logic Further15 /33 Predicate Logic and Quantifiers CSE235
  • 65. Transcribing English into Logic Further17 /33 Examples & Existential Quantifier Example II Continued ∃ Existential Quantifier Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Question: what is the truth value of xP(x)? Answer: it is false. For any real numbers such that b2 < 4ac, there will only be complex solutions, for these cases no such real number x can satisfy the predicate. How can we make it so that it is true?
  • 66. Transcribing English into Logic Further18 /33 Examples & Mixing Quantifiers Binding Variables Negation Answer: change the universe of discourse to the complex numbers, C. Logic Programming
  • 67. Transcribing English into Logic Further19 /33 Examples & Existential Quantifier Example II Continued Quantifiers Truth Values Functions Predicate Logic and Quantifiers CSE235 Introduction Propositional In general, when are quantified statements true/false? Statement True When False When
  • 68. Transcribing English into Logic Further20 /33 Examples & Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Mixing Logic Programming ∀xP(x) P(x) is true for every x. There is an x for which P(x) is false. ∃xP(x) There is an x for which P(x) is true. P(x) is false for every x. Quantifiers Binding Variables Negation Table: Truth Values of Quantifiers
  • 69. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Predicate Logic and Quantifiers CSE235
  • 70. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers I Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Existential and universal quantifiers can be used together to quantify a predicate statement; for example, ∀x∃yP(x,y) is perfectly valid. However, you must be careful—it must be read left to right.
  • 71. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Mixing Quantifiers Logic Programming II Binding Variables Negation For example, ∀x∃yP(x,y) is not equivalent to ∃y∀xP(x,y). Thus, ordering is important.
  • 72. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Predicate Logic and Quantifiers CSE235 For example: Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Those expressions do not mean the same thing! Note that ∃y∀xP(x,y) → ∀x∃yP(x,y), but the converse does not hold
  • 73. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Binding However, you can commute similar quantifiers; ∃x∃yP(x,y) is
  • 74. Transcribing English into Logic Further26 /33 Examples & Mixing Quantifiers Introduction∀x∃yLoves(x,y): everybody loves somebody Propositional∃y∀xLoves(x,y): There is someone loved by everyone Variables Negation Logic Programming equivalent to ∃y∃xP(x,y) (which is why our shorthand was valid).
  • 75. Transcribing English into Logic Further27 /33 Examples & Mixing Quantifiers Mixing Quantifiers Truth Values Predicate Logic and Statement True When False When
  • 76. Transcribing English into Logic Further28 /33 Examples & Mixing Quantifiers ∀x∀yP(x,y) P(x,y) is true for every pair x,y. There is at least one pair, x,y for which P(x,y) is false. ∀x∃yP(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 false for every y.
  • 77. Transcribing English into Logic Further29 /33 Examples & Mixing Quantifiers Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier ∃x∀yP(x,y) There is an x for which P(x,y) is true for every y. For every x, there is a y for which P(x,y) is false. ∃x∃yP(x,y) There is at least one pair x,y for which P(x,y) is true. P(x,y) is false for every pair x,y.
  • 78. Transcribing English into Logic Further30 /33 Examples & Mixing Quantifiers Mixing Quantifiers Binding Variables Negation Logic Programming Table: Truth Values of 2-variate Quantifiers
  • 79. Transcribing English into Logic Further31 /33 Examples & Mixing Quantifiers Example I Predicate Logic and Quantifiers CSE235 Express, in predicate logic, the statement that there are an Introduction infinite number of integers. Propositional Functions Propositional Functions Quantifiers Universal Quantifier
  • 80. Examples & Mixing Quantifiers Example I Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers CSE235 Quantifiers
  • 81. Examples & Mixing Quantifiers Example I Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Introduction Propositional Functions Propositional Functions Express, in predicate logic, the statement that there are an infinite number of integers. Let P(x,y) be the statement that x < y. Let the universe of discourse be the integers, Z.
  • 82. Examples & Mixing Quantifiers Example I Transcribing English into Logic Further20 /33 Predicate Logic and Quantifiers
  • 83. Examples & Mixing Quantifiers Example I CSE235 Mixing ∀x∃yP(x,y) Quantifiers Binding Variables Negation Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Express, in predicate logic, the statement that there are an infinite number of integers. Let P(x,y) be the statement that x < y. Let the universe of discourse be the integers, Z. Then the statement can be expressed by the following.
  • 84. Examples & Mixing Quantifiers Example I Logic Programming Transcribing English into Logic Further20 /33
  • 85. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Predicate Logic and Quantifiers CSE235 Express the commutative law of addition for R. Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier
  • 86. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and
  • 87. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Express the commutative law of addition for R. We want to express that for every pair of reals, x,y the following identity holds: x + y = y + x
  • 88. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and
  • 89. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Express the commutative law of addition for R. We want to express that for every pair of reals, x,y the following identity holds: x + y = y + x Then we have the following:
  • 90. Transcribing English into Logic Further21 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Mixing QuantifiersBinding ∀x∀y(x + y = y + x) Variables Negation Logic Programming
  • 91. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued Predicate Logic and Quantifiers CSE235 Express the multiplicative inverse law for (nonzero) rationals Introduction Q {0}. Propositional Functions Propositional Functions Quantifiers
  • 92. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers
  • 93. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued CSE235 Quantifiers Universal Quantifier Existential Quantifier Mixing Introduction Propositional Functions Propositional Functions Express the multiplicative inverse law for (nonzero) rationals Q {0}. We want to express that for every real number x, there exists a real number y such that xy = 1.
  • 94. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers
  • 95. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued CSE235 Mixing ∀x∃y(xy = 1) Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Express the multiplicative inverse law for (nonzero) rationals Q {0}. We want to express that for every real number x, there exists a real number y such that xy = 1. Then we have the following:
  • 96. Transcribing English into Logic Further22 /33 Examples & Mixing Quantifiers Example II: More Mathematical Statements Continued Quantifiers Binding Variables Negation Logic Programming
  • 97. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Predicate Logic and Quantifiers CSE235 Introduction Is commutativity for subtraction valid over the reals? Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier
  • 98. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers
  • 99. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements CSE235 Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Introduction Propositional Functions Propositional Functions Is commutativity for subtraction valid over the reals? That is, for all pairs of real numbers x,y does the identity x − y = y − x hold? Express this using quantifiers.
  • 100. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Variables Negation Logic Programming Predicate Logic and Quantifiers
  • 101. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements CSE235 Mixing Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Is commutativity for subtraction valid over the reals? That is, for all pairs of real numbers x,y does the identity x − y = y − x hold? Express this using quantifiers. The expression is ∀x∀y(x − y = y − x)
  • 102. Transcribing English into Logic Further23 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Quantifiers Binding Variables Negation Logic Programming
  • 103. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued Predicate Logic and Quantifiers CSE235 Introduction Is there a multiplicative inverse law over the nonzero integers? Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier
  • 104. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued Mixing Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers CSE235
  • 105. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued Functions Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Introduction Propositional Functions Propositional Is there a multiplicative inverse law over the nonzero integers? That is, for every integer x does there exists a y such that xy = 1?
  • 106. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued Variables Negation Logic Programming Predicate Logic and Quantifiers
  • 107. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued CSE235 Mixing statement held, then 5 = 1/y, but for any (nonzero) integer y, Introduction Propositional Functions Propositional Functions Quantifiers Universal Quantifier Existential Quantifier Is there a multiplicative inverse law over the nonzero integers? That is, for every integer x does there exists a y such that xy = 1? This is false, since we can find a counter example. Take any integer, say 5 and multiply it with another integer, y. If the
  • 108. Transcribing English into Logic Further24 /33 Examples & Mixing Quantifiers Example II: False Mathematical Statements Continued Quantifiers Binding Variables |1/y| ≤ 1. Negation Logic Programming
  • 109. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Logic andPredicate Express the statement “there is a number x such that Quantifiers when it is added to any number, the result is that CSE235 number, and if it is multiplied by any number, the Introduction result is x” as a logical expression. Propositional Functions Propositional Solution: Functions
  • 110. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Quantifiers Universal Quantifier Existential Quantifier Mixing Quantifiers Binding Variables Negation Logic Programming Universal Quantifier Existential Quantifier Mixing
  • 111. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Quantifiers Binding Variables Negation Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Express the statement “there is a number x such that when it is added to any number, the result is that number, and if it is multiplied by any number, the result is x” as a logical expression. Solution: Let P(x,y) be the expression “x + y = y”.
  • 112. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Logic Programming QuantifiersLet P(x,y) be the expression “x + y = y”. UniversalQuantifierLet Q(x,y) be the expression “xy = x”. Existential Quantifier Mixing
  • 113. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Quantifiers Binding Variables Negation Logic Programming Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Express the statement “there is a number x such that when it is added to any number, the result is that number, and if it is multiplied by any number, the result is x” as a logical expression. Solution:
  • 114. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise QuantifiersLet P(x,y) be the expression “x + y = y”. UniversalQuantifierLet Q(x,y) be the expression “xy = x”. ExistentialQuantifierThen the expression is Mixing
  • 115. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Quantifiers Binding Variables ∃x∀y (P(x,y) ∧ Q(x,y)) Negation Logic Programming Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Express the statement “there is a number x such that when it is added to any number, the result is that number, and if it is multiplied by any number, the result is x” as a logical expression. Solution:
  • 116. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise QuantifiersLet P(x,y) be the expression “x + y = y”.
  • 117. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Express the statement “there is a number x such that when it is added to any number, the result is that number, and if it is multiplied by any number, the result is x” as a logical expression. Solution:
  • 118. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Binding ∃x∀y (P(x,y) ∧ Q(x,y))
  • 119. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise UniversalQuantifierLet Q(x,y) be the expression “xy = x”. ExistentialQuantifierThen the expression is Mixing Quantifiers Variables Negation Logic Programming Over what universe(s) of discourse does this statement hold?
  • 120. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise QuantifiersLet P(x,y) be the expression “x + y = y”. UniversalQuantifierLet Q(x,y) be the expression “xy = x”. ExistentialQuantifierThen the expression is Mixing
  • 121. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise Quantifiers Binding Variables Negation ∃x∀y (P(x,y) ∧ Q(x,y)) Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Express the statement “there is a number x such that when it is added to any number, the result is that number, and if it is multiplied by any number, the result is x” as a logical expression. Solution:
  • 122. Transcribing English into Logic Further25 /33 Examples & Mixing Quantifiers Exercise LogicOver what universe(s) of discourse does this statement Programming hold? This is the additive identity law and holds for N,Z,R,Q but does not hold for Z+.
  • 123. Examples & Binding Variables I Propositional Functions Example Quantifiers In the expression ∃x∀yP(x,y) both x and y are bound. Universal Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions When a quantifier is used on a variable x, we say that x is bound. If no quantifier is used on a variable in a predicate statement, it is called free.
  • 124. Examples & QuantifierExistential In the expression ∀xP(x,y), x is bound, but y is free. Quantifier Mixing Quantifiers BindingVariables A statement is called a well-formed formula, when all variables Negation are properly quantified. Logic Programming Transcribing English into Logic Further26 /33
  • 125. Examples & Binding Variables II Propositional Example Functions Quantifiers In the expression ∃x,y∀zP(x,y,z,c) the scope of the Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions The set of all variables bound by a common quantifier is the scope of that quantifier.
  • 126. Examples & UniversalQuantifier existential quantifier is {x,y}, the scope of the universal ExistentialQuantifier quantifier is just z and c has no scope since it is free. Mixing Quantifiers Binding Variables Negation Logic Programming Transcribing English into Logic Further27 /33
  • 127. Examples & Predicate Logic and Quantifiers CSE235 Introduction Just as we can use negation with propositions, we can use them with quantified expressions.
  • 128. Examples & Logic fact if the universe of discourse is finite, it is exactly De
  • 130. Examples & Negation Lemma P (x) be a predicate. Then the following hold. ¬∀xP (x) ≡∃ x¬P (x) ¬∃xP (x) ≡∀ x¬P (x)
  • 131. Examples & This is essentially a quantified version of De Morgan’s Law (in Further28 /33 Negation Truth Values Predicate Logic and Quantifiers CSE235 Introduction Statement True When False When
  • 132. Examples & Propositional Functions Propositional Functions Quantifiers Universal Quantifier Negation Logic Programming Transcribing English into Logic Further29 /33 ¬∃xP(x) ≡ ∀x¬P(x) For every x, P(x) is false. There is an x for which P(x) is true. ¬∀xP(x) ≡ ∃x¬P(x) There is an x for which P(x) is false. P(x) is true for every x. Existential Quantifier Mixing Quantifiers Binding Variables Table: Truth Values of Negated Quantifiers
  • 133. Prolog FunctionsProlog allows the user to express facts and rules PropositionalFacts are proposational functions: student(juana), Functions enrolled(juana,cse235), instructor(patel,cse235), etc. Quantifiers Predicate Logic and Quantifiers CSE235 Introduction Propositional Prolog (Programming in Logic) is a programming language based on (a restricted form of) Predicate Calculus. It was developped by the logicians of the artificial intelligence community for symbolic reasoning. Logic Further Examples & Exercises ?enrolled(juana,cse478) ?enrolled(X,cse478) ?teaches(X,juana)
  • 134. Rules are implications with conjunctions: Logic Programming teaches(X,Y) :- instructor(X,Z), enrolled(Y,Z) Transcribing English intoProlog answers queries such as: 30 /33 by binding variables and doing theorem proving (i.e., applying inference rules) as we will see in Section 1.5.
  • 135. 32 /33 Conclusion Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Logic Programming Logic is more precise than English. Transcribing English to Logic and vice versa can be tricky. When writing statements with quantifiers, usually the correct meaning is conveyed with the following combinations: Use ∀ with ⇒ Example: ∀xLion(x) ⇒ Fierce(x) ∀xLion(x) ∧ Fierce(x) means “everyone is a lion and
  • 136. Further Example: ∃xLion(x) ∧ Drinks(x,coffee): holds when you
  • 137. 32 /33 Conclusion English into Logic everyone is fierce” Transcribing English into Logic Use ∃ with ∧ Examples & Exercises have at least one lion that drinks coffee
  • 138. ∃xLion(x) ⇒ Drinks(x,coffee) holds when you have people even though no lion drinks coffee. 31 /33
  • 140. Propositional Logic Exercises Predicate Logic and Quantifiers CSE235 Introduction Examples? Exercises? Rewrite the expression, Functions Propositional Functions Quantifiers Logic Programming Transcribing English into Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...} and y ∈ {2,3,4,...}. Let Q(y) denote
  • 142. 32 /33 Conclusion Predicate Logic and Quantifiers CSE235 Examples? Exercises? Rewrite the expression, Introduction Propositional Functions Answer: Use the negated quantifiers and De Morgan’s law. Propositional Functions Further Examples & Exercises
  • 143. 32 /33 Conclusion Quantifiers Logic “”. When is Q(y) true? Predicate Logic and Quantifiers CSE235 Examples? Exercises? Rewrite the expression, Introduction Propositional Functions Answer: Use the negated quantifiers and De Morgan’s law. Logic Programming Transcribing English into Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...} and y ∈ {2,3,4,...}. Let Q(y) denote
  • 144. Propositional Functions Quantifiers Logic “”. When is Q(y) true? Answer: Only when y is a prime number. Further Examples & Exercises Logic Programming Transcribing English into Let P(x,y) denote “x is a factor of y” where x ∈ {1,2,3,...} and y ∈ {2,3,4,...}. Let Q(y) denote
  • 145. 32 /33 Conclusion Predicate Logic and Quantifiers CSE235 Introduction Propositional Functions Propositional Functions Quantifiers Logic Programming Transcribing English into Logic Some students wondered if ∀x,yP(x,y) ≡ ∀xP(x,y) ∧ ∀yP(x,y) This is certainly not true. In the left-hand side, both x and y are bound. In the right-hand side, x is bound in the first predicate, but y is free. In the second predicate, y is bound but x is free. All variables that occur in a propositional function must be bound to turn it into a proposition.
  • 146. Extra Question Further Examples & Exercises Thus, the left-hand side is a proposition, but the right-hand side is not. How can they be equivalent? 33 /33