0% found this document useful (0 votes)
29 views

Discrete Mathematics: MATH-161

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Discrete Mathematics: MATH-161

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 25

National University of Sciences & Technology (NUST)

School of Electrical Engineering and Computer Science (SEECS)


Department of Basic Sciences

Discrete Mathematics
MATH-161

Lecture # 13

Course Instructor: Dr Saira Zainab


Cell # :03325193283
Email: [email protected]
Office # 207, IAEC
1
Binding Variables
When a quantifier is used on the variable x, we say that
this occurrence of the variable is bound. An occurrence
of a variable that is not bound by a quantifier or set
equal to a particular value is said to be free.
All the variables that occur in a propositional function
must be bound or set equal to a particular value to turn
it into a proposition. This can be done using a
combination of universal quantifiers, existential
quantifiers, and value assignments.
Example: ∃x(x + y = 1)
Example: ∃x(P (x) ∧ Q(x)) ∨ ∀xR(x)
Nested Quantifiers
Two quantifiers are nested if one is within the scope of
the other, such as ∀ x ∃ y such that (x + y = 0).
Note that everything within the scope of a quantifier
can be thought of as a propositional function.
For example, ∀ x ∃ y such that (x + y = 0), is the same
thing as ∀ x, Q(x), where Q(x) is ∃ y P(x, y), where
P(x, y) is x + y = 0.
Nested quantifiers commonly occur in mathematics
and computer science.
To understand these statements involving many
quantifiers, we need to unravel what the quantifiers
and predicates that appear mean.
Interpreting Multiply-Quantified Statements
A college cafeteria line has four stations: salads, main
courses, desserts, and beverages. The salad station
offers a choice of green salad or fruit salad; the main
course station offers spaghetti or fish; the dessert station
offers pie or cake; and the beverage station offers milk,
soda, or coffee. Three students, Uta, Tim, and Yuen, go
through the line and make the following choices:

Uta: green salad, spaghetti, pie, milk


Tim: fruit salad, fish, pie, cake, milk, coffee
Yuen: spaghetti, fish, pie, soda

These choices are illustrated in Figure


Interpreting Multiply-Quantified Statements

Write each of following statements informally and find its truth value.
a. ∃ an item I such that ∀ students S, S chose I .
b. ∃ a student S such that ∀ items I, S chose I .
c. ∃ a student S such that ∀ stations Z, ∃ an item I in Z such that S chose I .
d. ∀ students S and ∀ stations Z, ∃ an item I in Z such that S chose I .
Interpreting Multiply-Quantified Statements

Solution
a.There is an item that was chosen by every student. This is true;
every student chose pie.
b. There is a student who chose every available item. This is false;
no student chose all nine items.
c. There is a student who chose at least one item from every
station. This is true; both Uta and Tim chose at least one item from
every station.
d. Every student chose at least one item from every station. This is
false; Yuen did not choose a salad.
Interpreting Multiply-Quantified Statements

Translate these statements into English, where


the domain for each variable consists of all real
numbers.
a)∃x∀y (xy = y)
b)∀x∀y (((x ≥ 0) ∧ (y < 0)) → (x − y > 0))
Interpreting Multiply-Quantified Statements

a) There exists a real number x such that for every real number y ,
xy = y . (This is asserting the existence of a multiplicative identity
for the real numbers, and the statement is true, since we can
take x = 1).
b) For every real number x and real number y , if x is nonnegative
and y is negative, then the difference x − y is positive. (Or, more
simply, a nonnegative number minus a negative number is
positive (which is true)).
Interpreting Multiply-Quantified Statements
Interpreting Multiply-Quantified Statements

a) Randy Goldberg is enrolled in CS 252.


b) Someone is enrolled in Math 695.
c) Carol Sitea is enrolled in some course.
d) Some student is enrolled simultaneously in Math 222 and CS
252.
e) There exist two distinct people, the second of whom is enrolled
in every course that the first is enrolled in.
f) There exist two distinct people enrolled in exactly the same
courses.
Multiple Quantified Statements Informally
a.∀ positive numbers x, ∃ a positive number y such that
y<x
b.∃ a positive number x such that ∀ positive numbers y ,
y<x

Sol: a. Given any positive number, there is another


positive number that is smaller than the given number

b. There is a positive number with the property that all


positive numbers are smaller than this number.
Thinking of Quantification as Loops
In working with quantifications of more than one variable,
it is sometimes helpful to think in terms of nested loops.

For example, to see whether ∀x∀yP (x, y) is true:

•We loop through the values for x, and for each x we


loop through the values for y.
•If we find that P (x, y) is true for all values for x and y,
we have determined that ∀x∀yP (x, y) is true.
•If we ever hit a value x for which we hit a value y for
which P (x, y) is false, we have shown that
∀x∀yP (x, y) is false.
Thinking of Quantification as Loops
To determine whether ∀x∃yP (x, y) is true:

•We loop through the values for x. For each x we loop


through the values for y until we find a y for which P(x,y)
is true.

•If for every x we hit such a y, then ∀x∃yP (x, y) is true;

•If for some x we never hit such a y, then ∀x∃yP (x, y) is


false.
Multiple Quantified Statements Informally
•To see whether ∃x∀yP (x, y) is true, we loop through
the values for x until we find an x for which P (x, y) is
always true when we loop through all values for y. Once
we find such an x, we know that ∃x∀yP (x, y)is true. If
we never hit such an x, then we know that
∃x∀yP (x, y)is false.

•Finally, to see whether ∃x∃yP (x, y) is true, we loop


through the values for x, where for each x we loop
through the values for y until we hit an x for which we hit
a y for which P (x, y) is true. The statement ∃x∃yP (x, y)
is false only if we never hit an x for which we hit a y such
that P (x, y) is true.
Multiple Quantified Statements Informally
The statements ∃y∀xP (x, y) and ∀x∃yP (x, y) are not
logically equivalent.
The statement ∃y∀xP (x, y) is true if and only if there is a
y that makes P (x, y) true for every x. So, for this
statement to be true, there must be a particular value of
y for which P (x, y) is true regardless of the choice of x.

On the other hand, ∀x∃yP (x, y) is true if and only if for


every value of x there is a value of y for which P (x, y) is
true. So, for this statement to be true, no matter which x
you choose, there must be a value of y (possibly
depending on the x you choose) for which P (x, y) is
true.
Multiple Quantified Statements Informally
In other words, in the second case (∀x∃yP (x, y)), y can
depend on x, whereas in the first case (∃y∀xP (x, y)), y
is a constant independent of x.

From these observations, it follows that if ∃y∀xP (x, y) is


true, then ∀x∃yP (x, y) must also be true. However, if
∀x∃yP (x, y) is true, it is not necessary for ∃y∀xP (x, y)
to be true.
Multiple Quantified Statements formally
a. Every body loves some body
b. Some body loves every body
c. Any even integer equals twice some other integer
d. There is a program that gives the correct answer to
every question that is posed to it.
Sol: a. ∀ people x, ∃ a person y such that x loves y.
b. ∃ a person x such that ∀ people y , x loves y.
c. ∀ even integers m, ∃ integers n, n = 2m.
d. ∃ a program P such that ∀ questions it gives correct
answer.
Multiple Quantified Statements formally
Express each of these system specifications using predicates,
quantifiers, and logical connectives, if necessary.
a)At least one console must be accessible during every fault
condition. ∀f (H(f) → ∃c A(c))
(where A(x) means that console x is accessible, and H(x) means
that fault condition x is happening)
b)The e-mail address of every user can be retrieved whenever the
archive contains at least one message sent by every user on the
system. (∀u∃m (S(u, m))) → R(u)
(S(u, m) means that user u sent m messages , and R(u) means
that the e-mail address of user u can be retrieved.)
Multiple Quantified Statements formally
Examples
a) ∀ integers n, ∃ an integer k such that n = 2k.

b) ∃ a person x such that ∀ people y, x loves y.

Sol: a. ∃ an integer n such that ∀ integers k,n 2k


Or we can say
“ there is a some integer that is not even”
b. ∀ people x, ∃ a person y such that x does not love y.
Or we can say
“ Nobody Loves everybody”
Example
Write the following statement in English, using the
predicates
C(x): “x is a Computer Science major”
T (x, y): “x is taking y”
where x represents students and y represents courses:
∀y ∃x (~C(x) ∧ T (x, y)).
Solution:
The statement ∀y ∃x (~C(x) ∧ T (x, y)) says that for
every course y there is a student x such that x is not a
Computer Science major and x is taking y. That is,
“In every course there is a student who is not a
Computer Science major.”
Example
Translate into English the statement
∀ x ∀ y {(x > 0) ∧ (y < 0) → (x·y < 0)},
where the domain for both variables consists of all real
numbers.
Solution: This statement says that for every real number x
and for every real number y, if x > 0 and y < 0, then x·y < 0.
That is, this statement says that for real numbers x and y.
This can be stated more succinctly as
"The product of a positive real number and a negative real
number is always a negative real number”.
Cont….
Write the following statements in English, using the
predicate S(x, y): “x shops in y”, where x represents
people and y represents stores:
(a) ∀ y S(john, y).
(b) ∃ x∀ y S(x, y).
Sol: (a) The predicate states that if y is a store, then
john shops there. i.e.,
“john shops in every store.”
(b) The predicate states that there is a person x with the
property that x shops in every store y. That is,
“There is a person who shops in every store.”
Table for the Quantification of two variables
Try as much as you can from…

Relevant Exercises given at the end of Section 1.4 of :

Discrete Mathematics and its Applications


(with Combinatorics and Graph Theory)
6th Edition, The McGraw-Hill Companies, 2007,
Kenneth H. Rosen

(Already uploaded on LMS)

You might also like