Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:

Similar presentations


Presentation on theme: "1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:"— Presentation transcript:

1 1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050: Understanding and Constructing Proofs Spring 2006

2 2 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Lecture Objectives Learn how to use quantifiers and predicates Start practicing translating between logic and English

3 3 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is a predicate? A property that one or several variables referenced in a statement can have. “x>3” is a predicate. We can denote it P(x) x is the variable What is the truth value for P(1)? –replace x by 1 in x>3. The truth value of 1>3 is false. What is the truth value for P(5)?

4 4 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac In analysis –y=3x+1 is a propositional function P(x,y) –All points for which P(x,y) is true define a line –Hence the predicate P provides an implicit definition of the line In geometry –Let P(B) be the predicate AB  N>0 where A is a point, N a vector (direction), and  the dot product – All points B satisfying P(B) are on the same side of the line passing through A and being orthogonal to N In programming –if (x>9) {x=0;} else {x=x+1;}; –Tests the predicate (x>9) and if true, resets x to 0, if not, increments it. How are predicates used? ABN

5 5 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to evaluate a propositional function? Let Q(x,y) denote the predicate “(x>0)  (x<y)”. Q(x,y) is a propositional function. It does not yet have a value. It will have a value when we assign values to all its variables. What are the values of the propositional function Q for the following n-tuples (x,y) : –Q(1,2) –Q(3,3) –Q(–1,2)

6 6 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the universal quantifier? We may be interested in stating that some propositional function is true for all values of a variable x –“x<x+1” is true for all numbers We can use the universal quantifier, denoted  : –  x, x<x+1  x P(x), means “for every x, the predicate P is true” –Do not say “for any x”, because “any” is ambiguous in English “I do not see any reason to go out with him.”

7 7 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the universe of discourse? The proposition (  x, x<x 2 ) is not true in general. But it is true if we restrict the domain from which x is to be taken. Such a domain is called the universe of discourse. Let P(x) be the statement “x<x 2 ” –What is the truth value of the quantification  x P(x) when the universe of discourse consists of all real numbers larger than 1? –What is it when the universe of discourse consists of all real numbers? Then, the statement is false. Then, the statement (  x, x<x 2 ) is false. We prove it by counter-example. We only need to find a value in the universe of discourse that makes the predicate evaluate to false. We prove it by counter-example. We only need to find a value (0) in the universe of discourse that makes the predicate (x<x 2 ) evaluate to false.

8 8 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to enlarge the domain? “Every student in this class will learn Processing” –Let P(x) denoted “x will learn Processing” Formulation with an implicit domain –Assume that the universe of discourse is all the students in this class –  x, P(x) Formulation with an explicit domain –Assume that the universe of discourse is all students –Let Q(x) denote “x is in this class” –  x, Q(x)  P(x)

9 9 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the existential quantifier?  x, P(x) is the existential qualification of predicate P(x) It is a proposition It means “there exists an element x in the universe of discourse such that P(x) is true” Is the statement “  x, P(x)” true when the predicate P(x) is “x=x 2 ” and the universe of discourse is the set of integers?

10 10 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the uniqueness quantifier? ∃ !x means “there exists one and only one x, such that” – ∃ ! x  N x – 2 = 4 Sometimes the notation !x is used to mean “there is at most one x”

11 11 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Equivalent formulations for finite domain Assume that the domain (universe of discourse) is finite and has only two elements {a, b}  x P(x) can be written as a conjunction P(a)  P(b)  x P(x) can be written as a conjunction P(a)  P(b)

12 12 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to negate quantifications? What is the negation of the quantification  x P(x) ? –“It is not true that for each x, P(x)” –“There is at least one x (in the universe of discourse) for which  P(x)” –  x,  P(x) –What is the negation of “All teachers at GT are great”? What is the negation of the quantification  x P(x) ? –“It is not true that there exists an x for which P(x)” –“For all x (in the universe of discourse), P(x) is not true” –“For all x (in the universe of discourse),  P(x)” –  x,  P(x) –What is the negation of “There is a great teacher at GT.”? “It is not true that there is a great teacher at GT” “Every teacher at GT is not great” Note that “All teachers are not great” would be ambiguous in English and could be understood as “Not all teachers are great”

13 13 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What are free/bound variables? A variable x is bound when it is assigned a value or quantified using  or , otherwise it it free To turn a propositional function into a proposition (that must have a truth value), all its variables must be bound

14 14 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is the scope of a quantifier? A quantifier has a scope, outside of which the variable it bounds is free. –(  x, P(x))  (  x, Q(x)) can be written (  x, P(x))  (  y, Q(y)) because the scopes are disjoint

15 15 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What is an argument? A series of statements (premises followed by a conclusion) From Alice in Wonderland –Premise 1: All lions are fierce –Premise 2: Some Lions do not drink coffee –Conclusion: Some fierce creatures do not drink coffee Translate it into logic –Let the universe of discourse be all creatures –P(x) means “x is a lion” –Q(x) means “x is fierce” –R(x) means “x drinks coffee” –Premise 1:  x, P(x)  Q(x) –Premise 2:  x, P(x)  R(x) –Conclusion:  x, Q(x)  R(x)

16 16 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What are examples of nested quantifiers Assume that the universe of discourse is the real numbers  x  y : x+y=y+x // + is commutative –  x(  y : x+y=y+x)  x  y  z : x+(y+z)=(x+y)+z // + is associative –  x (  y (  z : x+(y+z)=(x+y)+z))  x  y : x+y=0 // every number has an inverse –  x (  y : x+y=0)  x: (  y : x+y=0  (  z: z  y  x+y  0 )) // inverse is unique  x  y : (x>0)  (y>0)  x+y>0// sum of positives is positive  >0,  >0,  x: (|x–a|<   |f(x)–L|<  )// limit of f

17 17 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to negate nested quantifiers? Negate  x  y : (xy=1) no negation should precede a quantifier  (  x  y : (xy=1) )  x  (  y : (xy=1) )  x  y :  (xy=1)  x  y : xy  1

18 18 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Why is the order of quantifiers important? Let the domain (universe of discourse) be the set of real numbers  y  x : (x+y=0) is true (each number has an inverse)  x  y : (x+y=0) is false (counterexample, pick y=1-x)

19 19 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac How to implement nested quantifiers This program tests whether  i  j : (i  j)  (T[i])=T[j]) is true for a finite set of indices i and j in [0,n[. Change it to test whether  i  !j : (i  j)  (T[i])=T[j]) is true for a finite set of indices i and j in [0,n[. int n=6; int T[] = new int [n]; T[0]=10; T[1]=12; T[2]=10; T[3]=12; T[4]=10; T[5]=12; boolean trueValue=true; for (int i=0; i<n; i++) { boolean foundMatch=false; for (int j=0; j<n; j++) {if ((i!=j)&&(T[i]==T[j])) {foundMatch=true;};}; if (foundMatch==false) {trueValue=false;}; }; println("truevalue="+trueValue);

20 20 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Revisions Review slides for L01b Review Sections 1.3 and 1.4 Review the slides in this presentation and make sure that you can answer the questions in the headings

21 21 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Assigned Exercises You need to know how to solve these exercises for the quiz on the next lecture page 40: 1.3-5, 1.3-7 page 41: 1.3-23 page 42: 1.3-30e, 1.3-32d page 43: 1.3-30e, 1.3-46, 1.3-55 page 52: 1.4-9j page 53: 1.13-n

22 22 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Assigned Reading Read 1.5 for the next lecture and learn the key concepts (inference, resolution, fallacy) and the methods of proving theorems. –There will be a simple question on the quiz about one of these concepts Look at the exercises listed at the end of the slides for L03. Try to do them. Bring your solutions to class. Mark all difficulties you may have. Check at the end of next lecture if you still have these difficulties.

23 23 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Assigned Project Implement P0 (due January 17) Use processing to debug your solution to test whether  i  !j : (i  j)  (T[i])=T[j]) Read P1 and start working on it (due January 24)

24 24 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac What will be on the next quiz A question or two testing your understanding of the concepts covered in Sections 1.3 and 1.4. Some (variation) of two or three of the exercises listed above. A question testing your ability to modify a simple algorithm written in Processing to assess the truth value of a predicate with nested qualifiers. A simple question testing that you have read Section 1.5 with care.

25 25 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Check what we have learned What is a predicate? What is an argument? Rewrite removing the negation:  (  x  y : (xy=1) )

26 26 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Visibility Two sets, A and B Two points a  A, b  B O is the occluder A, B, and O are disjoint (a,b) is the line segment from a to b a–b  O  (a,b) = , “ a sees b” a | b  O  (a,b) ≠ , “a is occluded from b by O” a b BA O a b BA O

27 27 Georgia Tech, IIC, GVU, 2006 MAGIC Lab http://www.gvu.gatech.edu/~jarekJarek Rossignac Define 4 visibility situations HIDDEN: H O (A,B) –B is entirely hidden from A by O –? GUARDED: G O (A,B) –B can be guarded from any point of A –? SURVEYED: S O (A,B) –All B can be seen from some point of A –? EXPOSED: E O (A,B) –All B can be seen from every point of A –? a b BA O B A B A O a b B A O O


Download ppt "1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 02: QUANTIFIERS Sections 1.3 and 1.4 Jarek Rossignac CS1050:"

Similar presentations


Ads by Google