Title: The Mystery of the Binary
Author: Viznut
Originally published in the [ALT] magazine issue 0x0000
("The first issue (0x0000) of the 76-page A5-sized [ALT] magazine was
released in August 2003 at Assembly '03. It covers everything from matters
of the demoscene to commentary to poetry. 200 copies were printed, of which
about 150 were distributed at Assembly.")

The Mystery of the Binary


The subcultures of computing are very young.

There are no legends nor values that come from the distant past. No ancient
mysticism, no generations-old symbols that have deep emotional effects. Even
the old and classical things tend to be quite recent.

Fortunately, even the past is not static.

I've written this article to give an impression of the antiquity and
mysticism that lies behind a very essential concept of computing - the
binary numerals.

Enjoy.

Stone-age binary counting

We are so completely surrounded by decimal numbers that most people believe
humans were "built" to count in base ten: "we have ten fingers, you know."
The binary system is assumed to be something very modern, recently invented
for constructing all these wonderful windows-peecees and portable mp3
players. Whenever capitalists give you ones and zeros in TV advertisements,
they want you to forget the past and start drooling at some new futuristic
device instead.

I dare to totally disagree. I am quite convinced that humans counted in the
binary base long before anyone got the idea of using their fingers (or toes)
to indicate numerical measures. Just take a look at the languages of some
"stone-age" peoples still living today. Some of them have very rudimentary
number systems that only have words for "one" and "two". Some don't have any
numbers at all, but even they tend to have at least a word that means
"double" or "two similar things".

The differentiation between one and two is maybe the oldest mathematical
concept known to mankind. Most of the things in the human body are either
single or double. Humans need to be in pairs to reproduce. The human mind
also seems to love dualistic associations to all kinds of things: good/bad,
bright/dark, friend/enemy, masculine/feminine, et cetera.

Many cultures have very strong relationships to the number two. Two is the
perfect number, and everything must come in pairs in order to stay intact.
Odd numbers bring bad luck because they can't be divided in two equal
halves. If twins are born, they are considered sacred, more perfect than
their "non-doubled" tribemates.

Let's see the number system of the nearly extinct Gumbaynggir language of
Australian aboriginals:

 1 = galugun
 2 = bulari
 3 = bulari-galugun
 4 = bulari-bulari
 5 = bulari-bulari-galugun
 6 = bulari-bulari-bulari
 7 = bulari-bulari-bulari-galugun

Elegant, isn't it? Of course, this kind of counting is not very useful when
it comes to large numbers (three or bigger). When dealing with large
numbers, some new concepts are desperately needed.

If a mind that only knows about "one" and "two" wants to handle large
amounts of things, the most natural way in my opinion is to form pairs, then
pairs of pairs (groups of 4), pairs of pairs of pairs (groups of 8), and so
on. If the mind gives names to these groups, it suddenly has the possibility
of composing numbers from powers of two - a binary number system.

The number system of the Medlpa language spoken in Papua-New-Guinea is based
on the addition of powers of two:

Decimal Medlpa            Interpretation
------- ------            --------------
 1      tenda              "one"             
 2      ragl               "two"             
 3      ragltika           "twone"           
 4      tembokak           "four"            
 5      pömp tsi gudl      "one past four"   
 6      pömp ragl gudl     "two past four"   
 7      pömp ragltika gudl "twone past four" 
 8      engak              "eight"           
 9      pömp tsi pip       "one past eight"  
 10     pömp ragl pip      "two past eight"  

What if you want to use fingers for counting in systems like this?  Simple:
just forget one finger from each hand and one toe from each foot, and you
have a very beautiful octal or hexadecimal base.

Divine binary protocols

The human mind has a strange relationship with randomness. It both loves
random and unexplainable things, but at the same time denies their
randomness and tries to give them understandable explanations. The random
occurrences in life are typically attributed to something supernatural. Even
modern human beings who think bearded guys in the clouds are a silly idea
tend to blame "fate" for the incidents they fall into.

What if you want a straight answer to a question from your favourite
supernatural being? By causing something random to happen, of course. The
simplest method is perhaps the casting of a two-sided object, which
transfers one bit of information - such as a simple "yes" or "no" - from the
divine plane to the mortal one.

However, there are some serious problems in this one-bit protocol. Not just
that it is difficult to believe in the superiority of a being whose
vocabulary only consists of "yes" and "no", but also the fact that straight
and clear answers are so easy to falsify. The gods definitely require more
bandwidth for providing more mysterious, fuzzy and general-purpose
responses.

A logical method for increasing the amount of information is by repeating
the process of obtaining it. The Chinese and some African cultures are known
of their divination techniques that generate combinations of binary
selections. The African techniques typically generate four- and eight-bit
combinations, whereas the Chinese ones produce three- and six-bit ones. Each
of the possible resulting combinations is associated with some mystical
verses that are supposed to be able to answer all questions.

The Two Symbols

There's a great deal of similarity between the African and Chinese notations
for binary combinations: both use vertical piles where a single bit is
designated by one or two "somethings", such as sticks, stones or seeds.

Later in this article, we convert these symbols into the "western" binary
notation by reading them in the Chinese way (from bottom to top, with the
most significant bit on the bottom). "Singles" are converted into 1's and
"doubles" into 0's.

Modern symbol      1           0
Chinese symbol   #####       ## ##     
Sikidy symbol      o          o o       
Numeric value    Odd (2n+1)  Even (2n) 
Taoist polarity  Yang        Yin       
Perfection       Incomplete  Complete  
Activity         Active      Passive   
Gender           Male        Female


The Eight Trigrams

The eight trigrams (3-bit numbers)

This figure shows the eight trigrams (the three-bit numbers) in the
millennia-old Chinese Xiantian arrangement. Start from the bottom and read
the triplets counter-clockwise: 000, 001, 010, 011, 111, 110, 101, 100. The
right half is in ascending binary order whereas the left half is in
descending order. Note that this causes the complement of each trigram to be
on the opposite side of the circle.

In the middle of the figure is the symbol of Tàijí, "the Extreme Ultimate". Tàijí is the unity from which everything originates: the unity splits into duality, the duality splits in four, the four splits in eight etc. The Taoist universe consists of an infinity of binary data - yins and yangs constantly turning into each other. The only unchanging thing is the ultimate principle itself.

Trigrams can be found everywhere. The flag of South Korea contains the four symmetrical three-bit binary numbers. In the Feng Shui system (mega-fashionable in the West nowadays) you may even hang binary numbers on your walls because you believe in their magical power of modifying the energies inside the building.

Three is the smallest amount of bits that allows for a "true RGB palette" (one bit for each of the red, green and blue components). Incidentally, the Chinese trigrams have also been traditionally associated with colours, so I'll list them in the table along with the RGB colours.

Binary Decimal P(ol)arity Chinese name Chinese colour RGB ------ ------- ---------- ------------ -------------- --- 000 0 yin kun (receptive, earth) yellow black 001 1 yang gèn (keeping still, mountain) purple blue 010 2 yang kân (abysmal, water/moon) black green 011 3 yin xùn (gentle, wood/wind) orange cyan 100 4 (-4) yang zhèn (arousing, thunder) green red 101 5 (-3) yin lí (clinging, fire/sun) red purple 110 6 (-2) yin duì (joyous, swamp) cyan yellow 111 7 (-1) yang qiàn (creative, sky) blue white

The Sixteen Tetragrams

One of the 65,536 possible Sikidy tableaux

The Chinese have mostly been using their binary combinatorics for
philosophical and religious things. This is also true for the African use of
binary systems.

There are actually at least three types of African binary divination
techniques, all of which use four-bit combinations: Ifa (West Africa), the
four-tablet system (South Africa) and Sikidy (Madagascar). The former two
are quite straight-forward (randomise a combination and interpret its
meaning), but Sikidy requires more advanced computation.

The first step in Sikidy is to randomise four columns of four bits (a
four-by-four matrix). The randomisation of one bit usually happens by
grabbing a handful of seeds from a bag and removing two seeds at a time
until only one or two seeds are left. (This gives a totally new meaning to
the concept of "random number seed"). The one or two seeds are then placed
in their proper position on the Sikidy board.

The figure above shows an example of a completed Sikidy board. The
randomised columns (called "Mother-Sikidy") are in the upper right corner.
The values of the columns from right to left, bottom to top are: 1010, 1001,
1011, 0010.

The next thing to do is to form the "Daughter-Sikidy" by rotating and
flipping the matrix. The rightmost column of the Mother-Sikidy (bottom to
top) becomes the top row (left to right) of the Daughter-Sikidy, and so
forth. Our Daughter-Sikidy (placed to the left of the Mother-Sikidy) is
therefore: 0110, 1101, 0000, 0111.

The rest is pure binary arithmetic. The columns below the Mother-Sikidy and
Daughter-Sikidy are formed by eXclusive-ORing each pair of columns: 1010 XOR
1001 = 0011, 1011 XOR 0010 = 1001, etc. This process is then repeated to all
the new lines until there is only one column left (the bottom column, 0110
in the example).

We now have a complete Sikidy tableau and what is left is the
interpretation: each of the sixteen binary values has its own meaning, and
each of the "memory slots" also has a designated meaning. The interpretation
requires a high level of expertise (or perhaps just a wild imagination).

The Sikidy system was also adopted by Arabs (under the name of "ilm
al-raml", "the science of sand"), and from Arabs it even transferred to
Europe in the Middle Ages. In Europe, it was known as "Arabic geomancy", a
small branch of Arabic occultism. All kinds of freaks extended to system to
include relationships with astrology, numerology, tarot and other things.

Binary Base-16/10  Latin name                     Direction Gender Element
------ ----------  ----------                     --------- ------ -------
0000   0           Populus (people)               both      F      Water 
0001   1           Laetitia (joy)                 up        M      Air
0010   2           Rubeus (red)                   up        M      Fire
0011   3           Fortuna Minor (small fortune)  up        F      Earth
0100   4           Albus (white)                  down      F      Water
0101   5           Amissio (loss)                 up        M      Fire
0110   6           Conjunctio (reunion)           both      M      Air 
0111   7           Cauda Draconis (dragon's tail) up        F      Earth 
1000   8 (-8)      Tristitia (sadness)            down      F      Earth 
1001   9 (-7)      Carcer (prison)                both      F      Water 
1010   A (10, -6)  Acquisitio (gain)              down      M      Air 
1011   B (11, -5)  Puer (boy)                     up        M      Air 
1100   C (12, -4)  Fortuna Major (big fortune)    down      M      Fire 
1101   D (13, -3)  Puella (girl)                  down      F      Water
1110   E (14, -2)  Caput Draconis (dragon's head) down      M      Fire 
1111   F (15, -1)  Via (way)                      both      F      Water


The 64 Hexagrams

hexagrams

The figure above presents the six-bit binary combinations in two different
arrangements: an eight-by-eight matrix (in ascending binary order) and a
"xiantian"-ordered circle. The figure was composed in the 11th century by
Shào Yong, the famous philosopher and oracle who believed that this was the
original "xiantian" order in which the legendary emperor, Fú Xi, discovered
the hexagrams millennia ago.

Centuries later, the German philosopher G.W.Leibniz received a copy of this
figure from Jesuits who were trying to convert Chinese people into
Christianity. Leibniz was so astonished by this figure that he went on to
write the first European text about binary mathematics (Explication de
l'arithmetique binaire, 1705). Later, Leibniz also wrote some interesting
stuff about the relationship of binary numbers to the very essence of the
universe, but that's a different story.

Yì Jing ("I Ching") is the ancient book that presents the sixty-four
hexagrams and associates them with names and mysterious verses. It is
basically an oracular handbook ("give me a random number and I'll tell
you what lies ahead"), but because of itse highly-honoured status in the
Chinese culture, its "message" was very thoroughly examined during the
millennia.

The properties of the six-bit numbers were studied by examining them as
whole entities (symmetry, yin/yang constitution, visual shape etc), and in
small pieces (the properties of every sub-trigram, and also the properties
of each bit separately). In the Pythagoran numerology, natural numbers had
mystical properties, even personalities of their own. Similar numerology was
applied to binary combinations in the ancient China.

In the Yì Jing divination, each line of the result can be either static or
changing (the resulting hexagram is always turning into some other
hexagram). This gives 4096 possible readings. A man named Chiao Kan actually
wrote 4096 rhymed verses to describe every possible transition. After this,
philosophers started to speculate about transitions between transitions. In
the words of Shú Xi:

     If from the 12-line diagrams we continue generating undivided and
     divided lines, eventually we come to 24-line diagrams, for a total of
     16,777,216 changes. Taking 4,096 and multiplying it by itself also
     gives this sum. Expanding this we do not know where it ultimately ends.
     Although we cannot see its usefulness, it is sufficient to show that
     the Way of Change is indeed inexhaustible.

No one was poetical enough to write out all the 16,777,216 second-order
transitions, however.

What might make the six-bit code specially divine even for modern people is
the fact that it is used in the genetic code that describes the hardware of
every living organism on this planet. (In fact, a "genetic byte" consists of
three symbols from an alphabet of four, but the amount of information is
exactly the same).

The 256 Octagrams

An opele chain
The Yoruba culture in West Africa is very much centered around four- and
eight-bit binary numbers. Each eight-bit combination, consisting of two
parallel four-bit combinations, is associated with lengthy pieces of oral
tradition, and the actual understanding of their meanings is rather
complicated.

The Ifá system is also known among the Caribbean practicers of Voodoo, whose
ancestors were Yoruba.

Each of the 256 octagrams (ifá) works as an index to a segment of the oral
tradition, an odù. Each odù can take 16 different paths, which adds up to a
total number of 4,096 paths that need to be separately memorised and
understood by the shaman (balabawo). There are actually very few balabawos
who know all the possible paths.

The sixteen most important odù are the ones whose ifá consist of two
identical halves (e.g. "Iwori-Meji", literally "two iworis", 0110.0110 in
binary, 66 in base-16). The 240 other odù are known as the minor odù.

A random ifá is generated by casting an Opele chain which consists of eight
seed pod halves chained together. The eight bits can then be read from the
sequence of convex and concave (or dark and bright) sides of the pod halves.

Eight bits is not merely the length of an ifá, but also the word length of
the microcomputer revolution, so here you are: some MOS 6502 machine code
translated into ifá names.

    LDY #$07  A0 07    Oyeku-Ofun Ogunda-Oyeku
LP: LDA #$7F  A9 7F    Odi-Ofun Ogbe-Ogunda
    ASO $FF   07 FF    Ogunda-Oyeku Ogbe-Meji
    AXS $900C 8F 0C 90 Ogbe-Okanran Owonrin-Oyeku Oyeku-Odi
    DEY       88       Okanran-Meji
    BNE LP    D0 F6    Oyeku-Otura Iwori-Ogbe
    RTS       60       Oyeku-Iwori

References

I've mostly provided search engine keywords because they tend to be more
durable than single sites (and because this is not a scientific article). I
also want to encourage everyone to research on their own instead of just
following the same "good" references all over again. There's a lot of weird
stuff out there.

   ethnomathematics
   ethnocomputing
   numbers+languages
   "hexagram sequences"
   http://taolodge.com/flash/sequencer.html
   leibniz+shao
   http://www.sacred-texts.com/ich/
   babalawo+256
   odu+ifa
   "geomantic figures"
   "of geomancy"
   ancient+india+computing
   african+fractals