Presentation is loading. Please wait.

Presentation is loading. Please wait.

Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers.

Similar presentations


Presentation on theme: "Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers."— Presentation transcript:

1 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers

2 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 2 Predicates “x is greater than 3” This statement is neither true nor false when the value of the variable is not specified This statement has two parts:  The first part (subject) is the variable x.  The second (predicate) is “is greater than 3”.

3 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 3 Predicates We can denote this statement by P(x), where P denotes the predicate “is greater than 3”. Once a value has been assigned to x, the statement P(x) becomes a proposition and has a truth values P(x) is called Proposition function P at x  P(x1,x2,x3,………,xn).  P is called n-place or (n-ary) predicate.

4 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 4 Predicates Examples: Let P(x) denote “ x is greater than 3”. What are the truth values of P(4) and P(2)? Let Q(x, y) denote “x=y+3”. What are the truth values of Q(1,2) and Q(3,0)? Let A(c, n) denote “computer c is connected to network n”, suppose that the computer MATH1 is connected to network CAMPUS2, but not to network CAMPUS1, What are the truth values of A(MATH1, CAMPUS1) and A(MATH1, CAMPUS2)?

5 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 5 Quantifiers Universal quantification Which tell us that a predicate is true for every element under consideration( Domain / Discourse). The universal quantification of P(x) is the statement “P(x) for all values of x in the domain”  x P(x) read as “for all x P(x)” or “for every x P(x)”  is called universal quantifier

6 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 6 Quantifiers Existential quantification Which tell us that there is one or more element under consideration for which the predicate is true. The existential quantification of P(x) is the statement “there exists an element x in the domain such that P(x)”  x P(x) read as “there is an x such that P(x)” or “there is at least one x such that P(x)” or “for some x P(x)”  is called existential quantifier

7 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 7 Quantifiers The area of logic that deals with predicates and quantifiers is called predicate calculus.  x P(x) is True when: P(x) is true for every x False when: There is an x for which P(x) is false  x P(x) is True when: There is an x for which P(x) is true False when: P(x) is false for every x

8 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 8 Quantifiers Examples: Let Q(x) “x<2”. What is the truth value of  x Q(x) when the domain consists of all real numbers? Q(x) is not true for every real number x, for example Q(3) is false x =3 is a counterexample for the statement  x Q(x) Thus  x Q(x) is false

9 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 9 Quantifiers Examples: What is the truth value of  x (x 2  x) when the domain consists of: a) all real number? B) all integers? a ) is false because (0.5) 2  0.5, x 2  x is false for all real numbers in the range 0<x<1 b) is true because there are no integer x with 0<x<1

10 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 10 Quantifiers Examples: Let Q(x) “x>3”. What is the truth value of  x Q(x) when the domain consists of all real numbers? Q(x) is sometimes true, for example Q(4) is true Thus  x Q(x) is true

11 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 11 Quantifiers Examples: Let Q(x) “x=x+1”. What is the truth value of  x Q(x) when the domain consists of all real numbers? Q(x) is false for every real number Thus  x Q(x) is false

12 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 12 Quantifiers  Note that :  x Q(x) is false if there is no elements in the domain for which Q(x) is true or the domain is empty.  When all the elements in the domain can be listed x 1, x 2, x 3, x 4, ……., x n :   x Q(x) is the same as the conjunction Q(x1)  Q(x2)  ….  Q(xn)   x Q(x) is the same as the disjunction Q(x1)  Q(x2)  ….  Q(xn)  Precedence of quantifiers   and  have higher precedence than all logical operators     

13 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 13 Quantifiers Examples: Let Q(x) “x 2 <10”. What is the truth value of  x Q(x) when the domain consists of the positive integers not exceeding 4?   x Q(x) is the same as the conjunction  Q(1)  Q(2)  Q(3)  Q(4).  Q(4) is false. Thus  x Q(x) is false.

14 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 14 Quantifiers Examples: Let Q(x) “x 2 <10”. What is the truth value of  x Q(x) when the domain consists of the positive integers not exceeding 4?   x Q(x) is the same as the disjunction  Q(1)  Q(2)  Q(3)  Q(4).  Q(4) is false. Thus  x Q(x) is false

15 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 15 Quantifiers If domain consists of n (finite) object and we need to determine the truth value of.  x Q(x)  Loop through all n values of x to see if Q(x) is always true  If you encounter a value x for which Q(x) is false, exit the loop with  x Q(x) is false  Otherwise  x Q(x) is true  x Q(x)  Loop through all n values of x to see if Q(x) is true  If you encounter a value x for which Q(x) is true, exit the loop with  x Q(x) is true  Otherwise  x Q(x) is false

16 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 16 Quantifiers with restricted domain  The restriction of a universal quantification is the same as the universal quantification of a conditional statement  x 0) same as  x (x 0) “The square of a negative real number is positive”  The restriction of a existential quantification is the same as the existential quantification of a conjunction  z >0 (z 2 =2) same as  z(z>0  z 2 =2) “There is a positive square root of 2”

17 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 17 Binding variables  When a quantifier is used on the variable x, we say that this occurrence of the variable is bound.  x (x+y=1) The variable x is bounded by the existential quantification  x and the variable y is free  All variable that occur in a propositional function must be bound or equal to particular value to turn it into proposition.

18 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 18 Binding variables  Examples:  x (P(x)  Q(x))   x R(x) All variables are bounded The scope of  the first quantifier  x is the expression P(x)  Q(x),  second quantifier  x is the expression R(x) Existential quantifier binds the variable x in P(x)  Q(x) Universal quantifier binds the variable x in R(x)

19 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 19 Quantifiers  Other Quantifiers Uniqueness Quantifier  ! or  1 “  ! x P(x)” = “There exists a unique x such that P(x) is true”

20 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 20 Negating Quantified Expressions “Every student in this class has taken a calculus course”  xP(x) where P(x) is “x has taken a calculus course” Domain = “Students in class” Negation is “There is a student that has not taken a calculus course”  x  P(x)  xP(x)   x  P(x)

21 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 21 Negating Quantified Expressions If domain of P(x) consists of n elements “x 1,x 2,x 3,…,x n ” then  xP(x)   (P(x 1 )  P(x 2 )  P(x 3 )  …  P(x n )) by DeMorgan’s laws   P(x 1 )   P(x 2 )   P(x 3 )  …   P(x n )   x  P(x) De Morgan’s Lwas for Quantifiers  xP(x)   x  P(x)   xP(x)   x  P(x)

22 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 22 Nested Quantifiers Two quantifiers are nested if one is within the scope of another e.g.  x  y (x+y=0) Examples:  x  y(x+y=y+x)  x  y((x>0)  (y<0)  (xy<0))

23 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 23 Order of Nested Quantifiers Order of nested quantifiers is important if they are different. Example: If Q(x,y) denotes x+y=0, what are the truth values of quantifications  x  y Q(x,y)  x  y Q(x,y)  y  x Q(x,y)  y  x Q(x,y)

24 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 24 Negating Nested Quantifiers Example: Express the negation of  x  y(xy=1)  x  y(xy=1) by DeMorgan’s laws  x  y(xy=1)  x  y  (xy=1)  x  y(xy  1)

25 Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 25 Negating Nested Quantifiers Example: Express the statement (There does not exist a woman who has taken a flight on every airline in the world) Let P(w,f) be “w has taken f” and Q(f,a) be “f is a flight on a”, then  w  a  f(P(w,f)  Q(f,a))  w  a  f(P(w,f)  Q(f,a))  w  a  f(P(w,f)  Q(f,a))  w  a  f  (P(w,f)  Q(f,a))  w  a  f (  P(w,f)  Q(f,a))


Download ppt "Fall 2008/2009 I. Arwa Linjawi & I. Asma’a Ashenkity 1 The Foundations: Logic and Proofs Predicates and Quantifiers."

Similar presentations


Ads by Google