# Boolean Algebra Helper

Word count:
0

2012040110183822
Hi! I am a lookup tool for dealing with Boolean algebra.
The number above me is my identity, but if you look closer you can also see year, month, date and time.
If somebody like me can't answer your question directly, I will give you a number which you can search on this page using Ctrl+F.
You can also click on the links and your navigation history will be stored in the browser.

1. If you are missing something here or find a mistake, copy the identification number and go to 2012040110260422.
2. If you want to transform one expression to another, go to 2012040110301622.

2012040110260422
Hi! This is the helper for missing items on this site.
If you have noted down the number of the category you are missing, you can go to cutoutpro.com
and send the number to Sven Nilsen with an explaination of what you are looking for.

2012040110301622
Hi! I am the helper for transforming one expression to another.

1. If you need to learn basic rules, go to 2012040110340222.
2. If you want to learn how to invert an expression, go to 2012040123394822

2012040110340222
Hi! I am the helper for learning the basic rules of Boolean algebra.
There are 4 basic operations: OR, AND, NOT, EXCEPT.

5. If you want to learn about how to derive XOR using EXCEPT, go to 2012040123463922.

2012040110370022
Hi! I am the helper for learning the operation OR.
If we have two states A and B that can be either "on" or "off",
then "A + B" is an OR operation that always return "on" if either A or B is "on".

For example: A = chocolate and B = strawberry.
I want an ice cream that "A + B" means "either chocolate or strawberry or both.

2012040110425422
Hi! I am the helper for learning the operation AND.
If we have two states A and B that can be either "on" or "off",
then "A * B" is an AND operation that return "on" only if both A and B is "on".

For example: A = blue eyes and B = long hair.
There goes a person that "A * B" means "got both blue eyes and long hair.

2012040111011122
Hi! I am the helper for learning the operation NOT.
If we have one state A that can be either "on" or "off",
then "!A" is a NOT operation that always return "on" if A is "off",
or "off" if A is "on".

For example: A = strong arms.
I have fought a stranger which "!A" means "didn't have strong arms".

2012040111062422
Hi! I am the helper for learning the operation EXCEPT.
EXCEPT is written as subtraction, but follows some strange rules:

``` A + B - C = (A + B)*!C ```

For example: A doctor is going through with the procedure and treatment, except if the patient shows signs of recovering.

The EXCEPT rule disrupts the whole thing if the state is "off".

2012040111122422 2012040914504923
Hi! I am the helper for understanding the connection between EXCEPT and XOR.
If we got two states A and B that can be "on" or "off",
we can have two rules, one when B disrupts A and when A disrupts B:

``` A - B B - A ```

If A and B are "on" at the same time then none of the rules are "on".
If we set up a truth table, it will look like this:

 A B A XOR B 0 0 0 0 1 1 1 0 1 1 1 0

We can make one rule out of these two:

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

This operation is called XOR.

2012040111213622
Hi! I am the helper for dealing with EXCEPT in paranthesis.
When we have an expression like this:

``` A + (B - C) ```

We can't resolve the paranthesis like you are used to in basic arithmetic!
The minus sign means an exception and the paranthesis control the scope of the domain of the exception.
To resolve the paranthesis you first need to transform into the alternative form:

``` A + (B - C) = A + B*!C ```

If there are two paranthesis with same exception, we can put the exception at the outside:

``` (E - F) + (G - F) = E + G - F ```

2012040123463922 2012040914470723
Hi! I am the helper for deriving the XOR rule using EXCEPT.
By drawing a Venn diagram, we know that we can write XOR as:

``` A + B - A*B ```

Using the rule of transforming Boolean expressions into opposite, we can write

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

We can now insert this into the expression:

``` A + B - A*B (A + B)*(!A + !B) A*!A + B*!B + B*!A + A*!B ```

We know that A*A! and B*!B is always "off".
When we remove these terms we get:

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

2012040123394822
Hi! I am the helper for inverting an expression.

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

It is easiest to think of '*' as the inverse of '+'.
Take the invert by inverting each term.

2012040123432622
Hi! I am the helper for nested EXCEPT rules.
When there is an exception to the exception, this can be splitted into two rules.

``` A - (B - C) A*!(B-C) A*!(B*!C) A*(!B + C) A*!B + A*C (A - B) + A*C ```

Lacks reference
Hi! I am the helper for understanding the connection between EXCEPT and programming return commands.
EXCEPT or a negative Boolean expression can be thought of something that disrupts the algorithm.

``` function myMethod(a) {  // This is a condition where this rule will fail.  // Therefore, we need to return.  if (a == 0) return;    // Do something. } ```

If the rest of algorithm was A and the condition for disruption B, then we could just write

``` A - B ```

Lacks reference
Hi! I am the helper for understanding how XOR pattern in programming can make code easier to read.
Write a function that calls all the functions and put the condition inside each function instead of outside.
This helps you to organize the code in a way where you can see under what condition the algorithm operates under.

``` doA(); doB(); doC(); function doA() {  if (!aSelected) return;  // Do the work. } ```

If only one function does the work at a time, you can write them in any order.
This is called an XOR pattern of functions.

Lacks reference
Hi! I am the helper for solving equations using Boolean algebra.
The best way to deal with equations is to write them in a form with '+' (OR) and '-' (EXCEPT):

``` A + B = C + D ```

We want to solve this for A:

``` A = C + D - B ```

Lacks reference
Hi! I am the helper for dependencies using Boolean algebra equations.
When we solve an equation by writing a single term on one side,
we can think of this as a function call that got the dependicies on the other side.

``` A = C + D - B ```

In normal programming languages, each line is executed one by one.
We can use Boolean equations to define a way of executing that relies on the conditions.
If a state is 0, it is not executed or is not yet done.
If a state is 1, it is done.

``` B = 1 A = B ```

B is always executed, which means it counts as a starting point.
A is executed after B.

2012040915170823 2012041010414823
Hi! I am the helper that teaches you about bitstream vectors.
A bitstream vector is starting at 0 and changes up and down:

``` ______------------____----________ ```

A more compressed way of writing this is a list of the positions when it changes:

``` [5,14,17,20] ```
1. If you want to learn how to perform a NOT operation on bitstreams, go to 2012040915215623.
2. If you want to learn about connection between bitstream and numbers, go to 2012040915193523.
3. If you want to learn about conservation of information in bitstream vectors, go to 2012040915205023.
4. If you want to learn about doing nested XOR operations on bitstreams, go to 2012040915235923.

2012040915193523
Hi! I am the helper for understanding the connection between bitstream vectors and numbers.
The number 12 can be represented as a bitstream vector:

``` ___------------___ ```

We can write `|A| = 12`.
A - B in a bitstream vectors means something different than numbers |A| - |B|.

``` ___------------_____ A _____------------___ B ___-________________ A-B ```
``` ------------ |A| ------------ |B| |A|-|B| = 0 ```

A number is a bitstream vector that removes all the places with 0 and then is compared to `|-|`

2012040915205023
Hi! I am the helper for understanding conservation of information in bitstream vectors.
What we mean about conservation of information is that all the numbers appear in same amount as in the calculation.
When performing AND and OR on two bitstream vectors A and B,
the totalt amount of information is constant if we look at both results.

``` [4,10] * [2,6] = [4,6] [4,10] + [2,6] = [2,10] ```

When we are performing EXCEPT A-B and B-A the information is also conserved:

``` [4,10] * [0,2,6] = [6,10] [0,4,10] + [2,6] = [2,4] ```

2012040915215623
Hi! I am the helper for performing NOT operation on a bitstream vector.
The bitstream got a number for each time it switches value, so we can invert it simply by putting in a 0 at the beginning of it:

``` ![2,4] = [0,2,4] ```

If there already is a 0 there, we can remove it:

``` ![0,2,4] = [2,4] ```

2012041010371223
Hi! I am the helper for deriving IMPLICATION using an equation.
Let's say B is command that depends on A being executed before it:

``` B = A ```

When we move B over to the other side zero at the left side:

``` 0 = A - B ```

0 in Boolean algebra is always false, so we need to invert both sides to get the true law:

``` !0 = !(A*!B) 1 = !A + B ```

If A is 1, then B has to be 1.
If A is 0, then B can be 0 or 1.
This is called IMPLICATION and is written like this:

``` A → B ```

You can also write it in 3 other forms:

``` (A → B) = (A ← B) = (!B → !A) = (!B ← !A) ```

When the arrow points to the left, we read it as "If B, then possibly A".

1. If you want to learn about extracting IMPLICATION from datasets, go to 2012041010460623

Lacks reference
Hi! I am the helper for nested implications.

``` A → B → C 1 = !A + !B + C ```

Lacks reference
Hi! I am the helper for deriving nested implications:

``` A = B*C*D 0 = B*C*D - A 0 = B*C*D*!A !0 = !(B*C*D*!A) 1 = !B + !C + !D + A ```

This describes only the last part.
We need one equation for each step to define the specific order:

``` 1 = !B + C 1 = !B + !C + D 1 = !B + !C + !D + A ```

Lacks reference
Hi! I am the helper for deriving multiple EXCEPT rule in two ways:

``` A - B - C A - (B + C) A*!(B + C) A*!B*!C ```

Another way:

``` A - B - C A*!B - C A*!B*!C ```

Lacks reference
Hi! I am the helper for understanding precedence in Boolean algebra.
We can write the precedence as a list of operators where the first got highest and the last got lowest:

``` [!, *, -, +] ```

Subtraction is special because it operates on the whole expression where it belongs to.

Lacks reference
Hi! I am the helper for understanding the boundaries in Boolean algebra.
When we got two numbers, A and B, but don't know the bitstream vectors, we got following law:

``` |a-b| >= |a| - |b| <= |a| ```

Lacks reference
Hi! I am the helper for understanding symmetry of splitting and joining water bubbles:
When we got two amounts, A and B, that can partly intersect but has following relationship:

``` |a-b| = |b-a| ```

Then it is possible that `a = b` or that they are complete separate.
They can also change in size, like two small bubbles that merge to form a larger one.

Lacks reference
Hi! I am the helper for describing the perfect crime.
When we got two amounts, A (things you want others to believe) and B (lies),
then the truth C is an XOR operation between A and B:

``` C = (A - B) + (B - A) ```

Since the crime is performed in the past and others know only the effect of it,
then the effect has to match with what could be happening if your story was true:

``` |C| = |A| = |(A - B) + (B - A)| ```

In addition, if somebody performs a control D with the past,
you want it to match the story:

``` |D*A| = |D*C| = |D*(A - B) + D*(B - A)| D*(A - B) = D*A*!B = A*(D - B) D*(B - A) = D*B*!A = B*(D - A) D*A = A*(D - B) + B*(D - A) ```

If your story covers all the controls, then `D - A = 0`.
If that is true, then `D - B = D`.

D*A = A*(D - B) + B*(D - A)
D*A = A*D + B*0 = A*D

Lacks reference
Hi! I am the helper for understanding equality.
If we got two amounts, A and B, which got the relation:

``` A = B ```

Then we can reformulate it to be:

``` A - B = 0 ```

What if B contains all elements of A but got some extras?
This does not violate the equation because if we move A to the other side:

``` 0 = B - A ```

We know they have to be equal bit for bit.

Lacks reference
Hi! I am the helper of understanding the `(-1)^2 = 0` in Boolean algebra.
This is different from normal numbers, but can be demonstrated using following example:

``` A - 1 = 0 0 - 1 = (-1) = 0 ```

Therefore, we can write the equation:

``` (-1)*(-1) = (-1)^2 = 0 ```

Lacks reference
Hi! I am the helper of solving equations with absolute subtraction.

``` |A| - |B| = |A - B| ```

The equation above tells us something of the relationship between A and B.
We can write the absolute value of subtraction in complete form and use insertion:

``` |X - Y| = |X| - ( |Y| - |Y - X| ) |X - Y| = |X| - |Y| + |Y - X| |A| - |B| = |A| - |B| + |B - A| 0 = |B - A| ```

What we found out was that all elements in B is also in A.

Lacks reference
Hi! I am the helper for understanding bitstream division.
A week is divided into 7 parts and each part is called "day".
We can use bitstream division on all amounts that got the relations:

``` N*|A/N| = |A| ```

The amount |A/N| is thought of as "any of the N parts of A".
For example:

``` 7*|week/7| = 7*|any day| = |week| ```

The length of any day is 7 times shorter than a week.

2012040915235923
Hi! I am the helper for calculating nested XOR operations.
If you have a sequence of 0s and 1s, you can calculate the nested XOR operation on all these bits,
by adding all the 1s together and then take modulus 2:

``` |A|%2 = A0 XOR A1 XOR A2 XOR ... ```

This trick is specially useful when calculating with bitstreams, because you can't see the bits directly.

``` __--__---_ |[2,4,6,9]| = (4-2)+(9-6) = 2+3 = 5 5%2 = 1 ```

The answer is then 1. If the length of the bitstream was 6, the answer would be 0.

``` 10 / 3 = 3 ```

If we want to know how much of the number 10 is lost, we can use the modulus (%) operator.

``` 10 % 3 = 1 ```

If the programming language supports it, you can take modulus of float data types:

``` 12.4 % 3 = 0.4 ```
 A B C A - B - C 0 0 0 0 0 0 1 0 0 1 0 0 0 1 1 0 1 0 0 1 1 0 1 0 1 1 0 0 1 1 1 0

The last row is `23-1 = 8-1 = 7`.

You can also write a truth table in a more compressed way,
because if we assume the order of the bits they are written, we can just write the last column:

``` A - B - C = "____-___" = [4,5] ```

It says that the truth value starts at binary 4 (100) and ens at 5 (101).
All other positions are 0. This is what I call a "bitspace", which is a bitstream vector on combinations.

2012041010460623 2012041010563223
Hi! I am the helper for learning about knowledge extraction from datasets.
Here is what a fictional family "Greenhound" likes of food:

``` woman + man + swedish + cheese + pizza + wine + beer - fish - shrimps - snakes - snails ```

There are both woman and men in the family, so we need to specify this possibility.
The properties with negative sign is what nobody in the family likes.

Imagine a large sets of such data, then you are challenged to find out if a certain law is true.
We can write a law as an expression `A → B`, read as "When A happens, B is true."

``` (A → B) = (A ← B) = (!B → !A) = (!B ← !A) ```

When the arrow points to the left, it means "possibly", so `A ← B` means if B, then possibly A.
We can never know that a law is valid forever, we can only find out if it is false by looking for exceptions.

The truth table returns 0 when the law is false, with a 0 for minus sign (-) and 1 for a plus sign (+):

 A B A → B 0 0 1 0 1 1 1 0 0 1 1 1

If one of them are missing, then jump over it and continue searching.
Take a nested AND operation of all rows, and you will find out if the law is true for the dataset!
Written in bitstream format:

``` A → B = "--_-" = [0,2,3,4] ```

2012041017081123 2012041022480823
I am the helper for introducing HAVOX symbols and thinking.
This is a special kind of reasoning to study the beliefs about objects or situations.

For example: "He stole my car!" is an expression that contains 4 claims:

``` He (could be she, it, they, ...) Stole (could be crashed, borrowed, parked, cleaned, ...) My (could be his, her, theirs, not mine, ...) Car (could be bike, truck, train, plane, ...) ```

If we know that this situation applies, to a car, we can eliminate that option so we got 3 claims "He stole my car!".
You can also combine two claims together, for example "my car", "their truck", "my truck", "their car".
The general thing is that every situation in the universe can be boiled down to 3 claims:

``` Input → Function → Output My Car → Was Stolen → He Did It ```

We can make it longer, but for most practical applications 3 is enough.
Each level can be assigned a value 0 if two beliefs are similar or 1 if two beliefs are different.

The strange thing is that if two people believe the same `Input` and `Function` they should come to the same conclusion.
This applied backward also, because if two people believe the same `Function` and `Output` they should figure out the same `Input`.
We can write this as a binary number where there are no neighbour 1s both 1s, like "011" or "110".
(You can also invert the bits, thinking of it like a distance, but I use this notion here for consistency with bitspace calculations).
If there are two following 1s, then they all should be 1s.
Another way of writing this is to look at the change from each level to the next, this way we don't have to worry about the bits being inverted or not:

``` 00 = - 01 = < 10 = > 11 = = 000 == (H) 001 => (A) 100 <= (V) 101 <> (O) 010 >< (X) 011 >- 110 -< 111 -- ```

When two people disagree, it does not mean one belief is violating what is possible.
Every combination in HAVOX is valid as additional explainations.

1. If you want to learn more about how HAVOX is used in practical situations, go to 2012041013135323.

2012041013135323
Hi! I am the helper for learning to use HAVOX symbols in practical scenarios.

For example, if you find out that cows in Denmark (input) spread a desease (function) so they die (output) and there is
a cow in England that gots ill of mysterious reasons.
You write down different scenarios you think is plausible for each level.

Input = {An English cow, A transported cow from Denmark to England}
Function = {Got the same desease, Got another desease}
Output = {The cow will die, The cow will not die}

Then you ask two people of what they believe:

``` Facts (what is possible): (English cow + Danish cow) → Got the same desease → The cow will die John: A transported cow from Denmark to England → Got the same desease → The cow will die Matt: An English cow → Got another desease → The cow will not die Luke: An English cow → Got the same desease → The cow will not die John vs Facts = -- Matt vs Facts = <= Luke vs Facts = -< ```

Notice that we don't know the actual situation, the only facts we got is the law of what is possible.
Luke believes something that is inconsistent with the facts, you can see that because he has two zeroes.

Lacks reference
Hi! I am the helper for correcting a belief against a more certain rule.
Usually, when you test against a situation, you can calculate 0 or 1 for each level and compare those between the rules.
When you don't have situations to test agains, you still can update belifs by doing a trick.
If the intersection between two beliefs compared to one of them are the same or 0 in 2 following layers but not all, then one of the beliefs must be wrong!
This means we can just smash two beliefs together and see if they are consistent.
For example, if we believe `A → E → F` we can learn from another belief AND with each term:

``` A → E → F vs (A + C - D) → E → (F + G) (A*(A + C - D)) → (E*E) → (F*(F + G)) (A*(A + C)*!D) → E → F (A - D) → E → F ```

When we compare the new belief vs the old one, we get an invalid HAVOX `>-`.
This means the old belief and the other can not both be true.
Another example:

``` H → F → H vs (A + C - D) → E → (F + G) (H*(A + C)*!D) → (F*E) → (H*(F + G)) (H*A + H*C - D) → (F*E) → (H*F + H*G) ```

We get H (==) compared to the old belief and therefore they both can be true.
If for example F is "physics" and E is "astrology" then F*E = 0 and a special law applies called "HAVOX collapse".
This is because "physics" and "astrology" can not both be true under any circumstances.

2012041017114723
Hi! I am the helper for learning HAVOX collapse.
We can write a 3 layer HAVOX as an equation of nested IMPLICATION:

``` A → B → C 1 = !A + !B + C ```

In our case, B is always 0:

``` B = 0 1 = !A + 1 + C ```

Since we got 1 at both sides of the equation, the value of A and C does not matter.
This is like pulling out the plug of HAVOX.
Two beliefs that seemingly are plausible and compatible for a long time, can turn out that one of them is completely wrong.
This is because beliefs are, after all, just beliefs X and the truth with big T might turn out that T*X = 0.

Some people use a technique when the belief collapses to jump over to another one and hold on to it until it collapses.
There are that many possible beliefs that you can call them "swimming in the HAVOX ocean".
The point with HAVOX is to find ways to correct or test beliefs and consider all other possibilities, not to stick to a single without evidence.

Lacks reference
Hi! I am the helper for teaching Nilsen/Occam's Number or "non".
We got two beliefs and compare them with HAVOX:

``` ==>< ```

We want to calculate the complexity of these beliefs, the only thing we need is the number of layers.
Sincere there are 5 of them, we can use the following formula:

``` fib( 5 + 2 ) = 13 non ```

This tells us how many types of consistent beliefs we could make at this level of complexity in worst case.
The efficiency of Occam's Razor is the difference from one complexity level to another.
Since the Fibonacci sequence is the sum of the two last terms, we can write the increase of complexity by one level as:

``` fib( x + 2 ) - fib( x + 1 ) fib( x + 1 ) + fib( x ) - fib( x + 1 ) fib( x ) ```

For example x = 8 got 21 "non" more than x = 7.
The ratio which the increase of "non" compared to the total in previous layer approaches the golden ratio conjugate 0.6180339887498949
This means that approximately each level is a gamble of hitting a target with `2-φ` or 38.2% accuracy, in a row.

The "non" number is a two edged sword:
It estimates both possible compatible beliefs + number of possible contradicting beliefs if one collapses all the others.
Finding out which is collapsing the others will save you a lot work.
This can be done by a computer by extracting knowledge from datasets with a fairly easy algorithm.

Lacks reference
Hi! I the helper for teaching the identification of HAVOX beliefs.
We have a set of beliefs:

``` X = {X0, X1, X2, ...} ```

Each person can have their own belief, but two or more persons can share beliefs within some limits.
The problem is that a belief is not a physical object, it is like imagining the "spirit" of a team or group of people.
What makes a belief unique?

When we perform comparisons on beliefs (from now called objects), we can assign each comparison test a value in a set C.

``` C = {C0, C1, C2, ...} ```

Each comparison is static, they all take two arguments `C(A,B)` and returns 1 if A and B are equal, if not it returns 0.
The result we get from the comparison test can be thought of as a relation between A and B.
Since we can perform multiple tests between A and B, we can use multiple bits, one for each test.
Here is all possible relations with 4 tests:

``` 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 ```

Let's say we know the relation between (A,B) and (B,C). To find the relation between (A,C) we take the XOR operation:

``` (A,B) = 0101 (B,C) = 1110 (A,C) = (A,B) XOR (B,C) 0101 XOR 1110 = 1011 ```

Look at the first bit: `0 XOR 1 = 1`
It is logical that if A differs from B in one way, but B is similar to C, then A and C has to be different.
No matter how many tests or objects we have, we know we can use the XOR operator to navigate from one to another.
If C has a neighbour D, we can find (A,D) because we know (A,C) and so on.
If two objects C and D got the same relation to A, then C and D are not unique with respect to A.

Lacks reference
Hi! I am the helper for learning how error correcting works.
Here we have a table of 0s and 1s in couples and a corresponding checksum using nested XOR operations:

 01 10 11 00 11 11 00 00 10 10 11 11 00 01 11

When transmitting this message from one computer to another, we can check for errors by recalculating the checksums.
If we get the wrong checksum in a row and a column, we know where the error is:

 01 10 11 00 11 10 00 01 10 10 11 11 00 00 11

Not only this, but since the XOR is performed independently on the bits in each cell, we know the specific bit:

 01 10 11 00 11 10 00 01 10 10 11 11 00 00 11

You can perform this on larger tables and on larger chunks of data, for example 32 bits in each cell.

Lacks reference
Hi! I am the helper for doing AND operations on advanced expressions.
The general rule, is that you can move the negative terms outside the paranthesis:

``` (A - B)(C - D) = (A)(C) - C - D = A*C - C - D ```
Word count:
0