2 hours 57 minutes
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
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,
the output is just going to be whatever the input waas,
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.
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
normally order matters and logic you're going to a very similarly with mathematics
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,
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.
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
and Oren the result of that.
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
so you can see A and B or C
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
and really get a good sense of what the equation is that how it works
and be able to identify relationships you would otherwise potentially miss.
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
the inverse of a A and B equals inverse a or inverse be
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
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,
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.
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
one and only one of the inputs can be true. Or, as you might hear it, more often
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
programmatic functions. It's actually kind of fascinating all the places that X or can show up,
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.
And either you figured it out where you've come back to find the answer.
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
derive a completely different process, but one of the processes that makes computing possible.
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
fantastic and mind blowing to me. And if it's not to you,
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.
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
and the next two pipes on courses, you're really gonna wanna
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
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
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.
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
so knowledge check. What do we go over in this video? The following are examples of which laws
A and B or C is the same as A and B or an si
aye, or a equals a.
That's love I'd impotent or identity is generally what I use that what I refer to it as
a A and B equals B and es.
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
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,
you remember that that is excellent.
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
Learn to make the most of Python’s object orientation, and set yourself up for advanced ...
2 CEU/CPE Hours Available
Certificate of Completion Offered
Introduction to Programming Using Python
Introduction to Programming Using Python is a practice exam that will test basic programming functions ...