Science  People  Locations  Timeline
Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Home > Ternary logic


 

Ternary logic is a multi-valued logic in which there are three states, thus the ternary numeral system is used to represent ternary logic equations. This article is a work in progress.

1 Formal definitions

1.1 Significations

In ternary logic, the number symbols have the following meaning:

1.2 Ternary operators

1.2.1 Inversion (NOT)

1.2.2 Conjunction (AND), Disjunction (OR), Implication (IF...THEN), and Equivalence (EQUALS)

Ternary logic
x y Conjunctive (X Y) Disjunctive (X Y) Implication (X → Y) Equivalence (X ↔ Y)
00 0011
01 0110
02 2000
10 0100
11 1111
12 2122
20 2010
21 2112
22 2211

1.2.3 Other operators

All other ternary logic operators can be simulated by the four basic operators NOT, AND, OR and IF...THEN. There are 27 one-variable functions in ternary logic (as compared to 8 in binary logic). These functions can be represented in the following table.

f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11 f12 f13 f14 f15 f16 f17 f18 f19 NOT f21 f22 f23 f24 f25 f26 f27
0 0 0 0 2 2 2 1 1 1 0 0 0 2 2 2 1 1 1 0 0 0 2 2 2 1 1 1
1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 2 2 2 2 2 2 2 2 2
2 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0 2 1 0


The number of functions for a given number of variables for trinary logic can be calculated by the equation 3^3^v, where v represents the number of variables. This gives us 19,683 two-variable functions in trinary logic (compared with 16 for binary) and 7,625,597,484,987 three-variable functions.

2 Ternary logic in philosophy

3 Trits, tribbles, and trytes

4 Basic Ternary Algebra: Unary Functions

4.1 Constant functions

000 clear to 0 111 clear to 1 222 clear to 2

4.2 One-to-one functions

This might look better in tables and the symbols might look better in TeX.

F# Name Diff:012 Inverse Expression 012 buffer 012 A A 021 swap 1/2 '/\ 021 ['A ∪A 102 swap 0/1 /\' 102 ]'A ∩A 120 rotate up /// 201 ]A ∩A 201 rotate down \\\ 120 [A ∪A 210 swap 0/2 \'/ 210 'A A, or A'

Read more »


Non User