Boolean Logic and Truth Tables Explanation
 

I'm needing to create a truth table, and I really need to find a resource to explain how it works. I'll give an example of a problem. I have to create a truth table based on this: A*(B+A*B)=A*B So the truth table looks something like:
0 0
0 1
1 0
1 1 for A*(B+A*B)=A*B

How do I even begin to solve this? Are there any good resources that give a good explanation on what to do?

Ok So I then did one more complicated that involves a NOT. ! indicates not

!(A*!B+!A*B) = A*B+!(A+B)

So I did C = A*!B D=!A*B then !(C+D) for the left side. My final answer for that side is

0 0 1  
0 1 0
1 0 0
0 0 1

So the right side is this
C = A * B D = A + B then C + !D so that looked like this

0 0 1
0 1 0
0 1 0
1 1 1

I think I'm getting it? :)

http://www.stackoverflow.com/questions/2248883/

        

There are 1 answer(s) to this question.


Edit: I put in some extra explanation given your comment (which is now deleted).

A and B are two boolean variables. For example, in a program, A might be firstTestOK and B might be secondTestOK. Each of A and B can be either true (1) or false (0).

A+B means A or B which is true if either A or B is true. A*B means A and B is is true only if both A and B are true.

All of the combinations for A, B are:

  1. A is false and B is false
  2. A is false and B is true
  3. A is true and B is false
  4. A is true and B is true

This can be written more compactly as a truth table as follows:

A B
0 0
0 1
1 0
1 1

What you've been asked to do is show A*(B+A*B) is the same as A*B. So, for each combination, we work out the left-hand-side, which is A*(B+A*B) and the right-hand-side, which is A*B:

A B C=A*B D=B+C A*D  = A*B
0 0  0     0     0      0
0 1  0     1     0      0  
1 0  0     0     0      0
1 1  1     1     1      1

so, looking at all of the combinations in the last two columns, we see that the results are the same, so A*D=A*(B+A*B) is A*B.

Since the left-hand-side is a little complicated, I did it in steps by breaking it up into pieces, by introducing C and D.

Related Questions

Boolean logic failure
Boolean logic failure I am having a strange problem with boolean logic. I must be doing something daft, but I can't figure it out. In the below code firstMeasure.isInvisibleArea is true and measureBuffer1 is nil. Even though test1 is evaluating to NO for some reason it is still dropping into my... moving. I think I need to grab the value of firstMeasure.isInVisibleArea at the start of the method and use that value throughout. Phew. Boolean logic isn't broken. All is right with the world. Thanks for all your input... objects evaluate to boolean NO and non-nil objects evaluate to boolean YES. So you could just as easily write this: BOOL firstVisible = firstMeasure.isInVisibleArea; BOOL notFirstVisible = !(firstMeasure.isInVisibleArea); BOOL measureBufferNil = measureBuffer1; BOOL test1 = !measureBuffer1 &&
C boolean logic
C boolean logic I have been trying some programs in the C Language and come across to this... #include<stdio.h> int main() { int j=3,k; k=!5&&j; printf("%d",k); return 0; } can anyone figure out what is the problem in this if i compile the program i will result to 0 and when i tried the same code in c# public void logic() { j = 5; k = !4 && j; Console.WriteLine("hence the value would be " + k); } this will generate the error*( Error 1 Operator '!' cannot be applied to operand of type 'int' C:\Documents...; (j != 0) ? 1 : 0; Console.WriteLine("{0}", k); return 0; } } Notice that C# does not allow Boolean logic operators to be used on ints. If you want to convert ints to bools, you'll have to write code to do that, as I have here. Both programs correctly output zero because 5 is not equal
Boolean logic parser for SQL
Boolean logic parser for SQL This is going to sound crazy but does anyone have techniques that would allow me to parse boolean logic strings in Sql Server 2005 without extraordinary/rediculous effort? Here is an example: (SOMEVAR=4 OR SOMEVAR=5) AND (NOT OTHERVAR=Y) I feel like recursion would help a lot if that were possible in Sql but I'm not really sure how to go about that sort of thing. If not, maybe there's a way to attach an external system to do the recursion for me? Don't worry, I'm not getting my hopes up. Your best bet is to use CLR integration. This will make it easier to find or develop code that will solve this issue. If you are receiving the logic strings as input from some process (web site or whatever), you could use them to build up and execute a dynamic sql string. You would have to be very careful about injection attacks with this approoach. Judging from your
Boolean logic rule evaluator
Boolean logic rule evaluator I have essentially a survey that is shown, and people answer questions a lot like a test, and there are different paths, it is pretty easy so far, but i wanted to make it more dynamic, so that i can have a generic rule that is for the test with all the paths, to make... and 125 are true and 127 is false, they pass as well. This gets tedious if there are many combinations, so i want to implement OR in the logic, I am just not sure what best approach is for this problem. I think rules engine is too complicated, there must be an easier way, perhaps constructing a graph... a question element independently, i.e. without any knowledge of the context in which you're trying to evaluate it. That makes for simpler code. I'd also take a page from XML Schema and implement your OR logic as a choice element. A choice element is true if any of its children are true. You can
More than operator in Boolean Logic (Logic gates)
More than operator in Boolean Logic (Logic gates) Basically I have 2 unsigned 8-bit binary numbers and I need to use Boolean logic to find out which is larger and I can't for the life of me figure out where to start. Using Logic gates... Obivously I have to analyse each bit and find out which one is larger but how do I bring it all together? Say I had x and y and wanted to return true if x < y (x and y are 8bit unsigned binary numbers). How would I go about doing this? I thought about finding which has the most significant bit, but what if they are both the same? Anyone got any ideas? I thought about finding which has the most significant bit, but what if they are both the same? You proceed from "most significant bit" down to the "least significant bit" until there is a difference. The number with the first bit set to "1" is greatest. To implement this, use a "shift
Boolean Logic and Truth Tables Explanation
Boolean Logic and Truth Tables Explanation I'm needing to create a truth table, and I really need to find a resource to explain how it works. I'll give an example of a problem. I have to create a truth table based on this: A*(B+A*B)=A*B So the truth table looks something like: 0 0 0 1 1 0 1 1 for A*(B+A*B)=A*B How do I even begin to solve this? Are there any good resources that give a good explanation on what to do? Ok So I then did one more complicated that involves a NOT. ! indicates not !(A*!B+!A*B) = A*B+!(A+B) So I did C = A*!B D=!A*B then !(C+D) for the left side. My... boolean variables. For example, in a program, A might be firstTestOK and B might be secondTestOK. Each of A and B can be either true (1) or false (0). A+B means A or B which is true if either A or B is true. A*B means A and B is is true only if both A and B are true. All of the combinations for A, B
How to validate_presence_of with boolean logic?
How to validate_presence_of with boolean logic? Suppose I am entering validation code into my model of multi-language publication database. The database needs either an English or a Japanese title for a particular journal. So I need to validate_presence_of at least one of the two. Right now I can easily check that both exists, but am stumped on the case of "at least one": class Article < ActiveRecord::Base belongs_to :publication validate_presence_of :journal_title validate_presence_of :journal_title_ja end I think this might require a statement like: :if => :jornal_title_ja is nil class Article < ActiveRecord::Base belongs_to :publication validate_presence_of :journal_title, :if => :check_japanese validate_presence_of :journal_title_ja, :if => :check_english def check_japanese journal_title_ja.nil? end def check_english journal
Creating a database view with boolean logic
Creating a database view with boolean logic My google search skills have failed me, and I am not a database expert by any means! I have a very simple database schema that looks like this: properties_id in the CANDY table is a foreign key to id in the EXPENSIVE_PROPERTIES table. The properties_id is only set if the candy is expensive. If it is expensive, then the corresponding values in the EXPENSIVE_PROPERTIES table will get filled in. When I want to get a list of the candies, I basically want to do this: request all of the properties in the CANDY table, like name and color optionally get the expensive properties if the properties_id value is not null In the past, I have done two queries, but this is silly since I should be able to create a view that aggregates all of the properties into one table, and just leaves the other fields blank if there isn't a corresponding id
How to parse a string of boolean logic in PHP
How to parse a string of boolean logic in PHP I'm building a PHP class with a private member function that returns a string value such as: 'true && true || false' to a public member function. (This string is the result of some regex matching and property lookups.) What I'd like to do is have PHP parse the returned logic and have the aforementioned public function return whether the boolean result of the parsed logic is true or false. I tried eval(), but I get no output at all. I tried typecasting the boolean returns...but there's no way to typecast operators...hehe Any ideas? (Let me know if you need more information.) Let's assume eval() is an ok/good solution in your case. class Foo { private function trustworthy() { return 'true && true || false'; } public function bar() { return eval('return '.$this->trustworthy().';'); } } $foo = new
Why can't I do boolean logic on bytes?
Why can't I do boolean logic on bytes? In C# (3.5) I try the following: byte byte1 = 0x00; byte byte2 = 0x00; byte byte3 = byte1 & byte2; and I get Error 132: "Cannot implicitly convert type 'int' to 'byte'. An explicit conversion exists (are you missing a cast?)". The same happens with | and ^. What am I doing wrong? Why is it asking me about ints? Why can't I do boolean logic on bytes? Various operators aren't declared for byte - both operands get promoted to int, and the result is int. For example, addition: byte byte1 = 0x00; byte byte2 = 0x00; byte byte3 = byte1 + byte2; // Compilation error Note that compound assignments do work: byte1 += byte2; There was a recent SO question on this. I agree this is particularly irksome for bitwise operations though, where the result should always be the same size, and it's a logically entirely valid operation. As a workaround
Boolean logic in a single regular expression - possible ?
Boolean logic in a single regular expression - possible ? Can we put into a single regular expression , boolean logic : line starts with 'a' or 'b' . Question is triggered by using FileHelpers utility which does have a text box "Record Condition Selector" for "ExcludeIfMatchRegex" . Utility is written in C#. ^a - works , just don't how write down ^a OR ^b How about this: ^[ab] Having a hard time understanding you, but...if you're looking for a match if the string starts with "a" or "b", and a fail otherwise, you could do this: ^(a|b)(.+)$ Then, when you get the match's groups, the first group will be either an "a" or "b" and the second group will be the rest of the string. use the | (pipe) feature: ^a|^b Or, in extended formatting: ^a # starts with an A | # OR ^b # starts with a B A special construct (?ifthen|else) allows you to create conditional regular
Need guidance towards evaluative boolean logic tree
Need guidance towards evaluative boolean logic tree I can't seem to find a pointer in the right direction, I am not even sure what the terms are that I should be researching but countless hours of googling seem to be spinning me in circles, so hopefully the collective hive of intelligence of Stack Overflow can help. The problem is this, I need a way to filter data in what I can only call a compound logic tree. Currently the system implements a simple AND filtering system. For example, lets say we have a dataset of people. You add a bunch of filters such that show all the people where... and pictures to help describe this problem better for others. I have to say that this is why database engines are built. You can do all that you require with set logic and you may even arrive at the result you are looking for, but theses are standard problems solved by databases and SQL. You can also look
Dynamically evaluating simple boolean logic in Python
Dynamically evaluating simple boolean logic in Python I've got some dynamically-generated boolean logic expressions, like: (A or B) and (C or D) A or (A and B) A empty - evaluates to True The placeholders get replaced with booleans. Should I, Convert this information to a Python expression like True or (True or False) and eval it? Create a binary tree where a node is either a bool or Conjunction/Disjunction object and recursively evaluate it? Convert it into nested S-expressions and use a Lisp parser? Something else? Suggestions welcome. If you set up dicts with the locals and globals you care about then you should be able to safely pass them along with the expression into eval(). It shouldn't be difficult at all to write a evaluator that can handle this, for example using pyparsing. You only have a few operations to handle (and, or, and grouping?), so you should be able
Semantics of the Boolean and comparison operators in the context of three-valued-logic
Semantics of the Boolean and comparison operators in the context of three-valued-logic Hi People! Professor ask me this question: What is the semantics of the Boolean and comparison operators in the context of three-valued-logic? I'm not sure what he meant by that. What is comparison operator? Is that the same as relational operator? Semantics? He asking about 'meaning' of those two terms in context of three-valued-logic? Thanks. http://en.wikipedia.org/wiki/Null_(SQL)#Three-valued_logic_.283VL.29 Basically, three value logic is true/false/null, and the boolean/comparison operators will function in certain ways when comparing true == null, null == null, etc. Boolean logic by definition uses only two values. To me, this question doesn't make sense. If he would asked how can you define or extend Boolean logic so that it could use three-value system, it would be clearer. Boolean
ROR - My logic works, Boolean value doesn't post
ROR - My logic works, Boolean value doesn't post Hello fellas, My logic tests an inventory supply; and the < operator functions fine. How do I assign boolean values to "instock"? (using POST) In this test, under both conditions the value remains unchanged and this sample code does not work. Also this code is placed in an html.erb file, is there a better place for this code? <% if @inventory.needed < @inventory.amount then %> <% @inventory.instock = 'true' %> <% else %> <% @inventory.instock = 'false' %> <% end %> Thank you in advance for your suggestions! You are setting instock equal to the string value of "true". @inventory.instock = true Is what you want

Related boolean logic Video tutorials from Youtube.


Red Green - Boolean Logic
"Boolean Logic" skit by Red Green. Computer science humor.
Red Green - Boolean Logic
"Boolean Logic" skit by Red Green. Computer science humor.

Python Programming Lesson Four
In this lesson we learn Boolean Logic. If you have any questions, post a text response. If you have
Python Programming Lesson Four
In this lesson we learn Boolean Logic. If you have any questions, post a text response. If you have any programs that aren't working, just post a video response showing what goes wrong, and I will try to help you.

C++ Programming Tutorial 3: If
About If/Else Statements Source Code: www.mediafire.com
C++ Programming Tutorial 3: If/Else Statements + Boolean Logic -Easy
About If/Else Statements Source Code: www.mediafire.com

R Tutorial 3 - More about Vect
Part 3 of my R Tutorial - Numeric Vectors, Logic Vectors, Character Vectors and Boolean Operators an
R Tutorial 3 - More about Vectors - Statistical Programming Language R
Part 3 of my R Tutorial - Numeric Vectors, Logic Vectors, Character Vectors and Boolean Operators and Relational Operators! R is a programming language and software environment for statistical computing and graphics. The R language has become a de facto standard among statisticians for the development of statistical software, and is widely used for statistical software development and data analysis. R is part of the GNU project.

Lesson 3 - Logic [1/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more i
Lesson 3 - Logic [1/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more in this lesson.

Cellular Automata
Inspired by a documentary called "The secret life of chaos" by Prof. J. Al-khalili (University of Su
Cellular Automata
Inspired by a documentary called "The secret life of chaos" by Prof. J. Al-khalili (University of Surrey), I decided to carry out a little computer experiment to demonstrate the powerful idea that simple rules can generate great complexity. Cellular automata consists of a structured grid of cells that each have a finite number of states. The states of each cell are evolved through simple rules of interaction with the neighbouring cells. In this example I used the simplest form of cellular automata - binary and discrete. Each cell can have only two states, 1 or 0. The rules themselves are described at the start of the video, but the basic idea was to model simple life with the concepts of reproduction and sustenance, overcrowding, and isolation all reduced to boolean logic operations. The results were pleasantly surprising to say the least...... just watch ;-)

Lesson 3 - Logic [3/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more i
Lesson 3 - Logic [3/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more in this lesson.

Truth Tables
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive
Truth Tables
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive visualizations, with new entries added daily. In propositional calculus and Boolean algebra, a truth table is a two-dimensional array with n + 1 columns used to show the truth value of a logical expression made up of n propositions P, Q, ... (sentences with a True or False value). The first... Contributed by: Hector Zenil

Venn Diagrams for Two-Variable
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive
Venn Diagrams for Two-Variable Boolean Logic Circuits
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive visualizations, with new entries added daily. Venn diagrams are a convenient way to illustrate the relations among disjunctive normal form minterms used in designing logic circuits. This Demonstration presents traditional Venn diagrams for two-variable Boolean logic circuits, with regions correspon... Contributed by: Lawrence J. Thaden After work by: WD Becher

Minecraft Redstone Adder/Subst
Silent video of the redstone adder/substractor on the server. It takes 2x4 bits input, 1 bit to set
Minecraft Redstone Adder/Substractor
Silent video of the redstone adder/substractor on the server. It takes 2x4 bits input, 1 bit to set the instruction, 4 bits output

Geometry and Boolean Logic Con
For more info www.pdsim.com.
Geometry and Boolean Logic Construction in TracePro
For more info www.pdsim.com.

Theory of Everything. Decoded
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Lan
Theory of Everything. Decoded
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Language decodes all this by tracing back to the starting point of all knowledge. Successful roll-out will revolutionize Information Technology and Artificial Intelligence

K'nex Computer
This is a k'nex 3 bit "digital" computer that I made. The original design came from Digicomp I, a si
K'nex Computer
This is a k'nex 3 bit "digital" computer that I made. The original design came from Digicomp I, a simple computer made in the 60s. Depending on how it is programmed, this k'nex machine can add, subtract, compare, multiply, divide, solve logic problems, and even play games. For the video, I focused on one of the most complex processes the computer can handle: the game of Nim. Here is a full decision chart of what the coputer has to think when playing: Where three digit binary number = ABC If A=0 and B=1, set B to 0 If A=0 and B=1, set A to 1 If A=0 and C=1, set C to 0 if B=0 and C=1, set B to 1 if (B=0 and C=0) OR (A=1 and B=1 and C=0), set C to 1

How to Use Excel's Go To Speci
The Go TO Special Command is one of my favorite tools in Excel - and Excel 2007 makes it easier for
How to Use Excel's Go To Special Command to Spot Formula Errors
The Go TO Special Command is one of my favorite tools in Excel - and Excel 2007 makes it easier for me to use it to quickly spot formula errors. Especially those cells that contain "hard-coded" Constant Values instead of Formulas. I invite you to visit my website - www.thecompanyrocks.com - to see all of my video lessons.

Boolean Operations in Geometry
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive
Boolean Operations in Geometry
demonstrations.wolfram.com The Wolfram Demonstrations Project contains thousands of free interactive visualizations, with new entries added daily. Combine a disk and a triangle using various Boolean operations. "Ink" is filled in wherever the condition of being inside the disk, combined with the condition of being inside the triangle, is true. Contributed by: Stephen Wolfram

DeMorgan's Laws
Shows that you can write an expression like "not (A or B)" as "(not A) and (not B)". Similarly, "not
DeMorgan's Laws
Shows that you can write an expression like "not (A or B)" as "(not A) and (not B)". Similarly, "not(A or B)" can be written as "(not A) and (not B)" Which way should you write an expression? Whichever way most clearly states the intent of your program.

the Universal Language decodes
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Lan
the Universal Language decodes the Theory of Everything
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Language decodes all this by tracing back to the starting point of all knowledge. Successful roll-out will revolutionize Information Technology and Artificial Intelligence

the Universal Language decodes
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Lan
the Universal Language decodes the Theory of Everything
Underlying all knowledge fields today is a shared set of a priori algorithms/elements. Universal Language decodes all this by tracing back to the starting point of all knowledge. Successful roll-out will revolutionize Information Technology and Artificial Intelligence

Lesson 3 - Logic [2/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more i
Lesson 3 - Logic [2/3]
Website: johnsjava.webs.com Learn to use boolean variables, if statements, logical loops, and more in this lesson.

Post you comment here

Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

There are 0 comment(s) to this page.



The questions and answers taken from stackoverflow.com's public data dump which is licensed under the cc-wiki license.
Logo, website design and layout ©2011 CodingTiger.com