Logical Operators, Truth Table, Unicode

By Xah Lee. Date: . Last updated: .
true false ambigram
true false ambigram

Truth Table and Possible Logical Operators

Here's definition of the operator “and”, using a black triangle ▲ to represent the operator:

And
0 ▲ 0 = 0
0 ▲ 1 = 0
1 ▲ 0 = 0
1 ▲ 1 = 1

Here's definition of the operator “or”, also using a black triangle ▲ to represent the operator:

Or
0 ▲ 0 = 0
0 ▲ 1 = 1
1 ▲ 0 = 1
1 ▲ 1 = 1

Consider their results, we can encode the definition in a condensed way by the code 0001

“Or” is therefore 0111

These can be considered as 4-digit binary numbers. So, number of possible logical function with 2 parameters are the same as total number of 4 digit binary numbers, and that's 16. (2^4=16) Let's see the complete list of what they are, and what they are named, and their symbols, if any.

Truth Table; All Possible Logical Operators

DefinitionCodeNameSymbolComment
0▲0=0; 0▲1=0; 1▲0=0; 1▲1=00000false
0▲0=0; 0▲1=0; 1▲0=0; 1▲1=10001and
0▲0=0; 0▲1=0; 1▲0=1; 1▲1=00010
0▲0=0; 0▲1=0; 1▲0=1; 1▲1=10011
0▲0=0; 0▲1=1; 1▲0=0; 1▲1=00100
0▲0=0; 0▲1=1; 1▲0=0; 1▲1=10101
0▲0=0; 0▲1=1; 1▲0=1; 1▲1=00110xor
0▲0=0; 0▲1=1; 1▲0=1; 1▲1=10111or
0▲0=1; 0▲1=0; 1▲0=0; 1▲1=01000nor
0▲0=1; 0▲1=0; 1▲0=0; 1▲1=11001xnor⊻̅The symbol is a combining char in Unicode.
0▲0=1; 0▲1=0; 1▲0=1; 1▲1=01010
0▲0=1; 0▲1=0; 1▲0=1; 1▲1=11011
0▲0=1; 0▲1=1; 1▲0=0; 1▲1=01100
0▲0=1; 0▲1=1; 1▲0=0; 1▲1=11101
0▲0=1; 0▲1=1; 1▲0=1; 1▲1=01110nand
0▲0=1; 0▲1=1; 1▲0=1; 1▲1=11111true

It is interesting to note that half of them don't have a name. Wikipedia on Logical connective gives some name to some of them. For example, the “0000” is just “false”, the “1111” is “true”, the “1101” is “if/then”. Though, much of these names are rather forced and don't make much sense. First of all, remember we are dealing with functions of 2 parameters (so-called “binary operators”). The term “true” isn't usually thought of as a binary operator, and the “if then” and “not” doesn't make sense here neither.

[see Unicode Math Symbols ∑ ∫ π² ∞]

Functional Completeness

A set (L) of binary logical operators are “functional complete” if the semantic of any of the 16 possible logical operator can be expressed by a combination of operators in the set L.

We know that the total number of possible binary function in the binary space {1,0} is 16, from the truth table above.

So, a functionally complete set of function is one that any of the possible function in truth table can be expressed by a combination of the functions in the set.

One of the functionally complete set of function is just one single function the nand by itself.

Exercise 1: express all possible binary functions by nand.

Exercise 2: write a program that lists all possible sets of binary logical operators that are functional complete.

Patreon me $5. Ask me question on patreon