INSTRUCTOR: OK. In this video, we're going to take an intuitive approach to De Morgan's laws which apply to logical statements and negations. And I want u to realize that you don't need to memorize these laws, but you can think of them in a way that makes sense. So you can always take them with you wherever you go.
And the laws state that if you negate-- this is the negation sign-- p and q, what is logically equivalent to this? So in other words, if you take p and q and you're always taking the opposite of that, is there another way to do that? Well, there is.
If you almost think of the distributive property in some sense is you can distribute this sign. So it becomes-- instead of p, you have not p. When you distribute to the sign, instead of and, you have or. And instead of q, you have not q. And these things are logically equivalent.
And the idea is that-- well, let's say we have a truth table with p and q. So we can have p be true and q be true. We can have one true and one false and the reverse. Or we can have them both false. Now if we have p and q, what's going to happen? Well, the and statement is only true when both items are true. Otherwise, it's false. So it's only true in the first case.
Now what happens if we negate that? So not p and q. So that means we have the opposite. So instead of true, we have false. Instead of false, false, and false, we have true, true, and true. And we're saying here that this is also logically equivalent. So not p or not q. But let's first find not p and then find not q.
So basically now we're going to reverse these signs. So we have false, false, true, and true. I'm just reversing these 1, 2, 3, 4 there. And the same thing with the q. We're going to reverse them.
So whenever it's true, it becomes false. And whenever it's false, it becomes true. And sorry. My hand is a little sloppy I realize. We have false, true, false, true.
So now we have not p or not q. That's what we're finding. So if we're correct here, and this is why there's no need to memorize, we should get the exact same thing that we get here because if they're logically equivalent, they'll give us the same output of false and true.
If it's not correct, if we made a mistake somewhere-- often students forget is it or or is it and? Which one do we do? I can't remember it. Well, plug it into the table here and see which one works.
So here let's plug this in. So, first, we have an or statement to deal with. And, first, we have two false statements. That means when you have an or statement and they're both false, it's still false.
If one of them is true, it's true, false, true. True, false is true. And then, lastly, a true or a true is true. So, here, we get false and then true, true, true, which is equivalent to this statement right here. So these two things are equal. That's the first part of De Morgan's law. And the second part follows a similar idea.
The second part just says, OK, well, what if we're negating-- let's negate p or q. What's going to happen? As you might predict, a very similar thing will happen here. We negate p and get not p. We negate the or sign, and we get and. And we get negate q, and we get not q. And if we don't believe that this is true, we can set up a truth table to test the validity. So let's do that real quick because, like I said, I really believe there's no need to memorize any of this here.
So, again, we start with p and q, although I should do lowercase q because that's what I'm writing up here. So p could be true and so could q. We can have true and false. We can have false and true or both terms could be false.
If that's true, we're trying to test an or statement here. So let's find out p or q. Well, Remember with an or statement, you only have a false result if both terms are false. So that means we'll have true, true, true, and false.
Now we're negating that statement, right? We're saying not p or q. So that would mean if we follow, of course, the order of operations, we solve parentheses first and then negate that. So that means we get the opposite results. We get false, false, false, and true. So we're trying to determine is this logically equivalent, not p and not q?
So what I would do then is list out not p, list out not q to see what's happening. And this, again, is just going to reverse all of our truth values in the first two columns. So we get false, false, true, and true and false, true, false, true. So we can finish this off finally by saying, well, what's the value of not p and not q?
So with an and statement, again, you only have a true result when both terms are true. So, here, true and true is true. Otherwise, we have false results. We're looking at these combinations here.
So that means we get false, false, false, true, which is exactly the same thing that we got originally. So these two are equal. And this is, in fact, correct. So we can quickly set these truth tables to evaluate if we've written De Morgan's laws correctly. All right, I hope this helped.