Boolean Implication - boolean-logic

I need some help with this Boolean Implication.
Can someone explain how this works in simple terms:
A implies B = B + A' (if A then B). Also equivalent to A >= B

Boolean implication A implies B simply means "if A is true, then B must be true". This implies (pun intended) that if A isn't true, then B can be anything. Thus:
False implies False -> True
False implies True -> True
True implies False -> False
True implies True -> True
This can also be read as (not A) or B - i.e. "either A is false, or B must be true".

Here's how I think about it:
if(A)
return B;
else
return True;
if A is true, then b is relevant and should be checked, otherwise, ignore B and return true.

I think I see where Serge is coming from, and I'll try to explain the difference. This is too long for a comment, so I'll post it as an answer.
Serge seems to be approaching this from the perspective of questioning whether or not the implication applies. This is somewhat like a scientist trying to determine the relationship between two events. Consider the following story:
A scientist visits four different countries on four different days. In each country she wants to determine if rain implies that people will use umbrellas. She generates the following truth table:
Did it rain? Did people Does rain => umbrellas? Comment
use umbrellas?
No No ?? It didn't rain, so I didn't get to observe
No Yes ?? People were shielding themselves from the hot sun; I don't know what they would do in the rain
Yes No No Perhaps the local government banned umbrellas and nobody can use them. There is definitely no implication here.
Yes Yes ?? Perhaps these people use umbrellas no matter what weather it is
In the above, the scientist doesn't know the relationship between rain and umbrellas and she is trying to determine what it is. Only on one of the days in one of the countries can she definitively say that implies is not the correct relationship.
Similarly, it seems that Serge is trying to test whether A=>B, and is only able to determine it in one case.
However, when we are evaluating boolean logic we know the relationship ahead of time, and want to test whether the relationship was adhered to. Another story:
A mother tells her son, "If you get dirty, take a bath" (dirty=>bath). On four separate days, when the mother comes home from work, she checks to see if the rule was followed. She generates the following truth table:
Get dirty? Take a bath? Follow rule? Comment
No No Yes Son didn't get dirty, so didn't need to take a bath. Give him a cookie.
No Yes Yes Son didn't need to take a bath, but wanted to anyway. Extra clean! Give him a cookie.
Yes No No Son didn't follow the rule. No cookie and no TV tonight.
Yes Yes Yes He took a bath to clean up after getting dirty. Give him a cookie.
The mother has set the rule ahead of time. She knows what the relationship between dirt and baths are, and she wants to make sure that the rule is followed.
When we work with boolean logic, we are like the mother: we know the operators ahead of time, and we want to work with the statement in that form. Perhaps we want to transform the statement into a different form (as was the original question, he or she wanted to know if two statements are equivalent). In computer programming we often want to plug a set of variables into the statement and see if the entire statement evaluates to true or false.
It's not a matter of knowing whether implies applies - it wouldn't have been written there if it shouldn't be. Truth tables are not about determining whether a rule applies, they are about determining whether a rule was adhered to.

I like to use the example: If it is raining, then it is cloudy.
Raining => Cloudy
Contrary to what many beginners might think, this in no way suggests that rain causes cloudiness, or that cloudiness causes rain. (EDIT: It means only that, at the moment, it is not both raining and not cloudy. See my recent blog posting on material implication here. There I develop, among other things, a rationale for the usual "definition" for material implication. The reader will require some familiarity with basic methods of proof, e.g. direct proof and proof by contradiction.)
~[Raining & ~Cloudy]

Judging from the truth tables, it is possible to infer the value of a=>b only for a=1 and b=0. In this case the value of a=>b is 0. For the rest of values (a,b), the value of a=>b is undefined: both (a=>b)=0 ("a doesn't imply b") and (a=>b)=1 ("a implies b") are possible:
a b a=>b comment
0 0 ? it is not possible to infer whether a implies b because a=0
0 1 ? --"--
1 0 0 b is 0 when a is 1, so it is possible to conclude
that a does not imply b
1 1 ? whether a implies b is undefined because it is not known
whether b can be 0 when a=1 .
For a to imply b it is necessary and sufficient that b=1 always when a=1, so that there is no counterexample when a=1 and b=0. For the rows 1, 2 and 4 in the truth table it is not known whether there is counterexample: these rows do not contradict to (a=>b)=1, but they also do not prove (a=>b)=1 . In contrast, row 3 immediately disproves (a=>b)=1 because it provides a counterexample when a=1 and b=0.
I guess I may shock some readers with these explanations, but it seems there are severe errors somewhere in the basics of the logic we are taught, and that is one of the reasons for such problems as Boolean Satisfiability being not solved yet.

The best contribution on this question is given by Serge Rogatch.
Boolean logic applies only where the result of quantifying(or evaluation) is either true or false and the relationship between boolean logic propositions is based on this fact.
So there must exist a relationship or connection between the propositions.
In higher order logic, the relationship is not just a case of on/off, 1/0 or +voltage/-voltage, the evaluation of a worded proposition is more complex. If no relationship exists between the worded propositions, then implication for worded propositions is not equivalent to boolean logic propositions.
While the implication truth table always yields correct results for binary propositions, this is not the case with worded propositions which may not be related in any way at all.
~A V B truth table:
A B Result/Evaluation
1 1 1
1 0 0
0 1 1
0 0 1
Worded proposition A: The moon is made of sour cream.
Worded proposition B: Tomorrow I will win the lotto.
A B Result/Evaluation
1 ? ?
As you can see, in this case, you can't even determine the state of B which will decide the result. Does this make sense now?
In this truth table, proposition ~A always evaluates to 1, therefore, the last two rows don't apply. However, the last two rows always apply in boolean logic.
http://thenewcalculus.weebly.com

Here's a compact statement:
Suppose we have two statements, A and B, each of which could either be true or false. Without any further information, there are 2 x 2 = 4 possibilities: "A and not B", "B and not A", "neither A nor B", and "both A and B".
Now impose the additional restriction that "if A, then also B". After imposing this restriction, the expression "x -> y", where -> is the "implication" operator, denotes whether it is still possible for A == x and B == y. The only outcome that is no longer possible after this additional restriction is A == 1 and B == 0, since that contradicts the restriction itself. Hence, we have 1 -> 0 is zero, and every other pair is 1.

Related

When two variables is logically compared, the logic gate that tests the equivalence is? Using logic gate

When two variables is logically compared, the logic gate that tests the equivalence ..
If XOR please explain Why ?
if XNOR Please explain Why?
The answer is XNOR. As for why, just look at the truth table for 2 inputs:
You see that it returns 1 if either both inputs are 1 or both inputs are 0, or in different words, when the inputs are of the same value. This can be described as checking for equivalence.
This can also be seen by looking at what XNOR means: "eXclusive Not OR". That means that it is the opposite of checking whether exactly one input is 1 (since "exclusive OR" means either one of the outputs may be 1 but not both), i.e. checking whether either none or both of the inputs are 1, i.e. checking whether either both inputs are 1 or both inputs are 0, i.e. whether both inputs are equivalent.
(It can also be called NXOR, which in my opinion is clearer. Because an exclusive OR of two inverted values would give the same result as without the negation, but this is the inversion of an exclusive OR.)

Do we input only 1s for minterms and 0s for maxterms?

This has been bugging me since a long time.
Suppose I have a boolean function F defined as follows:
Now, it can be expressed in its SOP form as:
F = bar(X)Ybar(Z)+ XYZ
But I fail to understand why we always complement the 0s to express them as 1. Is it assumed that the inputs X, Y and Z will always be 1?
What is the practical application of that? All the youtube videos I watched on this topic, how to express a function in SOP form or as sum of minterms but none of them explained why we need this thing? Why do we need minterms in the first place?
As of now, I believe that we design circuits to yield and take only 1 and that's where minterms come in handy. But I couldn't get any confirmation of this thing anywhere so I am not sure I am right.
Maxterms are even more confusing. Do we design circuits that would yield and take only 0s? Is that the purpose of maxterms?
Why do we need minterms in the first place?
We do not need minterms, we need a way to solve a logic design problem, i.e. given a truth table, find a logic circuit able to reproduce this truth table.
Obviously, this requires a methodology. Minterm and sum-of-products is mean to realize that. Maxterms and product-of-sums is another one. In either case, you get an algebraic representation of your truth table and you can either implement it directly or try to apply standard theorems of boolean algebra to find an equivalent, but simpler, representation.
But these are not the only tools. For instance, with Karnaugh maps, you rewrite your truth table with some rules and you can simultaneously find an algebraic representation and reduce its complexity, and it does not consider minterms. Its main drawback is that it becomes unworkable if the number of inputs rises and it cannot be considered as a general way to solve the problem of logic design.
It happens that minterms (or maxterms) do not have this drawback, and can be used to solve any problem. We get a trut table and we can directly convert it in an equation with ands, ors and nots. Indeed minterms are somehow simpler to human beings than maxterms, but it is just a matter of taste or of a reduced number of parenthesis, they are actually equivalent.
But I fail to understand why we always complement the 0s to express them as 1. Is it assumed that the inputs X, Y and Z will always be 1?
Assume that we have a truth table, with only a given output at 1. For instance, as line 3 of your table. It means that when x=0, y=1 and z=0 , the output will be zero. So, can I express that in boolean logic? With the SOP methodology, we say that we want a solution for this problem that is an "and" of entries or of their complement. And obviously the solution is "x must be false and y must be true and z must be false" or "(not x) must be true and y must be true and (not z) must be true", hence the minterm /x.y./z. So complementing when we have a 0 and leaving unchanged when we have a 1 is way to find the equation that will be true when xyz=010
If I have another table with only one output at 1 (for instance line 8 of your table), we can find similarly that I can implement this TT with x.y.z.
Now if I have a TT with 2 lines at 1, one can use the property of OR gates and do the OR of the previous circuits. when the output of the first one is 1, it will force this behavior and ditto for the second. And we directly get the solution for your table /xy/z+xyz
This can be extended to any number of ones in the TT and gives a systematic way to find an equation equivalent to a truth table.
So just think of minterms and maxterms as a tool to translate a TT into equations. What is important is the truth table (that describes the behaviour of what you want to do) and the equations (that give you a way to realize it).

What are the x values for this circuit truthtable? ABC (3) inputs (Homework)

I usually try not ask for homework help but once again I am stuck. I've been going over and over my textbook but I am not able to figure this out. Emailed the instructor and all the help i get is "Check this page" and "check that page", so instead of just not doing it, I would like some advice so I am actually able to learn.
The "G" gate thing, is whats bugging me in the book there is no gate that looks like that so i have no idea what to do. Here's a picture of the question, basically I have to find the X values (outputs). The answer would be nice. But I highly would appreciate a little explaination of "why".
Really appreciate the help!
Ok, so you you're not quite sure what this G gate means from looking at the diagram. In a question like this (where there's something that doesn't make sense to you), it's helpful to start with what you do know.
From looking at the diagram I don't know what the G gate means. In fact I don't know anything about circuits (but I do know something about logic :) ). I start with the truth table that the author has generously given me the formulas for each gate. I notice that there are 3 operators (*,+,') which I know.
If you know what those operators mean, then you can derive the meaning of the G gate.
D looks like an AND
E looks like NAND, the nipple-ish thing is an inverter
F looks like NOT, a buffer with an inverter on the output
G looks like a NOR, an OR with inverted output
The unlabeled one looks like an OR.
That's a really bad drawing though.
Giving you the answer would only cheat you out of your education and this stuff is important. There are 16 logical connectives for binary functions and they're all . . . logical. They make sense.
AND means when both inputs are true the output will be true. "If A and B = 1 output is 1"
OR means if any of the inputs are true the output will be true. "if A or B = 1 output is 1"
NOT means if the input is true the output is false.
XOR means if either input is true, but not both, the output will be true. "If A or B = 1 output is 1 unless both A and B = 1"
AND, OR, and XOR can all have inverters on their outputs which reverses their meanings. When they're supposed to output true they'll output false and when they're supposed to output false they'll output true.
The headings in the table are using * to mean AND, + to mean OR, and ' to mean "invert the symbol on the left".
D is A AND B, so if A and B are true, then put a 1 in the column, the rest of the column is false.
E is B NAND C, so if B and C are true, then put a 0 in the column, the rest of the column is true.
F is NOT C, so put the opposite of C in the column.
G is NOT((A AND B) OR (NOT C)), or if you look at the schematic and think about the formulas a bit you'll see that it's NOT(D OR F). You should be able to figure this out on your own now.
X is G OR E, There's a more complicated formula for it that traces through the circuit like the formula for G, but if you need it to prove your work you'll have to talk to your teacher. You'll probably get more help asking questions that show you put in effort.
I wrote an article about Logical functions in JavaScript that includes schematics. If you memorize the function tables at the top of the article it'll help you a lot when dealing with digital logic. Bonus points for associating the function number with the function name, you'll have memorized the output column of the functions truth table. They've taught you to count in binary right? Anyway, here's the article: http://matthewkastor.blogspot.com/2013/10/logical-functions-in-javascript.html It's not so important for your immediate question but will definitely do you good to read it. Oh, inputs can be inverted as well so don't let that throw you off.

Boolean simplification with some known term combinations

I am doing boolean simplification using Quine-McCluskey which works well.
However, I now need to perform the simplification with some known term combinations.
For example, I want to simplify:
(A+B)C
If I know that:
A+B == true
then this simplifies to:
C
Or if I know that:
BC == false
then it simplifies to
AC
Is there an algorithm that can simplify boolean expressions given a list of known terms?
I've discovered a nice solution to this problem.
Quine-McCluskey is able to handle a truth-table where some of the terms are marked as "don't care", which means that the term will never occur, so the minimized expression can return true or false.
For example:
A B result
0 0 0
0 1 don't care
1 0 don't care
1 1 con't care
It can clearly be seen that the above function can be minimized to just return 'false', as that is the only result that we care about.
So to deal with known terms, all that has to be done is set the result to "don't care" for any terms in the truth table where a known term evaluates to false. The Quine-McCluskey algorithm then generates the minimized function taking the known terms into account.
For example, if we have a function of A and B, and we know that A == false, then any line on the truth-table where A is true can be marked as "don't care" because we know it will never occur.

What does Exclusive in XOR really mean?

Maybe this is just obvious to everyone but can someone explain where XOR (or Exclusive-OR) got its name from? What does the word Exclusive really mean? Not that it matters, but its just stuck in my head since morning.
OR:
0 0 0
0 1 1
1 0 1
1 1 1
XOR:
0 0 0
0 1 1
1 0 1
1 1 0
Is it "exclusively 0 for inputs 1,1", "special version of OR" or something else?
It's what children understand as OR
You can have chocolate OR you can
have ice cream
But a programmer would regard this as having both!
Q: "Would you like tea or coffee"
Annoying programmer answer = yes
XOR is an "exclusive OR" because it only returns a "true" value of 1 if the two values are exclusive, i.e. they are both different.
According to Knuth in Vol. 4A of TAOCP, George Boole "...wrote x+y to stand for disjunction, but he took pains to never use this notation unless x and y were mutually exclusive (not both 1). If necessary, he wrote x+(1-x)y to ensure that the result of a disjunction would never be 2."
XOR is addition with carries being lost.
It's exclusive in the sense that the two operands must be mutually exclusive (in other words, different).
This comes from set theory. Consider that you have two sets A and B, and an element which may or may not be in those sets. The first boolean input is true if the element is in set A. The second boolean input is true if the element is in set B.
If the element is "exclusive" to one set (as in "not shared" with the other) then the XOR operator will return true. Illustration from wikipedia:
Exclusive in XOR means exactly what it says - one of the two has to be excluded. That is, either one or the other. Neither both, nor none - only one. At least that's how I've understood it :)
It's exclusive as in "only one." In other words, it's "one of the two, but not both."
I read a nice 'plain English' example today:
Consider, for example, the English
sentence, "You pay me by Tuesday or
I'll sue." If that "or" were the
logical connective, then the sentence
is true when either you do pay me by
Tuesday or I sue you; so you could pay
me on Monday and I still might sue
you. But this particular use of "or"
would normally be taken to mean that
either you pay me by Tuesday and I
don't sue you, or you do not pay me by
Tuesday and I do sue you - the
so-called "exclusive or".
Hugh Darwen, "An Introduction to Relational Database Theory", p76.