#21) How Can We Use Logic Gates?
Hello, and welcome back to "Always Be Better" with Mel Windham.
In this episode, we will continue learning about logic. As a prerequisite, you should first watch my intro to Logic, and then this video on Logic Gates. And then you can come back here for more. You have five seconds to comply.
Okay, let's dive right in.
We'll start with a simple AND statement:
Both Alice AND Bob are here.
Scenario #1) If this AND statement is true, what does that tell us about Alice? This one is easy, right?
Alice is here.
But let's look at this another way and study the AND gate from our last episode.
|
AND |
|
|
A=0 |
A=1 |
B=0 |
0 |
0 |
B=1 |
0 |
1 |
If the AND statement is true, that happens in only one place -- here in the AND table where the red 1 is. Let's look closer look. A stands for Alice. And B stands for Bob. If we go up from the red 1, we see that A=1, which translates into "Alice is here." Likewise we could have gone along the row and see that B=1, which means "Bob is here," but right now we don't care about Bob. That's extra information. Good for Bob!
For Scenario #2, let's flip things around and say:
Alice is NOT here.
Now, what does that tell us about our AND statement? Is it TRUE or FALSE? Let's look at the AND gate again:
AND | ||
A=0 | A=1 | |
B=0 | 0 | 0 |
B=1 | 0 | 1 |
Since Alice is NOT here, A=0, so we can go down the column to see what we see, and there are two 0's. It doesn't matter which one we pick, because the results are the same: The AND statement is FALSE. And again we don't care about Bob.
Scenario #3) This time we'll pick on Bob and ignore Alice. We'll say:
Bob is here.
Now, what does that tell us about our AND statement?
AND | ||
A=0 | A=1 | |
B=0 | 0 | 0 |
B=1 | 0 | 1 |
Since Bob is here, B=1, so we can go across the row, and uh oh. There are two values: a 0 and a 1. This means that we cannot determine if the AND statement is TRUE or FALSE. We need more information -- we need to know if Alice is here. If she is (A=1), then the AND statement is TRUE. If she isn't (A=0), then the AND statement is FALSE.
But since we're ignoring Alice, our answer to the question is UNDETERMINED. This is a valid answer when analyzing anything from a logical standpoint. If one can successfully determine TRUE or FALSE, then the analysis can end. But if it comes up UNDETERMINED like this, then one must obtain more data in order to continue the analysis.
The examples I've just now presented may have been on the simple side, but I hope you can see how these tables can serve as useful tools to help analyze any logical statement -- especially when things get complex.
Speaking of complex, remember the IF gates I kind-of skipped in the last logic lesson? Let's take a closer look at an IF gate, and study its table. Let me bring back this statement from our first lesson:
If Sam is human, he has a face.
Remember that A means "Sam is human." And B means "Sam has a face." And remember, we can write the IF statement like this:
A -> B
And here is the IF A THEN B gate:
|
A -> B |
|
|
A=0 |
A=1 |
B=0 |
1 |
0 |
B=1 |
1 |
1 |
Scenario #1) Let's say Sam is human (A=1). Then is the IF statement TRUE? It depends on what B is.
If B=0, that means "Sam does NOT have a face." But wait -- he's human! That wouldn't make sense. It would make our IF statement FALSE. This would be an example of a counterexample.
Scenario #2) On the other hand, if B=1, that means "Sam does have a face," and then our IF statement is TRUE.
So, the "A=1" column makes sense, doesn't it? But what about the "A=0" column?
A -> B | ||
A=0 | A=1 | |
B=0 | 1 | 0 |
B=1 | 1 | 1 |
In Scenario #3, Sam isn't human. Let's say he's a screwdriver. Since Sam doesn't have a face, does that make our IF statement FALSE? Let's look at that IF sentence again: "If Sam is human, he has a face." It still sounds TRUE to me. The screwdriver doesn't have a face, but it is also not human, so this really isn't a counterexample. So, the IF Statement stays intact, and we can place a 1 where A=0 and B=0.
In Scenario #4, Sam is a cat. So, he has a face. He isn't human, so A=0, and since he has a face, B=1, and again, since Sam isn't human, the IF statement is still TRUE. So, we place a 1 here.
Note how we've only shown that A -> B is TRUE for very specific examples. It's a slightly harder thing to prove A -> B for ALL examples. We only need one counterexample to prove it FALSE, but we may need to consider several scenarios to prove it TRUE. We'll talk about this later when we dive more into politics.
I hope this all helps you to think more logically. It's still a little wax on/wax off-ish, but after two more episodes, I think it will all come together. Or perhaps it might be great to give these three introductory videos another viewing, and see if it makes more sense the second time around.
Over this next week, continue to look around the world and see if you can find more of these logic gates, and see if you can apply any of these tables to help determine if a statement is TRUE. Or is it FALSE, or even UNDETERMINED? Perhaps you may start to see all kinds of errors in logic, which exist practically everywhere these days. Everywhere! In the next logic episode, I'll present a brief overview of more advanced logical concepts and then we'll start using what we learn.
Thanks for watching, and remember, we can "Always Be Better."
Comments
Post a Comment