1 00:00:00,810 --> 00:00:02,460 We're going to talk about propositions 2 00:00:02,460 --> 00:00:04,820 and logical operations in this little clip, 3 00:00:04,820 --> 00:00:08,290 and let's begin then with a discussion of propositions. 4 00:00:08,290 --> 00:00:12,726 So to a mathematician and, in particular in this class, 5 00:00:12,726 --> 00:00:14,350 we're going to use the word proposition 6 00:00:14,350 --> 00:00:17,260 to refer to something that is either true or false. 7 00:00:19,820 --> 00:00:23,655 An example would be there are five regular solids. 8 00:00:23,655 --> 00:00:24,800 This happens to be true. 9 00:00:24,800 --> 00:00:27,170 In some terms we even prove it. 10 00:00:27,170 --> 00:00:32,290 It implies, for example, that if you wanted to place, let's say, 11 00:00:32,290 --> 00:00:36,660 100 fixed-position satellites around the earth 12 00:00:36,660 --> 00:00:39,140 in a uniform way, you can't do it 13 00:00:39,140 --> 00:00:43,050 because there isn't any 100 vertex regular solid. 14 00:00:43,050 --> 00:00:45,680 The biggest one is 20 vertices. 15 00:00:45,680 --> 00:00:46,570 OK. 16 00:00:46,570 --> 00:00:48,510 Well, if I change it to six, guess what? 17 00:00:48,510 --> 00:00:51,500 The assertion there are six regular solids is false. 18 00:00:51,500 --> 00:00:53,570 So that's a simple-minded example 19 00:00:53,570 --> 00:00:56,370 of two well-defined propositions, one of which 20 00:00:56,370 --> 00:00:57,800 is true, one of which is false. 21 00:00:57,800 --> 00:01:01,020 Propositions don't have to be true always. 22 00:01:01,020 --> 00:01:02,370 What are some non-examples? 23 00:01:02,370 --> 00:01:04,606 Well, wake up is not a proposition, 24 00:01:04,606 --> 00:01:05,730 because it's an imperative. 25 00:01:05,730 --> 00:01:08,310 It's not true or false, and where am I is a question. 26 00:01:08,310 --> 00:01:09,500 It's not true or false. 27 00:01:09,500 --> 00:01:13,380 And it's 3:00 PM is not a proposition, 28 00:01:13,380 --> 00:01:16,540 because it's true or false at any given moment, 29 00:01:16,540 --> 00:01:19,350 but whether or not it's true or false depends on the time, 30 00:01:19,350 --> 00:01:21,910 and that's a complication we don't want to get into. 31 00:01:21,910 --> 00:01:24,710 The idea is, a proposition is some fixed assertion that's 32 00:01:24,710 --> 00:01:29,390 either true forever or not true forever. 33 00:01:29,390 --> 00:01:33,180 Now, one of the reasons why mathematicians bring up 34 00:01:33,180 --> 00:01:36,620 this abstraction of propositions and the operations on them 35 00:01:36,620 --> 00:01:39,210 that we're about to see is that ordinary language tends 36 00:01:39,210 --> 00:01:43,020 to be ambiguous and that, of course, will cause problems 37 00:01:43,020 --> 00:01:47,125 in mathematical reasoning just as it would in a program. 38 00:01:47,125 --> 00:01:50,410 One of the most ambiguous of the phrases in English 39 00:01:50,410 --> 00:01:52,800 that connects propositions is Or. 40 00:01:52,800 --> 00:01:54,590 So let's look at this example. 41 00:01:54,590 --> 00:02:00,390 Greeks carry swords or javelins, and if I was transcribing this 42 00:02:00,390 --> 00:02:03,350 into precise math notation, I could 43 00:02:03,350 --> 00:02:08,919 say G for Greeks implies S for swords or J for javelin, 44 00:02:08,919 --> 00:02:13,660 so this is an assertion that if you're Greek, then 45 00:02:13,660 --> 00:02:15,900 you carry a sword or a javelin. 46 00:02:15,900 --> 00:02:17,961 Greeks implies sword or javelin. 47 00:02:17,961 --> 00:02:19,460 Really, I should say Greek soldiers, 48 00:02:19,460 --> 00:02:21,930 but let that be implicit. 49 00:02:21,930 --> 00:02:24,120 That's how we're going to translate this sentence 50 00:02:24,120 --> 00:02:30,830 into just using these operators to paraphrase what's going on. 51 00:02:30,830 --> 00:02:34,070 The problem is, what does Or mean? 52 00:02:34,070 --> 00:02:36,910 And it turns out that for javelins and swords 53 00:02:36,910 --> 00:02:38,910 it's true even if a Greek carries 54 00:02:38,910 --> 00:02:40,360 both a sword and a javelin. 55 00:02:40,360 --> 00:02:42,480 This is an inclusive Or. 56 00:02:42,480 --> 00:02:44,802 A Greek soldier would carry both a sword and a javelin 57 00:02:44,802 --> 00:02:47,260 because, in fact, a javelin is a good long-distance weapon, 58 00:02:47,260 --> 00:02:49,920 and a sword is good for defending yourself close in, 59 00:02:49,920 --> 00:02:52,900 and you certainly want to have both, especially after you've 60 00:02:52,900 --> 00:02:54,810 thrown your javelin, and you don't have 61 00:02:54,810 --> 00:02:57,510 anything left but the sword. 62 00:02:57,510 --> 00:02:59,920 Now, there's many standard notations 63 00:02:59,920 --> 00:03:03,410 for these logical connectives that build up 64 00:03:03,410 --> 00:03:06,790 larger propositions out of component propositions, 65 00:03:06,790 --> 00:03:09,720 so one of the things is this V symbol, or disjunction symbol, 66 00:03:09,720 --> 00:03:12,670 is used by logicians often instead of Or, 67 00:03:12,670 --> 00:03:15,290 and this arrow means implies or sometimes 68 00:03:15,290 --> 00:03:17,810 a double bar arrow also means implies, 69 00:03:17,810 --> 00:03:19,380 but we're not going to get into that. 70 00:03:19,380 --> 00:03:23,219 I'm not going ask you to memorize these symbols. 71 00:03:23,219 --> 00:03:25,260 We'll just stick to the words which don't take up 72 00:03:25,260 --> 00:03:27,060 that much more room. 73 00:03:27,060 --> 00:03:28,480 Let's look at another example. 74 00:03:28,480 --> 00:03:31,340 Greeks carry bronze or copper swords. 75 00:03:31,340 --> 00:03:33,350 Syntactically this has the same structure 76 00:03:33,350 --> 00:03:35,500 as the previous phrase, but we're 77 00:03:35,500 --> 00:03:37,200 going to translate it differently, 78 00:03:37,200 --> 00:03:39,660 and the reason is that we mean here 79 00:03:39,660 --> 00:03:42,940 that a Greek soldier is not going to carry both a bronze 80 00:03:42,940 --> 00:03:43,840 and copper sword. 81 00:03:43,840 --> 00:03:44,480 Why is that? 82 00:03:44,480 --> 00:03:47,752 Well, bronze swords are just way better than copper swords. 83 00:03:47,752 --> 00:03:49,210 They'll slice right through copper. 84 00:03:49,210 --> 00:03:52,420 They're much harder, and it's not 85 00:03:52,420 --> 00:03:55,760 worth the weight to carry this inferior copper sword when 86 00:03:55,760 --> 00:03:57,280 you have a much better one. 87 00:03:57,280 --> 00:04:01,260 So this time we mean the Greeks carry exactly one 88 00:04:01,260 --> 00:04:02,850 of a bronze or a copper sword. 89 00:04:02,850 --> 00:04:05,320 You'd carry a copper sword if you didn't have access 90 00:04:05,320 --> 00:04:06,520 to a bronze one. 91 00:04:06,520 --> 00:04:10,280 And so now we translate that into Greek implies 92 00:04:10,280 --> 00:04:15,520 B for bronze or C for copper, but this time we use the X Or. 93 00:04:15,520 --> 00:04:19,060 X Or means that one of them is true exactly 94 00:04:19,060 --> 00:04:22,540 but not both and not neither. 95 00:04:22,540 --> 00:04:26,110 Again, there's this plus sign notation for X Or, 96 00:04:26,110 --> 00:04:31,520 because as we'll see it acts a little bit like adding numbers 97 00:04:31,520 --> 00:04:37,010 by 2 where 1 plus 1 is 0. 98 00:04:37,010 --> 00:04:41,730 So let's be more precise about the two definitions of Or and X 99 00:04:41,730 --> 00:04:45,300 Or and how they work, and the assertion is 100 00:04:45,300 --> 00:04:48,510 that if I think of P and Q as placeholders for propositions 101 00:04:48,510 --> 00:04:52,800 that are either true or false, then the composite proposition 102 00:04:52,800 --> 00:04:57,420 P or Q is true if, and only if, P is true or Q is true 103 00:04:57,420 --> 00:05:00,220 or both are true, and I could express 104 00:05:00,220 --> 00:05:03,100 this assertion in English this, if and only if, 105 00:05:03,100 --> 00:05:06,010 by giving you a so-called truth table, where 106 00:05:06,010 --> 00:05:09,490 in these two columns or all these rows 107 00:05:09,490 --> 00:05:13,330 I've enumerated all the possible pairs of values of P and Q. 108 00:05:13,330 --> 00:05:15,940 So P and Q might both be true, that P 109 00:05:15,940 --> 00:05:19,820 might be true and Q false, P false, Q true, and both of them 110 00:05:19,820 --> 00:05:20,610 are false. 111 00:05:20,610 --> 00:05:23,900 And for each of those possible combinations of the truth 112 00:05:23,900 --> 00:05:28,435 values of Q and P, I tell you the truth value of P or Q, 113 00:05:28,435 --> 00:05:32,040 and the notable thing is this last row where I'm telling you 114 00:05:32,040 --> 00:05:35,770 that the only way that P or Q is false 115 00:05:35,770 --> 00:05:39,880 is if both P and Q are false. 116 00:05:39,880 --> 00:05:44,200 For X Or, as we said, the P or X Or Q 117 00:05:44,200 --> 00:05:46,640 is true if, and only if, exactly one of P and Q is true, 118 00:05:46,640 --> 00:05:49,190 so if I was expressing that as a truth table, 119 00:05:49,190 --> 00:05:52,130 we'd see that where there's TT is false, and where there's FF 120 00:05:52,130 --> 00:05:54,760 it's false, because it's not the case in either of those 121 00:05:54,760 --> 00:05:56,290 two rows that exactly one is true, 122 00:05:56,290 --> 00:05:58,560 but the middle row is exactly one is true. 123 00:05:58,560 --> 00:06:01,230 And so P X or Q is true. 124 00:06:01,230 --> 00:06:03,380 So this truth table is just a precise way 125 00:06:03,380 --> 00:06:06,835 of defining how X Or acts on truth values. 126 00:06:09,391 --> 00:06:11,640 There's another connective, And, which works even more 127 00:06:11,640 --> 00:06:12,390 straightforwardly. 128 00:06:12,390 --> 00:06:15,090 The value of P and Q is true if, and only if, 129 00:06:15,090 --> 00:06:17,890 both P and Q are true, and there's this truth table. 130 00:06:17,890 --> 00:06:21,900 Again, the salient row is that it's true only if, and only 131 00:06:21,900 --> 00:06:25,850 if, both P and Q are true. 132 00:06:25,850 --> 00:06:29,420 Another crucial logical operation 133 00:06:29,420 --> 00:06:31,340 is the negation operation, or Not. 134 00:06:31,340 --> 00:06:36,150 So Not P just flips the truth value of P. If P is true, 135 00:06:36,150 --> 00:06:37,280 then not P is false. 136 00:06:37,280 --> 00:06:39,850 If not P is true, then P is false, 137 00:06:39,850 --> 00:06:42,900 and there it's very trivial truth table, 138 00:06:42,900 --> 00:06:45,630 trivial because there's only two values to be concerned about. 139 00:06:45,630 --> 00:06:47,510 When P is true, not P is false. 140 00:06:47,510 --> 00:06:50,250 When P is false, not P is true. 141 00:06:53,010 --> 00:06:57,920 One of the places that this notion of combining 142 00:06:57,920 --> 00:07:01,770 basic propositions to using logical operations 143 00:07:01,770 --> 00:07:04,720 to build up more complicated composite proposition 144 00:07:04,720 --> 00:07:05,500 is in programming. 145 00:07:05,500 --> 00:07:08,950 Here's a typical kind of phrase that comes from Java. 146 00:07:08,950 --> 00:07:10,690 Java uses this double vertical bar 147 00:07:10,690 --> 00:07:13,000 to mean Or, inclusive by the way, 148 00:07:13,000 --> 00:07:16,310 and double ampersand to mean And, so in Java 149 00:07:16,310 --> 00:07:18,730 this is a piece of legitimate Java code 150 00:07:18,730 --> 00:07:22,650 that's doing a test to evaluate this expression, if X 151 00:07:22,650 --> 00:07:26,010 is greater than 0 or X is less than or equal to 0 152 00:07:26,010 --> 00:07:29,930 and Y is greater than 100, then if that test comes out 153 00:07:29,930 --> 00:07:32,630 to be true, then you do a bunch of code 154 00:07:32,630 --> 00:07:36,320 that follows the test up to some delimiter that tells you 155 00:07:36,320 --> 00:07:37,820 where to stop. 156 00:07:37,820 --> 00:07:40,390 And if it's false, you just skip all that stuff and go on. 157 00:07:40,390 --> 00:07:43,170 So we use sort of Boolean expressions 158 00:07:43,170 --> 00:07:46,550 or logical expressions like this in a very standard way in most 159 00:07:46,550 --> 00:07:48,850 programming languages. 160 00:07:48,850 --> 00:07:51,840 The other place where these operations come up 161 00:07:51,840 --> 00:07:56,360 is in digital logic, and the digital circuit designers 162 00:07:56,360 --> 00:07:58,570 have their own notation, which I'll just mention, 163 00:07:58,570 --> 00:08:01,470 but we're not, again, impose on you but you should be aware. 164 00:08:01,470 --> 00:08:04,330 One notation they use that we'll use as well because it's 165 00:08:04,330 --> 00:08:07,780 so economical is that not X can be abbreviated 166 00:08:07,780 --> 00:08:09,470 by writing a bar over the X. 167 00:08:09,470 --> 00:08:12,120 More generally, not a complicated expression 168 00:08:12,120 --> 00:08:14,780 can be abbreviated by writing a bar 169 00:08:14,780 --> 00:08:16,330 over the complicated expression. 170 00:08:16,330 --> 00:08:17,970 I just saved some space, and so we'll 171 00:08:17,970 --> 00:08:20,330 use it, but not the following. 172 00:08:20,330 --> 00:08:25,280 In digital logic, the idea is that you're 173 00:08:25,280 --> 00:08:29,325 talking about circuits where the only distinction of the signal 174 00:08:29,325 --> 00:08:31,200 that's coming in electrically is whether it's 175 00:08:31,200 --> 00:08:34,429 a high voltage or a low voltage, with high voltage is denoted 176 00:08:34,429 --> 00:08:37,809 by 1, and low voltage denoted by 0, 177 00:08:37,809 --> 00:08:40,190 and the way that digital logic behaves 178 00:08:40,190 --> 00:08:43,140 is that the 1 corresponds to true at the 0 corresponds 179 00:08:43,140 --> 00:08:44,510 to false. 180 00:08:44,510 --> 00:08:50,250 Then the And operation is simply multiplication, because the 1 181 00:08:50,250 --> 00:08:52,930 or 0 times 1 or 0 is 1 only when both of them 182 00:08:52,930 --> 00:08:55,390 are 1 for ordinary multiplication, which 183 00:08:55,390 --> 00:08:59,070 is exactly the way And behaves when 1 means true and 0 184 00:08:59,070 --> 00:09:00,600 means false. 185 00:09:00,600 --> 00:09:03,160 Unfortunately, the digital designers 186 00:09:03,160 --> 00:09:04,900 use Plus when they mean Or. 187 00:09:04,900 --> 00:09:07,330 They do not mean that 1 plus 1 is 2. 188 00:09:07,330 --> 00:09:11,360 They mean that 1 plus 1 is 1, and just a thing 189 00:09:11,360 --> 00:09:12,280 to watch out four. 190 00:09:12,280 --> 00:09:14,960 That's part of the reason we're not going to use this notation. 191 00:09:14,960 --> 00:09:18,270 Let's just stick to our ordinary word notation 192 00:09:18,270 --> 00:09:20,780 that we give on the right.