### Video Transcription

00:00

Hello everyone. Welcome back to intrude a python here on Cyber Eri On demand as always, I'm your instructor, Joe Perry And today we're here talking about programming basic, specifically focusing on logic. This is part two of less than one in part to we're gonna be discussing

00:13

the laws of logic. So here's our 1st 1 law of ID impotence Now the love I'd impotence or the love I components, depending on the accent of the person who taught it to you, is very similar to the law of identity and arithmetic. Basically, all it's saying is that when you perform an operation with only one input a or a a A and A,

00:31

the output is just going to be whatever the input waas,

00:34

the obvious exited. The obvious exception from that is the inverse operation or the logical inversion operation which will flip the input but with Oren And it will just be whatever the input waas This may seem obvious, but it is actually one of the fundamental parts of Boolean logic. Sort of the way that 11 equals one is actually a fundamental proof of mathematics.

00:54

The law of association, the law of associations kind of a trickier one. I don't really like any of the verbal definitions that are given, which is why I just used the equations and a true table here to help you understand it. Basically, with lot of association is is that if all other things are equal, if you're performing the same operation with all of your inputs, it doesn't matter the order in which it's done

01:11

normally order matters and logic you're going to a very similarly with mathematics

01:17

inversion is going to be is going to come first, and then you're gonna do whatever's in parentheses. We're gonna do whatever's in parentheses and then inversion. Parentheses will always come first, of course, with mathematics. So here you can see this is just an easy demonstration that nothing changes in these types of equations when you move the parentheses around because all other things are equal,

01:38

The law of computation is simply saying that the order of operations, the order of inputs to a single operation don't matter. A and B is the same as B and es. You don't really have the case like what's subtraction in math where you've got toe? Have you know if the order is off, you're gonna get a different answer. Doesn't matter about the order with a single operation.

01:57

The lob distribution is a pretty interesting law. Hear what it's saying is that if you perform an operation against the results of a sub function, something like B or C in parentheses, there's actually performing. And against that is the same is performing, and against both of those both of those separate values

02:15

and Oren the result of that.

02:16

That's kind of a tricky thing to understand. So here I have this truth table built out the lot of distribution. Your acne was terribly, terribly often. Ah, lot of these lot of laws you're really gonna use just conceptually not really applying them very rigorously. But having this truth they will hear is very helpful because it helps you kind of understand the way the laws work, even if trying to come up with a good verbal definition is challenging

02:37

so you can see A and B or C

02:38

is going to evaluate the 1110 and then the restaurant zeros and the same way with a end B or a M to see is going to evaluate to the exact same thing, and that's like I said, That's the great thing about truth tables. I know a lot of people don't really like them because of bad experiences. What you're using, a truth table. You can put all of the possible inputs and outputs in front of you

02:57

and really get a good sense of what the equation is that how it works

03:00

and be able to identify relationships you would otherwise potentially miss.

03:04

The last time we're gonna talk about is a local Morgan's law. It's my personal favorite, because I think it's absolutely fascinating thing. Idea of Morgan's law is

03:13

the inverse of a A and B equals inverse a or inverse be

03:17

a CZ. Well, the universe of A or B equals inverse a and inverse be so you can see that on the truth table. I just I find this absolutely fascinating personally, and hopefully you find it interesting as well the idea that for

03:30

because of the structure of logical inversion, and I kind of alluded in the first video that Oren and have a sort of theoretical inversion in terms of the number of true values they have,

03:39

so here you can see that when you break it out, it's represented again on the truth table. Even if it seems weird or hard to understand, you can see that it just is true by examining the in Book two The outputs here.

03:53

Now there's 1/3 operation that I want to talk about here or not. 1/3 operation, but, ah, new operation rather called X or and X, Or is the concept of logical exclusion which used to say

04:02

one and only one of the inputs can be true. Or, as you might hear it, more often

04:09

it is. The inputs must be different if a is one B must be zero F B is one a must be zero now ex or is extremely important to computing and in fact, X or gates. Physical gates are the most common gates, along with manned and X rays used for encryption and all sorts of other

04:26

programmatic functions. It's actually kind of fascinating all the places that X or can show up,

04:30

but that operation is not actually its own fundamental operation. As I said in the last video, there are only the three instead explores a derivation of the three operations combined. Now what I want to do now is going to give you a chance to try and figure out what that operation is. So I'm just gonna pause. I'm gonna give you the chance to pause the video here. So go ahead and pause.

04:51

And either you figured it out where you've come back to find the answer.

04:56

And it looks like that now that obviously is a pretty complex equation. It's more complex than anything we've looked at so far, A or B and the inverse of a end be. The reason why I put this up here is because I think it's absolutely fascinating. With just those three gates, you're able to derive a completely different process, not only

05:13

derive a completely different process, but one of the processes that makes computing possible.

05:16

All of computer science is born just from these three operations in these two values. And I mean, when I say all of computing, I mean everything that you're currently doing on your screen, the video you're watching, the images on it, all of the meat talking into this camera and it being recorded. All of that is a product of just two values and three operations, and that is absolutely

05:35

fantastic and mind blowing to me. And if it's not to you,

05:39

I'm sorry that, like, the joy and excitement is gone from your life. But it's super cool, and you just you should take a second and consider how fascinating that is.

05:48

So in that last slide, I showed you a kind of a complex operation. And in this one, I want to kind of give you an idea, this slide in the next. What I'm gonna show you kind of break that down and how to think about logic problems like this. It's really important to take a big problem and break it down to its component parts. You're gonna see that a lot throughout the course of this video, or throughout the course of this, this lesson and this actual course

06:08

and the next two pipes on courses, you're really gonna wanna

06:11

be able to brake problems down into their component parts. It's just a fundamental thing that you want to know how to do in computer science. So here you can see that I have this operation in verse A or B in parentheses and inverse A and B

06:23

and you could see Hear that instead of trying to do that very difficult complex equation. I just broke it into pieces. I said, okay, inverse A or B could be turned into its own input, which is gonna be called N, and that we will derive from the previous values. And we're also gonna put in verse A and its own call him just to make it easier to use and also with them we're gonna do in verse A and B

06:41

And then the last column is just gonna be ending those two columns together. We're not gonna worry about tryingto remember which value we put where and who's doing what.

06:47

We're gonna break this into its constituent pieces and solve them individually. And you can see here that that's gonna make the process just so much easier. And that's true not only in this class not only important, but really in life just finding a way to break down your problems there component pieces their simplest, most fundamental level, solve them individually and then use that to solve the whole

07:06

so knowledge check. What do we go over in this video? The following are examples of which laws

07:14

A and B or C is the same as A and B or an si

07:17

That's distribution

07:19

aye, or a equals a.

07:21

That's love I'd impotent or identity is generally what I use that what I refer to it as

07:27

a A and B equals B and es.

07:30

That's the love computation. And, of course, a or B in parentheses, or C is the same as moving the parentheses around, which is the law of association

07:40

and which commonly used Logical gate, which which super common logical gate is derived from the three core operations. If you remember from before my rant about how cool computers are,

07:49

you remember that that is excellent.

07:51

So, yeah, in this video, we talked about the laws of logic derived operations, and I break down complex problems into their constituent pieces. Hopefully, you learned a little bit, and hopefully it's inspired you to come back for the next lesson. Lesson two is going to be programming basics. We're gonna learn about how to use variables and programming. I is always in your instructor, Joe Perry and is always I'm very excited to have you here, and I hope to see you in our next class

### Up Next

### Intro to Python

This is an introductory course on Python for cyber security, giving students the ability to understand the basics of the language, solve problems with scripts and identify useful Python modules.

### Instructed By

Joe Perry

Instructor