1 00:00:19,180 --> 00:00:23,164 Welcome to the second video on Boolean logic and in this video 2 00:00:23,164 --> 00:00:27,812 I would like to expose you to the laws of logic. Now we know 3 00:00:27,812 --> 00:00:30,800 now the different operations, but like with everything else 4 00:00:30,800 --> 00:00:34,784 in mathematics, there has to be some sort of rule that governs 5 00:00:34,784 --> 00:00:38,104 these operations. So let's go through these loads of logics. 6 00:00:38,104 --> 00:00:42,088 The first load that I would like to mention to you. It's 7 00:00:42,088 --> 00:00:43,416 called this double negative. 8 00:00:48,600 --> 00:00:51,636 Basically, what happens if I apply? 9 00:00:52,730 --> 00:00:55,020 The negation or the not? 10 00:00:55,880 --> 00:00:57,770 Twice to the same input. 11 00:00:58,900 --> 00:01:03,544 But think about it, what is not not P? 12 00:01:05,310 --> 00:01:12,345 But if P is true then not P is force and not force is true. 13 00:01:12,345 --> 00:01:18,442 So I end up with the origonal value that I started with and 14 00:01:18,442 --> 00:01:20,318 remember that these three. 15 00:01:21,290 --> 00:01:24,629 Lines together it's not just simply equal, is logically 16 00:01:24,629 --> 00:01:29,823 equivalent, so it doesn't matter if I write not not P or Pi. Am 17 00:01:29,823 --> 00:01:33,904 talking about exactly the same thing, so they are very, very 18 00:01:33,904 --> 00:01:37,985 closely connected. That was the first low. Let's look at the 19 00:01:37,985 --> 00:01:42,066 next loop, which we call the important low. Now this is 20 00:01:42,066 --> 00:01:46,147 important. Low gives us some information about what to do. If 21 00:01:46,147 --> 00:01:50,599 I applied the operation the same input. So P&P. What is that 22 00:01:50,599 --> 00:01:52,083 going to give me? 23 00:01:52,890 --> 00:01:58,466 Well, P&P always going to give me PY. 24 00:02:00,130 --> 00:02:06,010 If P is true, then true and true gives me true, which is what P 25 00:02:06,010 --> 00:02:11,106 was. And if P is force than force and force gives me force 26 00:02:11,106 --> 00:02:16,594 which is again what P was. How does that change if I have got 27 00:02:16,594 --> 00:02:17,770 the OR operation? 28 00:02:18,370 --> 00:02:23,974 P or P, but doesn't really change because I end up again 29 00:02:23,974 --> 00:02:28,644 with the same thing. True or true gives me true. 30 00:02:29,240 --> 00:02:33,299 Which was P1 force or force again gives me 31 00:02:33,299 --> 00:02:35,103 force which was P. 32 00:02:37,630 --> 00:02:41,650 Let's look at the identity low and this low. Now talking about 33 00:02:41,650 --> 00:02:45,335 what happens if I combine together and input with a true 34 00:02:45,335 --> 00:02:46,340 or false value. 35 00:02:47,220 --> 00:02:50,040 Soupy and true. 36 00:02:51,590 --> 00:02:55,244 What is that logically equivalent to think about it? 37 00:02:56,630 --> 00:03:01,754 If three is true, true and true will give me true, which was the 38 00:03:01,754 --> 00:03:07,244 same as P. But if P is force force and two gives me force, so 39 00:03:07,244 --> 00:03:12,734 it doesn't matter if P is 2 or 4. If I combined together P with 40 00:03:12,734 --> 00:03:17,492 an with a true using the end operation, I always going to end 41 00:03:17,492 --> 00:03:21,518 up with what P was. This true doesn't really make any 42 00:03:21,518 --> 00:03:23,348 difference in that what happens 43 00:03:23,348 --> 00:03:29,701 now? If I use P or the force symbol in here, Now if P 44 00:03:29,701 --> 00:03:35,119 was true, two or four's give me the true. But if P was forced 45 00:03:35,119 --> 00:03:40,150 force or force again gives me the force. So again I'm going to 46 00:03:40,150 --> 00:03:45,181 end up with what P was soapy or force is logically equivalent to 47 00:03:45,181 --> 00:03:49,438 pee. Now these loads of logic are really helpful because if 48 00:03:49,438 --> 00:03:54,082 you have got a long complicated logic sentence and you want to 49 00:03:54,082 --> 00:03:55,243 make it simpler. 50 00:03:55,340 --> 00:03:59,071 These are the rules. These are the laws that you can apply to 51 00:03:59,071 --> 00:04:02,515 break that complication down and see a little bit easier what is 52 00:04:02,515 --> 00:04:06,334 actually going on. The next load is the only elation. 53 00:04:07,630 --> 00:04:12,994 And the only elation is kind of telling you when would your 54 00:04:12,994 --> 00:04:17,911 input on Hill eight disappear. So if you had called P. 55 00:04:18,670 --> 00:04:21,870 And force. Remember. 56 00:04:23,230 --> 00:04:27,136 Once you have got force in the end gate, which was two types on 57 00:04:27,136 --> 00:04:31,015 the same pipe. It doesn't matter if P is on or off. 58 00:04:31,770 --> 00:04:36,006 Water won't go through, so this is always going to be force. 59 00:04:36,940 --> 00:04:41,480 And what happens if you have got P or true? 60 00:04:42,800 --> 00:04:46,726 Basically, this is when you add two branches of the water and it 61 00:04:46,726 --> 00:04:50,350 doesn't matter if piece turned on or off the water will always 62 00:04:50,350 --> 00:04:53,974 be able to flow through the other branch, so this is always 63 00:04:53,974 --> 00:04:55,182 going to be true. 64 00:04:57,240 --> 00:04:59,326 The next low is the inverse low. 65 00:05:02,520 --> 00:05:07,085 So what happens if I add together P and not P? 66 00:05:08,360 --> 00:05:13,560 Well, if P is true then not P is force. 67 00:05:14,170 --> 00:05:19,721 And two through an force gives me force. But what happens if P 68 00:05:19,721 --> 00:05:22,283 is force if P is force? 69 00:05:23,060 --> 00:05:26,036 Then not P is true, but. 70 00:05:26,610 --> 00:05:31,355 False and true are still force. So in this case I'm always going 71 00:05:31,355 --> 00:05:33,910 to end up with a force answer. 72 00:05:34,840 --> 00:05:38,943 And what happens if I have got P or not P? 73 00:05:40,490 --> 00:05:45,152 If P is true, not B is force, but remember one of them is 74 00:05:45,152 --> 00:05:49,481 true, so I'm going to end up with a true sign in here. 75 00:05:51,250 --> 00:05:55,534 If P is false, then not paying history. So again I have got a 76 00:05:55,534 --> 00:05:59,512 true sign in here, so I will be able to get through with 77 00:05:59,512 --> 00:06:02,572 the water, so this is always going to be true. 78 00:06:05,460 --> 00:06:08,740 Next, look commutative. You probably familiar with this 79 00:06:08,740 --> 00:06:12,840 term. You might have heard it addition and sub multiplications 80 00:06:12,840 --> 00:06:16,940 are being commutative and in there. Basically what you meant 81 00:06:16,940 --> 00:06:24,320 by is that 2 + 3 is same as 3 + 2 or 2 * 3 is the 82 00:06:24,320 --> 00:06:29,240 same as 3 * 2, and that's exactly what we mean by 83 00:06:29,240 --> 00:06:34,980 commutative in here. P&Q is the same as Q&P and I can also say 84 00:06:34,980 --> 00:06:41,495 that. P or Q is exactly the same as Q or P, so the operation in 85 00:06:41,495 --> 00:06:45,906 which I put these inputs in doesn't make difference as far 86 00:06:45,906 --> 00:06:49,916 as the output concerned. Another load that you probably familiar 87 00:06:49,916 --> 00:06:53,926 with from algebra is associative life. Remember that you could 88 00:06:53,926 --> 00:06:58,738 use the brackets and you can combine the brackets as long as 89 00:06:58,738 --> 00:07:03,149 the same operation is concerned. So what I mean by B&Q? 90 00:07:04,300 --> 00:07:12,000 And R is exactly the same as P&Q&R. Or if I apply to the 91 00:07:12,000 --> 00:07:14,550 operation. P or Q. 92 00:07:15,560 --> 00:07:22,088 Or are is exactly the same as P or key or R? So as far as I'm 93 00:07:22,088 --> 00:07:25,160 using exactly the same operations, doesn't matter where 94 00:07:25,160 --> 00:07:29,768 I place the bracket, the bracket can be flexibly placed an it's 95 00:07:29,768 --> 00:07:34,376 again sometimes quite good to know to move around and be able 96 00:07:34,376 --> 00:07:37,064 to manipulate these expressions to simplify them. 97 00:07:38,900 --> 00:07:43,094 One more low that could be familiar from algebra 98 00:07:43,094 --> 00:07:44,958 is the distributive law. 99 00:07:46,380 --> 00:07:52,884 And what the distributive law tells you that is P&Q or R 100 00:07:52,884 --> 00:07:55,052 can be written as. 101 00:07:56,660 --> 00:07:57,860 B&Q 102 00:07:59,000 --> 00:08:03,848 or P&R. So what's going on in here? 103 00:08:06,120 --> 00:08:12,195 Your end operator distributed amongst the two other inputs 104 00:08:12,195 --> 00:08:15,570 and your or operator now. 105 00:08:16,440 --> 00:08:19,050 Become in between the brackets. 106 00:08:20,490 --> 00:08:24,277 And what happens if I change these? 107 00:08:25,530 --> 00:08:28,148 Operators if I use the OR here. 108 00:08:29,010 --> 00:08:30,090 And the end here. 109 00:08:31,950 --> 00:08:33,180 This is the same again. 110 00:08:35,000 --> 00:08:37,130 P. Or Q. 111 00:08:38,190 --> 00:08:44,946 And P or R. So again, I can distribute my or operator. 112 00:08:46,900 --> 00:08:51,014 Into the brackets and I can keep the end operator between. 113 00:08:51,670 --> 00:08:57,720 The brackets this is similar to what happens in mathematics. If 114 00:08:57,720 --> 00:09:05,420 you remember 2 * 3 + X, you can rewrite it as 2 * 115 00:09:05,420 --> 00:09:11,810 3 plus. Two times the X. OK, so you're plus now here become. 116 00:09:12,410 --> 00:09:15,402 The one in the middle and the multiplication 117 00:09:15,402 --> 00:09:16,898 distributed over the addition. 118 00:09:19,410 --> 00:09:23,386 Now I have introduced you to quite a few laws of logic. In a 119 00:09:23,386 --> 00:09:26,510 further video I will show you the rest of the lows.