1 00:00:00,920 --> 00:00:02,840 PROFESSOR: The logic of predicates 2 00:00:02,840 --> 00:00:06,390 is a basic concept in mathematical language 3 00:00:06,390 --> 00:00:08,430 as well as being a topic on its own. 4 00:00:08,430 --> 00:00:12,120 In particular, I'm going to talk now about the idea of the two 5 00:00:12,120 --> 00:00:13,980 so-called quantifiers. 6 00:00:13,980 --> 00:00:16,326 For all-- that's the upside-down A. 7 00:00:16,326 --> 00:00:21,300 And exists-- that's the backward E. 8 00:00:21,300 --> 00:00:23,780 So what's a predicate? 9 00:00:23,780 --> 00:00:25,840 Basically, a predicate is a proposition, 10 00:00:25,840 --> 00:00:27,360 except it's got variables in it. 11 00:00:27,360 --> 00:00:28,590 Here's an example. 12 00:00:28,590 --> 00:00:32,750 P of x, y is the predicate that depends on x and y. 13 00:00:32,750 --> 00:00:38,240 And let's say it's defined to be x plus 2 equals y. 14 00:00:38,240 --> 00:00:40,300 Now, in order to figure out whether or not 15 00:00:40,300 --> 00:00:42,050 a predicate is true, I need to know 16 00:00:42,050 --> 00:00:44,960 the values of the variables-- in this case, x and y. 17 00:00:44,960 --> 00:00:51,110 So if I tell you that x is 1 and that y is 3, guess what? 18 00:00:51,110 --> 00:00:55,000 P of 1 and 3-- P of x and y when x is 1 and y is 3-- 19 00:00:55,000 --> 00:00:58,960 is true, because in fact, 1 plus 2 is equal to 3. 20 00:00:58,960 --> 00:01:04,940 If I tell you that x is 1 and y is 4, then since 1 plus 2 21 00:01:04,940 --> 00:01:08,070 is not equal to 4, P of 1 and 4 is false. 22 00:01:08,070 --> 00:01:10,420 On the other hand, since P of 1 and 4 is false, 23 00:01:10,420 --> 00:01:15,030 that makes not P of 1 and 1 true. 24 00:01:15,030 --> 00:01:18,380 That's the easy part. 25 00:01:18,380 --> 00:01:22,810 Now the quantifiers are read as "for all" and "exists." 26 00:01:22,810 --> 00:01:25,700 But they control a variable. 27 00:01:25,700 --> 00:01:29,600 So I write "for all x," it means-- sorry. 28 00:01:29,600 --> 00:01:33,060 I write upside-down Ax and I read it as "for all x." 29 00:01:33,060 --> 00:01:35,820 I'm so used to reading it that I forgot that I needed 30 00:01:35,820 --> 00:01:37,930 to read symbols literally. 31 00:01:37,930 --> 00:01:43,330 And backwards Ey is read as "there exists some y." 32 00:01:43,330 --> 00:01:47,080 So let's see how that would work. 33 00:01:47,080 --> 00:01:50,450 The upside-down A, for all, acts like an AND. 34 00:01:50,450 --> 00:01:54,130 To understand what it means, let's look at this example. 35 00:01:54,130 --> 00:01:59,770 Let's let a variable s range over the staff members in 6.042 36 00:01:59,770 --> 00:02:05,640 at this term, of whom there are about 30 counting the graders. 37 00:02:05,640 --> 00:02:08,009 Let's define a predicate that depends on the variable 38 00:02:08,009 --> 00:02:13,160 s called P of s that says that s is pumped about 6.2042. 39 00:02:13,160 --> 00:02:15,360 They're enthusiastic about being on the staff. 40 00:02:15,360 --> 00:02:16,380 OK. 41 00:02:16,380 --> 00:02:20,350 If I tell you for all s, P of s, that's 42 00:02:20,350 --> 00:02:24,430 exactly the same as saying that P of Drew is true, 43 00:02:24,430 --> 00:02:27,890 and P of Peter is true, and P of Keshav is true, 44 00:02:27,890 --> 00:02:31,450 and a whole bunch more ANDs down to P of Michaela. 45 00:02:31,450 --> 00:02:35,210 They'll be 29 ANDs if there are 30 staff members. 46 00:02:38,180 --> 00:02:42,110 Similarly, the backwards E-- there exists-- acts like an OR. 47 00:02:42,110 --> 00:02:47,060 If I tell you that t is now ranging over the 6.042 staff 48 00:02:47,060 --> 00:02:51,380 just as s was, and I write B of t, the predicate of t 49 00:02:51,380 --> 00:02:57,590 means the staff member t took 6.042 before, 50 00:02:57,590 --> 00:03:01,100 then if I tell you that there exists a t B of t, what I'm 51 00:03:01,100 --> 00:03:04,910 telling you is that B of Drew-- either Drew took it before, 52 00:03:04,910 --> 00:03:08,010 or Peter took it before, or Deshav took it before, 53 00:03:08,010 --> 00:03:10,310 or Michaela took it before. 54 00:03:10,310 --> 00:03:12,950 This statement is true, because in fact, 55 00:03:12,950 --> 00:03:17,040 several of the staff members took 6.042 from me before. 56 00:03:17,040 --> 00:03:20,330 And I'd like to think that the previous one-- that everybody's 57 00:03:20,330 --> 00:03:23,140 pumped up on the staff-- is true, although I 58 00:03:23,140 --> 00:03:25,670 can't guarantee that. 59 00:03:25,670 --> 00:03:30,600 So let's do a little practice with existential quantifiers. 60 00:03:30,600 --> 00:03:32,870 So let's agree that the variables x and y 61 00:03:32,870 --> 00:03:36,850 will range, for this example, over the non-negative integers. 62 00:03:36,850 --> 00:03:40,330 And let's consider the following predicates 63 00:03:40,330 --> 00:03:46,550 about y that says that there's some x that's less than y. 64 00:03:46,550 --> 00:03:49,860 Q of y is there exists an x that x is less than y. 65 00:03:49,860 --> 00:03:52,110 Let's see what happens. 66 00:03:52,110 --> 00:03:54,290 Well, what about Q of 3? 67 00:03:54,290 --> 00:03:58,710 Q of 3 is saying that there is an x such 68 00:03:58,710 --> 00:04:01,660 that x is less than 3. 69 00:04:01,660 --> 00:04:05,010 Well, an example of such an x is 1. 70 00:04:05,010 --> 00:04:07,720 So that means there is an x that's less than 3, 71 00:04:07,720 --> 00:04:08,340 because 1 is. 72 00:04:08,340 --> 00:04:11,650 And so that makes this Q true. 73 00:04:11,650 --> 00:04:13,590 All right, what about Q of 1? 74 00:04:13,590 --> 00:04:18,579 Well, again, there's an x that's a non-negative integer, namely 75 00:04:18,579 --> 00:04:20,610 0, that's less than 1. 76 00:04:20,610 --> 00:04:22,400 And therefore, Q of 1 is true. 77 00:04:22,400 --> 00:04:25,870 On the other hand, Q of 0 is false 78 00:04:25,870 --> 00:04:30,940 because there is no non-negative integer that's less than 0. 79 00:04:30,940 --> 00:04:33,360 And so there's no value that you can 80 00:04:33,360 --> 00:04:35,970 assign to x that's a non-negative integer that 81 00:04:35,970 --> 00:04:37,580 will make it less than 0. 82 00:04:37,580 --> 00:04:42,210 OK, that one's not so bad, I hope. 83 00:04:42,210 --> 00:04:44,900 Let's look at the same example with the universal quantifier. 84 00:04:44,900 --> 00:04:49,410 This time, we'll say that R of y means that for every x, 85 00:04:49,410 --> 00:04:51,360 x is less than y. 86 00:04:51,360 --> 00:04:54,080 Well, R of 1 is false. 87 00:04:54,080 --> 00:04:56,850 And the reason is that 5 is a counterexample. 88 00:04:56,850 --> 00:04:58,250 5 is not less than 1. 89 00:04:58,250 --> 00:05:01,890 And so it's not true that every x is less than 1. 90 00:05:01,890 --> 00:05:06,240 R of 8 is false because 12 is not less than 8. 91 00:05:06,240 --> 00:05:10,490 And therefore, not every x is less than 8. 92 00:05:10,490 --> 00:05:13,870 R of a googol, 10 to the 100th, is false. 93 00:05:13,870 --> 00:05:17,130 Because if you let x be a googol, 94 00:05:17,130 --> 00:05:18,620 it's not less than a googol. 95 00:05:18,620 --> 00:05:22,540 And so it's an example of the fact that this doesn't hold 96 00:05:22,540 --> 00:05:24,190 for all x's. 97 00:05:24,190 --> 00:05:26,171 That part's obvious. 98 00:05:26,171 --> 00:05:26,670 OK. 99 00:05:29,770 --> 00:05:32,110 The thing that tends to confuse people in the beginning 100 00:05:32,110 --> 00:05:35,040 is what happens when you start mixing up quantifiers. 101 00:05:35,040 --> 00:05:36,740 So let's look at an intuitive example 102 00:05:36,740 --> 00:05:38,920 first that might help you remember 103 00:05:38,920 --> 00:05:41,760 what happens when you have an A followed by an E. 104 00:05:41,760 --> 00:05:46,495 And then we'll look at an E followed by an A. 105 00:05:46,495 --> 00:05:48,535 So suppose I look at this statement. 106 00:05:48,535 --> 00:05:50,160 This time, I'm going to tell you that v 107 00:05:50,160 --> 00:05:53,410 ranges over the possible computer viruses, not 108 00:05:53,410 --> 00:05:54,870 biological viruses. 109 00:05:54,870 --> 00:05:59,960 d ranges over antivirus software, 110 00:05:59,960 --> 00:06:02,120 defenses against viruses. 111 00:06:02,120 --> 00:06:05,420 And I want to look at the predicate that 112 00:06:05,420 --> 00:06:09,750 says for every virus, there is a defense such 113 00:06:09,750 --> 00:06:13,230 that d protects against v. This defense is good 114 00:06:13,230 --> 00:06:14,860 against that virus. 115 00:06:14,860 --> 00:06:19,670 All right, so each virus, I have a defense for. 116 00:06:19,670 --> 00:06:24,530 So an example would be-- these are, by the way, dated viruses, 117 00:06:24,530 --> 00:06:26,430 but that's when the slides were made. 118 00:06:26,430 --> 00:06:29,430 So against the Mydoom virus, you could use 119 00:06:29,430 --> 00:06:32,160 Defender, Microsoft Defender. 120 00:06:32,160 --> 00:06:35,110 Against the ILOVEYOU virus, you could use Norton. 121 00:06:35,110 --> 00:06:39,700 Against the Bablas virus, you could use ZoneAlarm. 122 00:06:39,700 --> 00:06:42,000 Well, is that what we want? 123 00:06:42,000 --> 00:06:43,550 It's expensive. 124 00:06:43,550 --> 00:06:47,280 It means that for every different virus, 125 00:06:47,280 --> 00:06:48,410 I need a different defense. 126 00:06:48,410 --> 00:06:50,150 I have to spend a fortune on software. 127 00:06:50,150 --> 00:06:52,470 This is not what we want. 128 00:06:52,470 --> 00:06:56,040 So that's when for every virus, there's a defense, 129 00:06:56,040 --> 00:06:58,920 but the quantifiers are in the wrong order. 130 00:06:58,920 --> 00:07:00,290 Let's reverse them. 131 00:07:00,290 --> 00:07:03,580 Suppose I tell you that there's one defense that's 132 00:07:03,580 --> 00:07:04,710 good for all viruses. 133 00:07:04,710 --> 00:07:07,370 There is a defense such that for every virus, 134 00:07:07,370 --> 00:07:14,900 d protects against v. For example, if d is MITviruscan, 135 00:07:14,900 --> 00:07:17,590 then it would be wonderful if it was true 136 00:07:17,590 --> 00:07:20,260 that d protects against all viruses, 137 00:07:20,260 --> 00:07:23,680 there's one defense good against every attack. 138 00:07:23,680 --> 00:07:29,630 That's what we want because it's a lot cheaper. 139 00:07:29,630 --> 00:07:33,020 All right, let's start looking at a concrete mathematical 140 00:07:33,020 --> 00:07:33,520 example. 141 00:07:36,690 --> 00:07:39,610 And I hope that that prelude with the viruses 142 00:07:39,610 --> 00:07:42,315 will help you decipher how the quantifiers behave. 143 00:07:45,380 --> 00:07:51,240 So let's look at this predicate now. 144 00:07:51,240 --> 00:07:53,250 Sorry, this is a proposition. 145 00:07:53,250 --> 00:07:56,240 It really doesn't depend on the values of x and y. 146 00:07:56,240 --> 00:07:59,920 It's asking about all possible x's and all possible y's, 147 00:07:59,920 --> 00:08:01,280 whether there is one. 148 00:08:01,280 --> 00:08:05,730 In order to figure out whether a proposition like G is true, 149 00:08:05,730 --> 00:08:10,130 actually, I do need to know what x and y are ranging over. 150 00:08:10,130 --> 00:08:13,300 Because as you'll see, whether or not G comes out to be true 151 00:08:13,300 --> 00:08:14,850 will depend on that. 152 00:08:14,850 --> 00:08:19,830 So I'm going to look at the domain of discourse 153 00:08:19,830 --> 00:08:22,250 that x and y range over. 154 00:08:22,250 --> 00:08:24,800 And we'll suppose that the domain 155 00:08:24,800 --> 00:08:28,750 is the non-negative integers. 156 00:08:28,750 --> 00:08:33,520 So now, what G is saying is that if you give me 157 00:08:33,520 --> 00:08:38,669 a non-negative integer x, there is a y that's greater than x. 158 00:08:38,669 --> 00:08:42,260 In other words, I can find another non-negative integer 159 00:08:42,260 --> 00:08:44,039 that's bigger than x. 160 00:08:44,039 --> 00:08:45,510 Well, that's certainly true. 161 00:08:45,510 --> 00:08:47,800 There's a simple recipe for finding y. 162 00:08:47,800 --> 00:08:48,660 Give me an x. 163 00:08:48,660 --> 00:08:52,180 Let's choose y to be x plus 1, or x plus 2. 164 00:08:52,180 --> 00:08:53,990 But I don't necessarily need a recipe 165 00:08:53,990 --> 00:08:56,440 as long as somewhere out there, there's 166 00:08:56,440 --> 00:08:58,790 a y that's bigger than x. 167 00:08:58,790 --> 00:08:59,920 This is true. 168 00:08:59,920 --> 00:09:02,947 So G is true when the domain of discourse 169 00:09:02,947 --> 00:09:04,155 is the non-negative integers. 170 00:09:06,670 --> 00:09:11,670 On the other hand, when I change the domain of discourse, 171 00:09:11,670 --> 00:09:13,380 different things can happen. 172 00:09:13,380 --> 00:09:17,700 So let's look at the negative integers, the integers less 173 00:09:17,700 --> 00:09:22,210 than 0, and ask, is it true that for every x, 174 00:09:22,210 --> 00:09:25,340 there's a y that's greater than x? 175 00:09:25,340 --> 00:09:27,540 Well, for a lot of them, there is. 176 00:09:27,540 --> 00:09:33,310 If x is minus 3, then minus 2 is bigger than x. 177 00:09:33,310 --> 00:09:36,320 If x is minus 2, then minus 1 is bigger than x. 178 00:09:36,320 --> 00:09:37,850 But then I'm in trouble. 179 00:09:37,850 --> 00:09:43,640 If x is minus 1, there's no negative integer 180 00:09:43,640 --> 00:09:45,380 that's bigger than x. 181 00:09:45,380 --> 00:09:49,920 And so G is false when the domain of discourse 182 00:09:49,920 --> 00:09:53,010 is the negative integers. 183 00:09:53,010 --> 00:09:56,257 Well, let's shift again, the point being here 184 00:09:56,257 --> 00:09:58,090 both we're looking at alternate quantifiers, 185 00:09:58,090 --> 00:10:02,050 and we're understanding that the truth 186 00:10:02,050 --> 00:10:04,970 of a proposition with quantifies depends crucially 187 00:10:04,970 --> 00:10:06,616 on the domain of discourse. 188 00:10:06,616 --> 00:10:07,990 If we let the domain of discourse 189 00:10:07,990 --> 00:10:10,850 be the negative reals, then what this is saying 190 00:10:10,850 --> 00:10:16,060 is that for every negative real, there's a bigger negative real. 191 00:10:16,060 --> 00:10:17,270 And that, of course, is true. 192 00:10:17,270 --> 00:10:21,840 Because if you give me a negative real r, then r 193 00:10:21,840 --> 00:10:25,730 over 2, because it's negative, is actually bigger than r. 194 00:10:25,730 --> 00:10:32,670 And it will not be positive if r isn't positive. 195 00:10:32,670 --> 00:10:37,910 So sure enough, G in this case is true. 196 00:10:37,910 --> 00:10:39,700 All right, let's reverse the qualifiers 197 00:10:39,700 --> 00:10:40,580 and see what happens. 198 00:10:40,580 --> 00:10:42,900 It's worth thinking about. 199 00:10:42,900 --> 00:10:46,390 So let's call H the assertion that for every y-- sorry, 200 00:10:46,390 --> 00:10:51,690 that there exists a y such that for every x, x is less than y. 201 00:10:51,690 --> 00:10:53,570 So intuitively, what this is saying 202 00:10:53,570 --> 00:10:57,100 is there's a biggest element. 203 00:10:57,100 --> 00:10:59,980 Y is bigger than everything. 204 00:10:59,980 --> 00:11:02,580 Well, if the domain is the non-negative integers, 205 00:11:02,580 --> 00:11:05,460 then H is false because there's no biggest 206 00:11:05,460 --> 00:11:07,540 non-negative integer. 207 00:11:07,540 --> 00:11:09,040 If it's the negative integers, it's 208 00:11:09,040 --> 00:11:12,580 false because there's no biggest negative integer. 209 00:11:12,580 --> 00:11:15,130 If it's the negative reals, it's false 210 00:11:15,130 --> 00:11:18,350 because there's no biggest negative real. 211 00:11:18,350 --> 00:11:19,930 But the truth is that this thing is 212 00:11:19,930 --> 00:11:26,770 going to be false in any domain of discourse in which 213 00:11:26,770 --> 00:11:28,380 less than is behaving as it should 214 00:11:28,380 --> 00:11:34,100 because all any y is not going to be bigger than itself. 215 00:11:34,100 --> 00:11:38,115 So you can't possibly find a biggest y. 216 00:11:38,115 --> 00:11:39,740 It would have to be bigger than itself. 217 00:11:39,740 --> 00:11:42,470 This is going to be false in all of the sensible domains 218 00:11:42,470 --> 00:11:45,700 where less than behaves as we would expect. 219 00:11:45,700 --> 00:11:47,630 So let's make this slightly more interesting 220 00:11:47,630 --> 00:11:52,030 and make that less than or equal to. 221 00:11:52,030 --> 00:11:54,030 So now, it's actually possible that there 222 00:11:54,030 --> 00:11:58,480 could be a biggest element that is 223 00:11:58,480 --> 00:12:01,666 greater than or equal to everything including itself. 224 00:12:01,666 --> 00:12:03,040 And if you look at these domains, 225 00:12:03,040 --> 00:12:07,850 well, there this isn't any greatest non-negative integer, 226 00:12:07,850 --> 00:12:10,942 because for any x, plus 1 is bigger. 227 00:12:10,942 --> 00:12:14,920 There isn't any biggest negative real-- same reasoning. 228 00:12:14,920 --> 00:12:19,800 For any r, r/2 is going to be bigger. 229 00:12:19,800 --> 00:12:23,680 But for the negative integers, there 230 00:12:23,680 --> 00:12:27,920 is a biggest y, namely minus 1. 231 00:12:27,920 --> 00:12:32,870 It's greater than or equal to every other negative integer.