Docsity

Propositional Functions and Quantifiers, Slides of Law of Evidence

Toggle sidebar
bg1
UNIT 2
PREDICATES &
QUANTIFIERS
Mathematical Foundations of Computing
Predicate Logic
Predicate logic is used to express the meaning of a
wide range of statements in mathematics and computer
science in ways that permit us to reason and explore
relationships between objects.
To understand predicate logic, we first need to
introduce the concept of a predicate. Afterward, we will
introduce the notion of quantifiers, which enable us to
reason with statements that assert that a certain
property holds for all objects of a certain type and with
statements that assert the existence of an object with a
particular property.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15

Partial preview of the text

Download Propositional Functions and Quantifiers and more Slides Law of Evidence in PDF only on Docsity!

UNIT 2

PREDICATES &

QUANTIFIERS

Mathematical Foundations of Computing

Predicate Logic

Predicate logic is used to express the meaning of a wide range of statements in mathematics and computer science in ways that permit us to reason and explore relationships between objects.  To understand predicate logic, we first need to introduce the concept of a predicate. Afterward, we will introduce the notion of quantifiers, which enable us to reason with statements that assert that a certain property holds for all objects of a certain type and with statements that assert the existence of an object with a particular property.

CONSIDER The statement "x is greater than 3" This statement is neither true nor false as the value of variable x is not specified) This statement has two parts: The first part, the variable x, is the subject of the statement. The second part- the predicate, "is greater than 3"-refers to a property that the subject of the statement can have. We can denote the statement "x is greater than 3" by P (x), Where: P denotes the predicate "is greater than 3" and x is the variable. The statement P(x) is also said to be the value of the propositional function P at x. Once a value has been assigned to the variable x , the statement P (x) becomes a proposition and has a truth value Propositional Functions ( 1 )  Consider P(x) = x < 5 What is the truth value of:  P(x)?  has no truth values (x is not given a value)  P(1)?  is true: The proposition 1<5 is true  P(10)?  is false: The proposition 10<5 is false  P(x) will create a proposition when given a valueExample: Let P(x) = “x is a multiple of 5” For what values of x, P(x) is true?

QuantifiersWhen the variables in a propositional function are assigned values, the resulting statement becomes a proposition with a certain truth value.However, there is another important way, called quantification, to create a proposition from a propositional function.Quantification expresses the extent to which a predicate is true over a range of elementsWe’ll study two types of quantification :

**1. The universal quantification

  1. Existential quantification** Universal Quantifiers 1  Represented by an upside-down A: ()  It means “for all”  Let P(x) = x+1 > x  We can state the following:  x P(x)  English translation: “for all values of x, P(x) is true”  English translation: “for all values of x, x+1>x is true”  An element for which P(x) is false is called a counterexample of x P(x)

Universal Quantifiers 2  But is that always true?  x P(x)  You need to specify the universe!  What values x can represent  Called the “ domain ” or “ universe of discourse ” Universal Quantifiers 3Let P(x) = x/2 < x what’s the truth value of x P(x) when the universe is the real numbers (R).  Remember: The real numbers include all the whole numbers, rational numbers, irrational numbers such as √2 (1.41421356...)  Not true for the negative numbers (All the negative numbers are counterexample)!  Thus, x P(x) is false  In order to prove that a universal quantification is true, it must be shown true for ALL cases (for ALL elements of the domain)In order to prove that a universal quantification is false, it must be shown to be false for only ONE case (for only ONE element of the domain)

Existential Quantification 2  Note that you still have to specify your universe  Let P(x) = x+1 < x, where the universe is R. What is the truth value of x P(x)?  There is no numerical value x for which x+1<x, Thus, x P(x) is false Existential Quantification 3  Let P(x) = x+1 > x, where the universe is R. What is the truth value of x P(x)?  There is a numerical value for which x+1>x  In fact, it’s true for all of the values of x  Thus,  x P(x) is true  In order to show an existential quantification is true, you only have to find ONE valueIn order to show an existential quantification is false, you have to show it’s false for ALL values

Existential Quantification 4  Given some propositional function P(x)  And values in the universe x 1 .. xn  The existential quantification x P(x) implies: P(x 1 )  P(x 2 )  …  P(xn) The meaning of the universal and Existential quantifiers

Binding Variables 1  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  The part of a logical expression to which a quantifier is applied is called the scope of this quantifier.  Eg.: In the statement ∃x (P(x) ∧ Q(x)) ∨ ∀x R(x), all variables are bound.  The scope of the first quantifier, ∃x, is the expression P(x) ∧ Q(x) because ∃x is applied only to P(x) ∧ Q(x), and not to the rest of the statement.  In other words, the existential quantifier binds the variable x in P(x)∧Q(x) Binding Variables 2  Let P(x,y) be x > y  Consider: x P(x,y)  Is this a proposition (assuming the universe of X is defined)?  NO. What is y?  Note that y is free (not “bound” by a quantifier).  Therefore,x P(x, y) discussed in the above example is not a proposition.

Binding Variables 3 EXAMPLE: Which of the following statements is a proposition, assuming that the domains of x and y are defined?(x P(x))Q(x)The x in Q(x) is not bound; thus not a proposition(x P(x))(x Q(x))Both x values are bound; thus it is a proposition(x (P(x)Q(x)))(y R(y))All variables are bound; thus it is a proposition(x P(x)Q(y))(y R(y))The y in Q(y) is not bound; this not a proposition Translating from English_ Translate (express) the following statement as a logical expression if the universe of discourse is all people.Every student in this class has studied calculus.  Let:  S(x) be “x is a student in this class”  C(x) be “x has studied calculus”  x (S(x)C(x)) Wrong! Why?  because this way the statement says that all people are students in this class and have studied calculus  Right way:x (S(x)→C(x))

Translating from English_ S(x) be “x is a student” M(x) be “x has visited Mexico” C(x) be “x has visited Canada”

 “Every student in this class has visited Canada or Mexico”

1) If the universe of discourse is all students then

 x (C(x)  M(x))

2) When the universe of discourse is all people

 x (S(x)→(C(x)  M(x))

Negating QuantificationsThe rules for negating quantifiers are called the De Morgan’s laws for quantifiers.To negate a universal quantification:  Change it to an existential quantification  AND negate the propositional function  ¬x P(x) =x ¬P(x)To negate an existential quantification:  Change it to a universal quantification  AND negate the propositional function  ¬x P(x) =x ¬P(x)

Let P(x) be the statement “x^2 − 1 = 0”, where the domain is the set of real numbers (R)What’s the truth value ofx P(x) FalseWhat’s the truth value ofx P(x) TrueWhat’s the truth value of  x P(x) x P(x) ≡ x  P(x) ≡ x (x 2 − 1 ≠ 0). TrueWhat’s the truth value of  x P(x) x P(x) ≡ x P(x) ≡ x (x 2 − 1 ≠ 0). False Negating Quantifications_Example 1 Negating Quantifications_Example 2

Find the negation of the statement

"There is an excellent student"

where the domain consists of all students.

Solution : Let S (x) denote "x is excellent student" Then the statement "There is an excellent student “ is represented by  x S(x) The negation of this statement is ¬x S(x) , which is equivalent to  x ¬S(x). Thus the negation can be expressed in many ways including "Every student is not excellent“ “All students are not excellent"

Negating Quantifications_Example 5 Show that ¬x [P(x) → Q(x)] and x [P(x)  ¬Q(x)] are logically equivalent Solution ¬x [P(x) → Q(x)]  x (¬[P(x) → Q(x)]) De Morgan's  x (¬[¬P(x)  Q(x)]) De Morgan's  x [P(x)  ¬Q(x)] Nested Quantifiers  You can have multiple quantifiers on a statement: 1)xy P(x,y)  “For all x, there exists a y such that P(x,y) is true”  In other words: “For every x, there exists it is own y such that P(x,y) is true”  Example: xy (x+y == 0)  Also this is similar to: x Q(x) where Q(x) is y P(x, y) 2)xy P(x,y)  “There exists an x such that for all y P(x,y) is true”  xy (x*y == 0)  In working with quantifications of more than one variable, it is sometimes helpful to think in terms of nested loops.

Order of Quantifiers (1)Note thatxy andxy are NOT equivalent!

Example 1: Determine the truth value of  x  y P(x,y),

where P(x,y) = (x+y == 0) if the domain of x and y are

real numbers

Answer:

xy P(x,y) is false, Because there is no real number x such

that x + y = 0 for all real numbers y

Example 2: Determine the truth value of  x  y P(x,y),

where P(x,y) = (x+y == 0) if the domain of x and y are

real numbers

Answer:

xy P(x,y) is true

Order of Quantifiers (2)

Solution

Suppose that x and y are assigned values

 x y z Q(x, y, z) means "For all x and for all y, there is a z such that x + y = z" and is true  z x y Q(x, y, z) means "There is a z such that for all x and for all y it is true that x + y = z" It is false because

there is no value of z that satisfies the equation x + y = z

for all values of x and y

The order of the quantifiers here is important

Let Q(x, y, z) be the statement "x + y = z" What are the truth

values of the statements

x y z Q(x, y, z) and z x y Q(x, y, z), where the domain

of all variables consists of all real numbers?

Translating EnglishNested Quantifiers (1)The product of two negative integers is positive

 x  y ((x<0)  (y<0) → (xy > 0))

The average of two positive integers is positive

 x  y ((x>0)  (y>0) → ((x+y)/2 > 0))

The difference of two negative integers can be non- negative

 x  y ((x<0)  (y<0)  ((x-y) ≥0))

The absolute value of the sum of two integers does not exceed the sum of the absolute values of these integers

 x  y (|x+y| ≤ |x| + |y|)

Translating EnglishNested Quantifiers (2) Express (translate) the following statement as a logical expression involving predicates, quantifiers and logical connectives. The domain consists of all people. "If a person is female and is a parent, then this person is someone's mother" Solution :

 This statement can be rephrased as

"For every person x, if person x is female and person x is a parent, then there exists a person y such that person x is the mother of person y."

 Let F(x) represent "x is female,"

P(x) represent "x is a parent," M (x, y) represent "x is the mother of y."

 The given statement can be represented as:

x (( F(x)P(x)) →y M(x, y))

 Because y is not in scope (the part of a logical expression to which a quantifier

is applied) of universal quantifier then we can move y to the left after x. We obtain the logically equivalent expression  xy (( F(x)P(x)) → M(x, y))

Translating EnglishNested Quantifiers (3) Express (translate) the following statement as a logical expression involving predicates, quantifiers and logical connectives. The domain consists of all people. "Everyone has exactly one best friend" Solution  This statement can be rephrased as "For every person x, person x has exactly one best friend y”.  This means that “there is a person y who is the best friend of x, and furthermore, that for every person z, if person z is not the person y, then z is not the best friend of x.  Let B(x, y) be the statement "y is the best friend of x"  Then our original statement can be expressed as:  xy(B (x , y)   z (( z ≠ y) → ¬B(x, z))). Translating Nested QuantifiersEnglish (1)   xy (((x≥0)(y<0)) → (x-y > 0)) A non-negative number minus a negative number is greater than zero   xy (((x≤0)(y≤0))(x-y > 0)) The difference between two non-positive numbers can be positive   xy (((x≠0)(y≠0)) ↔ (xy ≠ 0)) The product of two non-zero numbers is non-zero if and only if both factors are non-zero