Boolean logic: Difference between revisions

Content deleted Content added
m Reverted edits by 66.193.131.47 (talk) to last revision by ClueBot NG (HG)
Line 4:
 
''Using the [[algebra of sets]], this article contains a basic introduction to [[Set (mathematics)|sets]], Boolean operations, [[Venn diagram]]s, [[truth tables]], and Boolean applications. The [[Boolean algebra (structure)]] article discusses a type of algebraic structure that satisfies the axioms of Boolean logic. The [[binary arithmetic]] article discusses the use of [[binary numeral system|binary]] numbers in computer systems.''
 
==Set logic vs. Boolean logic==
{{Undue|date=August 2010}}
 
Sets can contain any elements. We will first start out by discussing general set logic, then restrict ourselves to Boolean logic, where elements (or "bits") each contain only two possible values, called various names, such as "true" and "false", "yes" and "no", "on" and "off", or "1" and "0".
 
==Terms==
Line 30 ⟶ 35:
 
* A '''proper superset''' is denoted by <math>A \supset B</math> and means every element in set B is also in set A and the two sets are not identical.
 
==Example==
{{Undue|date=August 2010}}
 
Imagine that set A contains all even numbers (multiples of two) in "the universe" (defined in the example below as all integers between 0 and 30 inclusive) and set B contains all multiples of three in "the universe". Then the '''intersection''' of the two sets (all elements in sets A AND B) would be all multiples of six in "the universe". The complement of set A (all elements NOT in set A) would be all odd numbers in "the universe".
 
[[Image:Boolean multiples of 2 3 5.svg|480px|right]]
 
===Chaining operations together===
 
While at most two sets are joined in any Boolean operation, the new set formed by that operation can then be joined with other sets utilizing additional Boolean operations. Using the previous example, we can define a new set C as the set of all multiples of five in "the universe". Thus "sets A AND B AND C" would be all multiples of 30 in "the universe". If more convenient, we may consider set AB to be the intersection of sets A and B, or the set of all multiples of six in "the universe". Then we can say "sets AB AND C" are the set of all multiples of 30 in "the universe". We could then take it a step further, and call this result set ABC.
 
===Use of parentheses===
 
While any number of logical ANDs (or any number of logical ORs) may be chained together without ambiguity, the combination of ANDs and ORs and NOTs can lead to ambiguous cases. In such cases, parentheses may be used to clarify the order of operations. As always, the operations within the innermost pair is performed first, followed by the next pair out, etc., until all operations within parentheses have been completed. Then any operations outside the parentheses are performed.
 
===Application to binary values===
 
In this example we have used [[natural numbers]], while in Boolean logic binary numbers are used. The universe, for example, could contain just two elements, "1" and "0" (or "true" and "false", "yes" and "no", "on" or "off", etc.). We could also combine binary values together to get binary words, such as, in the case of two digits, "00", "01", "10", and "11". Applying set logic to those values, we could have a set of all values where the first digit is "0" ("00" and "01") and the set of all values where the first and second digits are different ("01" and "10"). The intersection of the two sets would then be the single element, "01". This could be shown by the following Boolean expression, where "1st" is the first digit and "2nd" is the second digit:
 
'''(NOT 1st) AND (1st XOR 2nd)'''
 
==Properties==
Line 192 ⟶ 218:
"Search term 1" -"Search term 2"
 
==See also==
listen people anyone can edit this so dont go to this webcite
* [[Boolean algebra topics]]
* [[Boolean ___domain]]
* [[Boolean function]]
* [[Boolean-valued function]]
* ''[[Laws of Form]]''
* [[Logic minimization]]
* [[Logic gate]]
* [[Logical graph]]
* [[Venn diagram]]
* [[Ternary logic]]
 
==Notes and references==