0:00:19.180,0:00:23.164 Welcome to the second video on[br]Boolean logic and in this video 0:00:23.164,0:00:27.812 I would like to expose you to[br]the laws of logic. Now we know 0:00:27.812,0:00:30.800 now the different operations,[br]but like with everything else 0:00:30.800,0:00:34.784 in mathematics, there has to be[br]some sort of rule that governs 0:00:34.784,0:00:38.104 these operations. So let's go[br]through these loads of logics. 0:00:38.104,0:00:42.088 The first load that I would[br]like to mention to you. It's 0:00:42.088,0:00:43.416 called this double negative. 0:00:48.600,0:00:51.636 Basically, what happens[br]if I apply? 0:00:52.730,0:00:55.020 The negation or the not? 0:00:55.880,0:00:57.770 Twice to the same input. 0:00:58.900,0:01:03.544 But think about it,[br]what is not not P? 0:01:05.310,0:01:12.345 But if P is true then not P[br]is force and not force is true. 0:01:12.345,0:01:18.442 So I end up with the origonal[br]value that I started with and 0:01:18.442,0:01:20.318 remember that these three. 0:01:21.290,0:01:24.629 Lines together it's not just[br]simply equal, is logically 0:01:24.629,0:01:29.823 equivalent, so it doesn't matter[br]if I write not not P or Pi. Am 0:01:29.823,0:01:33.904 talking about exactly the same[br]thing, so they are very, very 0:01:33.904,0:01:37.985 closely connected. That was the[br]first low. Let's look at the 0:01:37.985,0:01:42.066 next loop, which we call the[br]important low. Now this is 0:01:42.066,0:01:46.147 important. Low gives us some[br]information about what to do. If 0:01:46.147,0:01:50.599 I applied the operation the same[br]input. So P&P. What is that 0:01:50.599,0:01:52.083 going to give me? 0:01:52.890,0:01:58.466 Well, P&P always going to[br]give me PY. 0:02:00.130,0:02:06.010 If P is true, then true and true[br]gives me true, which is what P 0:02:06.010,0:02:11.106 was. And if P is force than[br]force and force gives me force 0:02:11.106,0:02:16.594 which is again what P was. How[br]does that change if I have got 0:02:16.594,0:02:17.770 the OR operation? 0:02:18.370,0:02:23.974 P or P, but doesn't really[br]change because I end up again 0:02:23.974,0:02:28.644 with the same thing. True or[br]true gives me true. 0:02:29.240,0:02:33.299 Which was P1 force or[br]force again gives me 0:02:33.299,0:02:35.103 force which was P. 0:02:37.630,0:02:41.650 Let's look at the identity low[br]and this low. Now talking about 0:02:41.650,0:02:45.335 what happens if I combine[br]together and input with a true 0:02:45.335,0:02:46.340 or false value. 0:02:47.220,0:02:50.040 Soupy and true. 0:02:51.590,0:02:55.244 What is that logically[br]equivalent to think about it? 0:02:56.630,0:03:01.754 If three is true, true and true[br]will give me true, which was the 0:03:01.754,0:03:07.244 same as P. But if P is force[br]force and two gives me force, so 0:03:07.244,0:03:12.734 it doesn't matter if P is 2 or[br]4. If I combined together P with 0:03:12.734,0:03:17.492 an with a true using the end[br]operation, I always going to end 0:03:17.492,0:03:21.518 up with what P was. This true[br]doesn't really make any 0:03:21.518,0:03:23.348 difference in that what happens 0:03:23.348,0:03:29.701 now? If I use P or the[br]force symbol in here, Now if P 0:03:29.701,0:03:35.119 was true, two or four's give me[br]the true. But if P was forced 0:03:35.119,0:03:40.150 force or force again gives me[br]the force. So again I'm going to 0:03:40.150,0:03:45.181 end up with what P was soapy or[br]force is logically equivalent to 0:03:45.181,0:03:49.438 pee. Now these loads of logic[br]are really helpful because if 0:03:49.438,0:03:54.082 you have got a long complicated[br]logic sentence and you want to 0:03:54.082,0:03:55.243 make it simpler. 0:03:55.340,0:03:59.071 These are the rules. These are[br]the laws that you can apply to 0:03:59.071,0:04:02.515 break that complication down and[br]see a little bit easier what is 0:04:02.515,0:04:06.334 actually going on. The next load[br]is the only elation. 0:04:07.630,0:04:12.994 And the only elation is kind of[br]telling you when would your 0:04:12.994,0:04:17.911 input on Hill eight disappear.[br]So if you had called P. 0:04:18.670,0:04:21.870 And force. Remember. 0:04:23.230,0:04:27.136 Once you have got force in the[br]end gate, which was two types on 0:04:27.136,0:04:31.015 the same pipe. It doesn't matter[br]if P is on or off. 0:04:31.770,0:04:36.006 Water won't go through, so this[br]is always going to be force. 0:04:36.940,0:04:41.480 And what happens if you have got[br]P or true? 0:04:42.800,0:04:46.726 Basically, this is when you add[br]two branches of the water and it 0:04:46.726,0:04:50.350 doesn't matter if piece turned[br]on or off the water will always 0:04:50.350,0:04:53.974 be able to flow through the[br]other branch, so this is always 0:04:53.974,0:04:55.182 going to be true. 0:04:57.240,0:04:59.326 The next low is the inverse low. 0:05:02.520,0:05:07.085 So what happens if I add[br]together P and not P? 0:05:08.360,0:05:13.560 Well, if P is true then not[br]P is force. 0:05:14.170,0:05:19.721 And two through an force gives[br]me force. But what happens if P 0:05:19.721,0:05:22.283 is force if P is force? 0:05:23.060,0:05:26.036 Then not P is true, but. 0:05:26.610,0:05:31.355 False and true are still force.[br]So in this case I'm always going 0:05:31.355,0:05:33.910 to end up with a force answer. 0:05:34.840,0:05:38.943 And what happens if I have got P[br]or not P? 0:05:40.490,0:05:45.152 If P is true, not B is force,[br]but remember one of them is 0:05:45.152,0:05:49.481 true, so I'm going to end up[br]with a true sign in here. 0:05:51.250,0:05:55.534 If P is false, then not paying[br]history. So again I have got a 0:05:55.534,0:05:59.512 true sign in here, so I will[br]be able to get through with 0:05:59.512,0:06:02.572 the water, so this is always[br]going to be true. 0:06:05.460,0:06:08.740 Next, look commutative. You[br]probably familiar with this 0:06:08.740,0:06:12.840 term. You might have heard it[br]addition and sub multiplications 0:06:12.840,0:06:16.940 are being commutative and in[br]there. Basically what you meant 0:06:16.940,0:06:24.320 by is that 2 + 3 is same as[br]3 + 2 or 2 * 3 is the 0:06:24.320,0:06:29.240 same as 3 * 2, and that's[br]exactly what we mean by 0:06:29.240,0:06:34.980 commutative in here. P&Q is the[br]same as Q&P and I can also say 0:06:34.980,0:06:41.495 that. P or Q is exactly the same[br]as Q or P, so the operation in 0:06:41.495,0:06:45.906 which I put these inputs in[br]doesn't make difference as far 0:06:45.906,0:06:49.916 as the output concerned. Another[br]load that you probably familiar 0:06:49.916,0:06:53.926 with from algebra is associative[br]life. Remember that you could 0:06:53.926,0:06:58.738 use the brackets and you can[br]combine the brackets as long as 0:06:58.738,0:07:03.149 the same operation is concerned.[br]So what I mean by B&Q? 0:07:04.300,0:07:12.000 And R is exactly the same as[br]P&Q&R. Or if I apply to the 0:07:12.000,0:07:14.550 operation. P or Q. 0:07:15.560,0:07:22.088 Or are is exactly the same as P[br]or key or R? So as far as I'm 0:07:22.088,0:07:25.160 using exactly the same[br]operations, doesn't matter where 0:07:25.160,0:07:29.768 I place the bracket, the bracket[br]can be flexibly placed an it's 0:07:29.768,0:07:34.376 again sometimes quite good to[br]know to move around and be able 0:07:34.376,0:07:37.064 to manipulate these expressions[br]to simplify them. 0:07:38.900,0:07:43.094 One more low that could[br]be familiar from algebra 0:07:43.094,0:07:44.958 is the distributive law. 0:07:46.380,0:07:52.884 And what the distributive law[br]tells you that is P&Q or R 0:07:52.884,0:07:55.052 can be written as. 0:07:56.660,0:07:57.860 B&Q 0:07:59.000,0:08:03.848 or P&R. So what's[br]going on in here? 0:08:06.120,0:08:12.195 Your end operator distributed[br]amongst the two other inputs 0:08:12.195,0:08:15.570 and your or operator now. 0:08:16.440,0:08:19.050 Become in between the brackets. 0:08:20.490,0:08:24.277 And what happens[br]if I change these? 0:08:25.530,0:08:28.148 Operators if I use the OR here. 0:08:29.010,0:08:30.090 And the end here. 0:08:31.950,0:08:33.180 This is the same again. 0:08:35.000,0:08:37.130 P. Or Q. 0:08:38.190,0:08:44.946 And P or R. So again, I[br]can distribute my or operator. 0:08:46.900,0:08:51.014 Into the brackets and I can keep[br]the end operator between. 0:08:51.670,0:08:57.720 The brackets this is similar to[br]what happens in mathematics. If 0:08:57.720,0:09:05.420 you remember 2 * 3 + X,[br]you can rewrite it as 2 * 0:09:05.420,0:09:11.810 3 plus. Two times the X. OK,[br]so you're plus now here become. 0:09:12.410,0:09:15.402 The one in the middle and[br]the multiplication 0:09:15.402,0:09:16.898 distributed over the[br]addition. 0:09:19.410,0:09:23.386 Now I have introduced you to[br]quite a few laws of logic. In a 0:09:23.386,0:09:26.510 further video I will show you[br]the rest of the lows.