# Thread: Boolean Algebra Mathematical Logic

1. ## Boolean Algebra Mathematical Logic

If you go through the link you will see it looks similar to formal logic.

https://en.wikipedia.org/wiki/Boolean_algebra

In mathematics and mathematical logic, Boolean algebra is the branch of algebra in which the values of the variables are the truth values true and false, usually denoted 1 and 0 respectively. Instead of elementary algebra where the values of the variables are numbers, and the prime operations are addition and multiplication, the main operations of Boolean algebra are the conjunction and denoted as ∧, the disjunction or denoted as ∨, and the negation not denoted as ¬. It is thus a formalism for describing logical relations in the same way that elementary algebra describes numeric relations.

Boolean algebra was introduced by George Boole in his first book The Mathematical Analysis of Logic (1847), and set forth more fully in his An Investigation of the Laws of Thought (1854).[1] According to Huntington, the term "Boolean algebra" was first suggested by Sheffer in 1913,[2] although Charles Sanders Peirce in 1880 gave the title "A Boolian Algebra with One Constant" to the first chapter of his "The Simplest Mathematics".[3] Boolean algebra has been fundamental in the development of digital electronics, and is provided for in all modern programming languages. It is also used in set theory and statistics.[4]

History

Boole's algebra predated the modern developments in abstract algebra and mathematical logic; it is however seen as connected to the origins of both fields.[5] In an abstract setting, Boolean algebra was perfected in the late 19th century by Jevons, Schröder, Huntington, and others until it reached the modern conception of an (abstract) mathematical structure.[5] For example, the empirical observation that one can manipulate expressions in the algebra of sets by translating them into expressions in Boole's algebra is explained in modern terms by saying that the algebra of sets is a Boolean algebra (note the indefinite article). In fact, M. H. Stone proved in 1936 that every Boolean algebra is isomorphic to a field of sets.

In the 1930s, while studying switching circuits, Claude Shannon observed that one could also apply the rules of Boole's algebra in this setting, and he introduced switching algebra as a way to analyze and design circuits by algebraic means in terms of logic gates. Shannon already had at his disposal the abstract mathematical apparatus, thus he cast his switching algebra as the two-element Boolean algebra. In circuit engineering settings today, there is little need to consider other Boolean algebras, thus "switching algebra" and "Boolean algebra" are often used interchangeably.[6][7][8] Efficient implementation of Boolean functions is a fundamental problem in the design of combinational logic circuits. Modern electronic design automation tools for VLSI circuits often rely on an efficient representation of Boolean functions known as (reduced ordered) binary decision diagrams (BDD) for logic synthesis and formal verification.[9]

Logic sentences that can be expressed in classical propositional calculus have an equivalent expression in Boolean algebra. Thus, Boolean logic is sometimes used to denote propositional calculus performed in this way.[10][11][12] Boolean algebra is not sufficient to capture logic formulas using quantifiers, like those from first order logic. Although the development of mathematical logic did not follow Boole's program, the connection between his algebra and logic was later put on firm ground in the setting of algebraic logic, which also studies the algebraic systems of many other logics.[5] The problem of determining whether the variables of a given Boolean (propositional) formula can be assigned in such a way as to make the formula evaluate to true is called the Boolean satisfiability problem (SAT), and is of importance to theoretical computer science, being the first problem shown to be NP-complete. The closely related model of computation known as a Boolean circuit relates time complexity (of an algorithm) to circuit complexity

Basic operations

The basic operations of Boolean algebra are as follows:
AND (conjunction), denoted x∧y (sometimes x AND y or Kxy), satisfies x∧y = 1 if x = y = 1, and x∧y = 0 otherwise.
OR (disjunction), denoted x∨y (sometimes x OR y or Axy), satisfies x∨y = 0 if x = y = 0, and x∨y = 1 otherwise.
NOT (negation), denoted ¬x (sometimes NOT x, Nx or !x), satisfies ¬x = 0 if x = 1 and ¬x = 1 if x = 0.

Alternatively the values of x∧y, x∨y, and ¬x can be expressed by tabulating their values with truth tables as follows:

Secondary operations

The three Boolean operations described above are referred to as basic, meaning that they can be taken as a basis for other Boolean operations that can be built up from them by composition, the manner in which operations are combined or compounded. Operations composed from the basic operations include the following examples:
x → y = ¬ x ∨ y {\displaystyle x\rightarrow y=\neg {x}\vee y} x\rightarrow y=\neg {x}\vee yx ⊕ y = ( x ∨ y ) ∧ ¬ ( x ∧ y ) = ( x ∧ ¬ y ) ∨ ( ¬ x ∧ y ) {\displaystyle x\oplus y=(x\vee y)\wedge \neg {(x\wedge y)}=(x\wedge \neg y)\vee (\neg x\wedge y)} {\displaystyle x\oplus y=(x\vee y)\wedge \neg {(x\wedge y)}=(x\wedge \neg y)\vee (\neg x\wedge y)}x ≡ y = ¬ ( x ⊕ y ) = ( x ∧ y ) ∨ ( ¬ x ∧ ¬ y ) {\displaystyle x\equiv y=\neg {(x\oplus y)}=(x\wedge y)\vee (\neg x\wedge \neg y)} {\displaystyle x\equiv y=\neg {(x\oplus y)}=(x\wedge y)\vee (\neg x\wedge \neg y)}
These definitions give rise to the following truth tables giving the values of these operations for all four possible inputs

Laws

A law of Boolean algebra is an identity such as x ∨ (y ∨ z) = (x ∨ y) ∨ z between two Boolean terms, where a Boolean term is defined as an expression built up from variables and the constants 0 and 1 using the operations ∧, ∨, and ¬. The concept can be extended to terms involving other Boolean operations such as ⊕, →, and ≡, but such extensions are unnecessary for the purposes to which the laws are put. Such purposes include the definition of a Boolean algebra as any model of the Boolean laws, and as a means for deriving new laws from old as in the derivation of x∨(y∧z) = x∨(z∧y) from y∧z = z∧y as treated in the section on axiomatization.

Monotone laws

Boolean algebra satisfies many of the same laws as ordinary algebra when one matches up ∨ with addition and ∧ with multiplication. In particular the following laws are common to both kinds of algebra:[14]

Associativity of ∨ {\displaystyle \vee } \vee : x ∨ ( y ∨ z ) {\displaystyle x\vee (y\vee z)} {\displaystyle x\vee (y\vee z)} = ( x ∨ y ) ∨ z {\displaystyle =(x\vee y)\vee z} {\displaystyle =(x\vee y)\vee z}
Associativity of ∧ {\displaystyle \wedge } \wedge : x ∧ ( y ∧ z ) {\displaystyle x\wedge (y\wedge z)} {\displaystyle x\wedge (y\wedge z)} = ( x ∧ y ) ∧ z {\displaystyle =(x\wedge y)\wedge z} {\displaystyle =(x\wedge y)\wedge z}
Commutativity of ∨ {\displaystyle \vee } \vee : x ∨ y {\displaystyle x\vee y} x\vee y = y ∨ x {\displaystyle =y\vee x} {\displaystyle =y\vee x}
Commutativity of ∧ {\displaystyle \wedge } \wedge : x ∧ y {\displaystyle x\wedge y} x\wedge y = y ∧ x {\displaystyle =y\wedge x} {\displaystyle =y\wedge x}
Distributivity of ∧ {\displaystyle \wedge } \wedge over ∨ {\displaystyle \vee } \vee : x ∧ ( y ∨ z ) {\displaystyle x\wedge (y\vee z)} {\displaystyle x\wedge (y\vee z)} = ( x ∧ y ) ∨ ( x ∧ z ) {\displaystyle =(x\wedge y)\vee (x\wedge z)} {\displaystyle =(x\wedge y)\vee (x\wedge z)}
Identity for ∨ {\displaystyle \vee } \vee : x ∨ 0 {\displaystyle x\vee 0} {\displaystyle x\vee 0} = x {\displaystyle =x} =x
Identity for ∧ {\displaystyle \wedge } \wedge : x ∧ 1 {\displaystyle x\wedge 1} {\displaystyle x\wedge 1} = x {\displaystyle =x} =x
Annihilator for ∧ {\displaystyle \wedge } \wedge : x ∧ 0 {\displaystyle x\wedge 0} {\displaystyle x\wedge 0} = 0 {\displaystyle =0} =0

The following laws hold in Boolean Algebra, but not in ordinary algebra:

Annihilator for ∨ {\displaystyle \vee } \vee : x ∨ 1 {\displaystyle x\vee 1} {\displaystyle x\vee 1} = 1 {\displaystyle =1} =1
Idempotence of ∨ {\displaystyle \vee } \vee : x ∨ x {\displaystyle x\vee x} {\displaystyle x\vee x} = x {\displaystyle =x} =x
Idempotence of ∧ {\displaystyle \wedge } \wedge : x ∧ x {\displaystyle x\wedge x} {\displaystyle x\wedge x} = x {\displaystyle =x} =x
Absorption 1: x ∧ ( x ∨ y ) {\displaystyle x\wedge (x\vee y)} {\displaystyle x\wedge (x\vee y)} = x {\displaystyle =x} =x
Absorption 2: x ∨ ( x ∧ y ) {\displaystyle x\vee (x\wedge y)} {\displaystyle x\vee (x\wedge y)} = x {\displaystyle =x} =x
Distributivity of ∨ {\displaystyle \vee } \vee over ∧ {\displaystyle \wedge } \wedge : x ∨ ( y ∧ z ) {\displaystyle x\vee (y\wedge z)} {\displaystyle x\vee (y\wedge z)} = ( x ∨ y ) ∧ ( x ∨ z ) {\displaystyle =(x\vee y)\wedge (x\vee z)} {\displaystyle =(x\vee y)\wedge (x\vee z)}

Taking x = 2 in the third law above shows that it is not an ordinary algebra law, since 2×2 = 4. The remaining five laws can be falsified in ordinary algebra by taking all variables to be 1, for example in Absorption Law 1 the left hand side would be 1(1+1) = 2 while the right hand side would be 1, and so on.

All of the laws treated so far have been for conjunction and disjunction. These operations have the property that changing either argument either leaves the output unchanged or the output changes in the same way as the input. Equivalently, changing any variable from 0 to 1 never results in the output changing from 1 to 0. Operations with this property are said to be monotone. Thus the axioms so far have all been for monotonic Boolean logic. Nonmonotonicity enters via complement

Nonmonotone laws

The complement operation is defined by the following two laws.
Complementation 1 x ∧ ¬ x = 0 Complementation 2 x ∨ ¬ x = 1 {\displaystyle {\begin{aligned}&{\text{Complementation 1}}&x\wedge \neg x&=0\\&{\text{Complementation 2}}&x\vee \neg x&=1\end{aligned}}} {\begin{aligned}&{\text{Complementation 1}}&x\wedge \neg x&=0\\&{\text{Complementation 2}}&x\vee \neg x&=1\end{aligned}}
All properties of negation including the laws below follow from the above two laws alone.[4]

In both ordinary and Boolean algebra, negation works by exchanging pairs of elements, whence in both algebras it satisfies the double negation law (also called involution law)
Double negation ¬ ( ¬ x ) = x {\displaystyle {\begin{aligned}&{\text{Double negation}}&\neg {(\neg {x})}&=x\end{aligned}}} {\begin{aligned}&{\text{Double negation}}&\neg {(\neg {x})}&=x\end{aligned}}
But whereas ordinary algebra satisfies the two laws
( − x ) ( − y ) = x y ( − x ) + ( − y ) = − ( x + y ) {\displaystyle {\begin{aligned}(-x)(-y)&=xy\\(-x)+(-y)&=-(x+y)\end{aligned}}} {\begin{aligned}(-x)(-y)&=xy\\(-x)+(-y)&=-(x+y)\end{aligned}}
Boolean algebra satisfies De Morgan's laws:
De Morgan 1 ¬ x ∧ ¬ y = ¬ ( x ∨ y ) De Morgan 2 ¬ x ∨ ¬ y = ¬ ( x ∧ y ) {\displaystyle {\begin{aligned}&{\text{De Morgan 1}}&\neg x\wedge \neg y&=\neg {(x\vee y)}\\&{\text{De Morgan 2}}&\neg x\vee \neg y&=\neg {(x\wedge y)}\end{aligned}}} {\begin{aligned}&{\text{De Morgan 1}}&\neg x\wedge \neg y&=\neg {(x\vee y)}\\&{\text{De Morgan 2}}&\neg x\vee \neg y&=\neg {(x\wedge y)}\end{aligned}}

2. Some examples.

& and
| or
! negation

In electronics the task is to create a l0gical(Boolean) expression from a verbal desorption that can be implemented in software or a hardware circuit.

A simple problem If I go outside and it is raining I will get wet. Boolean logic is algebraic in that it is based on logical variables that are either true or false. The convention for a variable is 0 false 1 true. In an electrical circuit 0 is generaly represented by zero volts, and 1 is represented by a positive voltage, but not always.

First step define variables

w weather 0 no rain 1 rain
l location 0 inside 1 outside
s status 0 dry 1 wet

Next step is a truth table

w l s
0 0 0
0 1 0
1 0 0
1 1 1

It is obvious the truth table represents conjunction or a Boolean AND.

In Boolean (a & b) = c means if a and b are then true the c is true.

The expression that matches the truth table is s = [l & w]

Another example

There is a locked room.

1. Mary and Bob can be in the room but not at the same time.
2. If Mary and Bob try to get in at the same time the door will not unlock
3. If mary is in the room and bob trues to get the door will not unlock
4. If bob is in the room and mary tries to get in the room the door will not unlock.

variables
mi 0 mary not in room 1 mary in room
bi 0 bob not in room 1 bob in room
md 0 mary not at door 1 mary at door
bd 0 bob not at door 1 bob at door.
ls 0 door locked 1 door unlocked

md bd mi bi ls
0 0 0 0 0
0 1 0 0 1
1 0 0 0 1
1 1 0 0 0
0 1 1 0 0

I won't do the entire truth table I can work out a solution in my head. There are techniques to derive the expression from a truth table. There can be many expressions that have the same truth table. The expression that has the minimum number of terms to implement the truth table is called a min term expression. Important because it means the min amount of electronic circuits.

Any argument should be reducible to a Boolean expression.

ls = [md | bd] & ![md & bd] & ![mi & bd] & ![bi & md]

3. EB

Boolean algebra is consistent. This means that regardless of inputs the outputs will be the same. Once the logic expression is established there can be no annuities and fallacies. A Boolean expression has one and only one truth table, there is no possible interpretations. If all this is not true then mathematical logic would be uselss.

As evidenced from years of debate on syllogisms on the forum, they can be subjective and open to interpretation.
Consider p1 Earth is flat p2 Earth is not flat stated as contradictory truths. In Boolean that can not be implemented. In any logical expression [a & !a] will ale always evaluate to false or 0.

[a & !a & b] will always be false regardless of the states of a and b. [a | !a | b] will always be true regardless of the states of a and b.

The fundament opearors in Boolean are & | !. All other opearors are built on these.

| inclusive OR, a definition
c = a | b
a b c
0 0 0
0 1 1
1 0 1
1 1 1

Exclusive OR derived one or the other but not both.
c = a XOR b
a b c
0 0 0
0 1 1
1 0 1
1 1 0

c = [a | b] & ![a & b] one or the oter but not both

Boolean algebra-logic is axiomatic just like geometry. Geometry also is logically consistent. It is deterministic. Given a logical expression there is one and only one truth table.

Syllogistic logic is not logically consistent. For example all Greeks are liars Joe says he is a Greek. It is not logical determinate.

Mathematical logic is not classical logic and syllogisms. It is a different way of thinking and applying logic.

4. Karnaugh Maps. If you have a logical argument that can be ereduced to a logic truth table K Maps can generate a logical expression for the truth table.

Used to be common by hand, now automated by software.

https://en.wikipedia.org/wiki/Karnaugh_map

The Karnaugh map (KM or K-map) is a method of simplifying Boolean algebra expressions. Maurice Karnaugh introduced it in 1953[1][2] as a refinement of Edward Veitch's 1952 Veitch chart,[3][4] which actually was a rediscovery of Allan Marquand's 1881 logical diagram[5] aka Marquand diagram[4] but with a focus now set on its utility for switching circuits.[4] Veitch charts are therefore also known as Marquand–Veitch diagrams,[4] and Karnaugh maps as Karnaugh–Veitch maps (KV maps).

The Karnaugh map reduces the need for extensive calculations by taking advantage of humans' pattern-recognition capability.[1] It also permits the rapid identification and elimination of potential race conditions.

The required Boolean results are transferred from a truth table onto a two-dimensional grid where, in Karnaugh maps, the cells are ordered in Gray code,[6][4] and each cell position represents one combination of input conditions, while each cell value represents the corresponding output value. Optimal groups of 1s or 0s are identified, which represent the terms of a canonical form of the logic in the original truth table.[7] These terms can be used to write a minimal Boolean expression representing the required logic.

Karnaugh maps are used to simplify real-world logic requirements so that they can be implemented using a minimum number of physical logic gates. A sum-of-products expression can always be implemented using AND gates feeding into an OR gate, and a product-of-sums expression leads to OR gates feeding an AND gate.[8] Karnaugh maps can also be used to simplify logic expressions in software design. Boolean conditions, as used for example in conditional statements, can get very complicated, which makes the code difficult to read and to maintain. Once minimised, canonical sum-of-products and product-of-sums expressions can be implemented directly using AND and OR logic operators.[9] Diagrammatic and mechanical methods for minimizing simple logic expressions have existed since at least the medieval times. More systematic methods for minimizing complex expressions began to be developed in the early 1950s, but until the mid to late 1980s the Karnaugh map was the most common used in practice.[10]