A Bright, Vibrant Blue Diamond
A Bright, Vibrant Blue Diamond
John Æonid, Reflections in a Personal Web Site
John Æonid, Reflections in a Personal Web Site

Trigrams on a Gray-code Cube

November 6, 2016, John Æonid

This little story started with a question a friend asked about whether there was a particular relationship between trigrams of the I Ching and a cube.  I don't think I've fully answered the question, but there was a curious finding along the way, and that's what I'll be describing here.

First, let's get familiar with the eight trigrams of the Bagua.  But, for this, we are most interested in the way they are represented, and their representation derives from a particular cosmological breakdown.  This is described in an I Ching perspective on Taiji Philosophy and also under the Bagua's relationship to other principals.  In this, the fundamental substance of the universe, either Tai Chi (or Taiji) or Wu Chi (or Wuji), is an essence that is first separated into two things, Ying and Yang.  Each of these two was then further split to yield the four images: from yin came greater yin and lesser yang, from yang came greater yang and lesser yin.  And finally, these four things were again each split in half to yield the eight trigrams, as shown in figure 1 below.

The diagram of the Taiji Cosmology (figure 1 above) is depicted as a branching structure, much as a tree or bush on it's side.  In computer science, this particular arrangement of nodes and branches (edges) is referred to as a Binary Tree, because there are two branches out of each branching point.  This helps make it easy to see that the trigram representation of the I Ching is a binary representation with a direct equivalent to the modern binary numbering system used in computers.  In this case, it is the solid bar, Yang, that the Wikipedia article interprets as "1", and the interrupted bar, Yin, that is interpreted as "0".  And, this is convenient, because the symbol with the hole in it is Yin, and the symbol with no hole is Yang.  (Understand that this is an issue of symbolic efficiency, not cultural commentary.)

Gray Codes

I'd like to introduce this next concept as a kind of a game.  Let's take our trigrams and represent them with coins, where heads is Yang and tails is Yin.  Lay the three coins down—all heads up.  The first rule of the game is that you only get to turn one coin over at a time, and each time you turn a coin over, you have changed to a new trigram.  After all, it is the "Book of Changes" is it not?  (That little play on words doesn't seem to play out as relating to the history involved. That is, the reason it's called the "Book of Changes" does not have much to do with change.)

The goal is to be able to step through all of the possible combinations.  For a Gray Code, the goal is to step through all the possibilities exactly once—and be able to wrap around to the beginning, again with a single coin changed.

That's the game, but I'm going to build a diagram that generates all of the possible gray codes.  I will do this by starting as described and showing the progress for each level of possibilities.

Starting Point

Very simple, in figure 2 below, we start with one trigram, all solid bars, the one named "Sky".  Follow along with coins if you wish.

First Transitions

Since there are exactly three coins/bars, and you can only change one at a time, there are only three ways to go.  So, the next diagram, figure 3 below, shows how Sky, the trigram we started with, is adjacent to three others: Lake, Fire, Wind.  Notice that Lake, Fire, and Wind are not adjacent to each other.

Second Transitions

With the next transition, we add only three more (figure 4 below).  Why? each of these three is adjacent to exactly two of what we added in the previous step.  We add Thunder, Fire, and Mountain.

Complete Gray-code Cube with Trigrams

Finally, there is only one left to add, which is Earth (figure 5 below).  And, it is adjacent to all three of those added in the previous step.

Complete Gray-code Cube with Trigrams

The pattern is complete, and it turns out that it resembles a cube: eight corners, twelve edges, and six sides.

Remember the goal of the game, to step through all the possible combinations and wrap back around to the beginning, all with only one change for each step.  Look at the cube; do you think you can do it?  Well, I've included one example below:

The above example represents one complete gray code, but it's not the only one.  How many are there?  I've found six; the list appears below.  Notice that I always start from the same point.  The reason is that if you started from some other point, a gray code you find will be one of the ones below—just starting from a different point before wrapping around.  The same applies to reversing the sequences.  If you want to treat the reversals as distinct, then there are twelve. However, direction only matters according to the applications in which this is useful.  This is similar to deciding whether a symbol that is turned upside down has a different meaning or not.  Specific applications can often be very arbitrary about such things.

  • 111 101 001 000 100 110 010 011
  • 111 101 100 110 010 000 001 011
  • 111 110 010 000 100 101 001 011
  • 111 110 010 011 001 000 100 101
  • 111 110 100 000 010 011 001 101
  • 111 110 100 101 001 000 010 011

The interesting point is that the completed cube of trigrams describes all the possible gray codes.  None are excluded.

Since a cube is one of the Platonic Solids, I had to wonder if there might be a similar relation to another simple solid.  Well, of the other Platonic Solids, there is one where the number of vertices is a power of two, the Tetrahedron, which is the simplest Platonic Solid.  The vertices of the tetrahedron will accept all the combinations of exactly two coins, or such.  But, to describe all the possible gray codes, you have to forbid the use of one edge.  And, that's because any arrangement in that form places two heads and two zeros adjacent to each other.  And, that violates the rule of only flipping one coin at a time.

Does all this imply some manner of magic?  Well, the Platonic Solids are often regarded as being part of Sacred Geometry.  And, the I Ching is commonly used as a means of divination.  But, there are clearly going to be questions about whether the Book of Changes would reasonably relate to this computer science concept called "gray codes".

There is an implication in the cosmology that each line in a trigram relates to a side of a particular split.  And, this then might imply each line represents a particular orientation for some trait.  However, there may be an implication that the three lines are not equally weighted, though I'm not convinced this is a limitation.  But, there's another application that might shed light on that.

An Application for Personality Types

I've been a fan of personality typing for a while.  This started with David Keirsey's book Please Understand Me.  In this book he describes his interpretation of the Myers-Briggs Type Indicator.  These particular type indicators use letters to designate a personality trait.  And, each trait is paired with only one other letter as the contrasting trait.  For instance, there's "I" for introversion and "E" for extroversion.  And, there are four pairs of these traits.  If we want, we can chose any three of the pairs and treat them as corresponding to the binary patterns on this cube.  For the way the personality traits are relatively independent of each other, it is useful to compare personalities that are similar.  So, this would be one application of this arrangement.

But, why not come up a way to get all of the for pairs of traits into a gray-code graph.  Well, I think we can.  Only, it isn't going to happen on a Platonic Solid—at least not in three dimensions.  Instead, we'll use the four-dimensional cube, known as a Tesseract.

The First Hypercube, The Tesseract

What's really going on here isn't as mystical as it seems.  This arrangement works because of the manner in which a cube is constructed.  More specifically, it is the perpendiculars in three dimensions that accommodates three bits.  A two-dimensional square only handles two bits, and a line just one, as show in figure 7 below.

So, starting with a single bit, the one and only gray code is the transition of 1 from or too 0.  For two bits, we project it into a square.  To do this, we duplicate the one-bit transition.  Then to one transition we prefix the two values with 1, and the two values of the other is prefixed with the other.  And, then two transitions are added between the two ends of the two modified transitions.  The process for getting the cube is similar, copying the square, tacking on the additional bit, and joining the corners between the squares.  Going from the cube to the tesseract is then a matter of duplicating the cube, adding the fourth bit, and joining—as shown in figure 8 below.

As with the previous cube, the tesseract in figure 8 above can be used to find all of the possible gray codes of four bits.  And, there are higher dimensions, mathematically, in which hypercubes can be constructed.  The method I describe can be used for any number of dimensions, and therefore any number of bits.  It is in the nature of binary numbers and the perpendicular nature of the cube that this is possible.  And again, this also applies to the binary nature of the Bagua, simply from the way in which its cosmology divides the essences by two.

Does this take all the magic out of it?  Well, it makes it very mathematical, doesn't it?  But, those who are fascinated about the mathematical nature of the Universe do ponder such things, often in awe.  And, the nature of numbers and geometry still give us much to wonder about in the spiritual and metaphysical (both meanings) realms.

Personality Types, Myers-Brigs and David Keirsey

Let's get back to the question of whether any of this is particularly useful.  Below, in figure 9, I've replaced the numbers with the four-letter coding of the Myers-Briggs personality types, and I've included the roles variants established by David Kiersey.

What you get with this is the ability to look at any one of the specific personality types and easily locate all of the adjacent ones.  And, each personality has exactly four adjacent personalities, simply because this is a 4-bit system.  For example: Healer is adjacent to Counselor, Composer, Champion, and Architect.  And, you will find that the opposite of healer, which is supervisor, is no closer then four steps away in any direction.

Then, let's trace out a complete gray code of personality types.  Note that I see a kind of potato-chip effect in finding these gray codes, and this helped me find the one shown in figure 10 below.

I don't know how many gray codes of four bits exist, and I'm not sure I want to work that out.  It was an interesting exercise to work out the 3-bit gray codes.  The only interesting thing it seems to do is allow the creation of a particular kind of cycle, which can be arranged around a circle.  Note that, as shown on Wikipedia, neither the Fuxi "Earlier Heaven" bagua arrangement nor the King Wen "Later Heaven" bagua arrangement are that of a gray code. I'm not an I Ching expert and don't have a strong grasp of how those two arrangements were developed.  So, an interpretation of that will have to come from elsewhere.

The personality gray-code in figure 10 above is listed out in the table below, with the roles and temperaments identified by David Kiersey.

MBTI Role
Variant
Role
  Expressive
or
Attentive?
Informative
or
Directive?
Cooperative
or
Utilitarian?
Concrete
or
Abstract?
ESFP Performer
Demonstrating
Entertainer
(SFP) Improvising
Artisan (SP)
Tactical
Observant
(S)
ISFJ Protector
Securing
Conservator
(SFJ) Supporting
Guardian (SJ)
Logistical
Observant
(S)
ESFJ Provider
Supplying
Conservator
(SFJ) Supporting
Guardian (SJ)
Logistical
Observant
(S)
ESTJ Supervisor
Enforcing
Administrator
(STJ) Regulating
Guardian (SJ)
Logistical
Observant
(S)
ISTJ Inspector
Certifying
Administrator
(STJ) Regulating
Guardian (SJ)
Logistical
Observant
(S)
ISTP Crafter
Instrumenting
Operator
(STP) Expediting
Artisan (SP)
Tactical
Observant
(S)
ESTP Promoter
Persuading
Operator
(STP) Expediting
Artisan (SP)
Tactical
Observant
(S)
ISFP Composer
Synthesizing
Entertainer
(SFP) Improvising
Artisan (SP)
Tactical
Observant
(S)
INFP Healer
Conciliating
Advocate
(NFP) Mediating
Idealist (NF)
Diplomatic
Introspective
(N)
ENFP Champion
Motivating
Advocate
(NFP) Mediating
Idealist (NF)
Diplomatic
Introspective
(N)
ENTP Inventor
Devising
Engineer
(NTP) Constructing
Rational (NT)
Strategic
Introspective
(N)
INTP Architect
Designing
Engineer
(NTP) Constructing
Rational (NT)
Strategic
Introspective
(N)
INTJ Mastermind
Entailing
Coordinator
(NTJ) Arranging
Rational (NT)
Strategic
Introspective
(N)
ENTJ Fieldmarshal
Mobilizing
Coordinator
(NTJ) Arranging
Rational (NT)
Strategic
Introspective
(N)
ENFJ Teacher
Educating
Mentor
(NFJ) Developing
Idealist (NF)
Diplomatic
Introspective
(N)
INFJ Counselor
Guiding
Mentor
(NFJ) Developing
Idealist (NF)
Diplomatic
Introspective
(N)

Still, one question remains about the usefulness of this.  What if there is a significant difference between the some of the traits?  If so, then in this simple form, there is some missing information.  One remedy to that would be to label each of the edges with a weight value.  For example, we could label each of the edges with the numeric difference of the two binary values at the ends of an edge.  What you would then find is that the corners are not connected to their nearest neighbors.  You would, in fact, find that eight (1000) is connected to zero (0000).  And, I don't know if this could be made useful under this condition.

With personality types, the association is in the shared traits.  As long as there is not a large difference between the significance of the traits, this tesseract representation does have some use.  Is that then also true for the Bagua?  I'll leave that question open.

Going Deeper

The original question that I was asked was actually a bit more specific then what I had initially described.  I was told that a particular healer had an intuitive hit about a relationship between a cube and the I Ching.  But, what that relation is  is still open to discovery.  The question was passed on to me because I had already done some useful math involving a particular numeric value in a cube.  So, I took it to be a question of something that was specific to numeric relationships.  And, for the I Ching, that was either the number of trigrams, eight, or the number of hexagrams, sixty four.  It was in the exploration of this question that led me to this property of gray codes and cubes.

Note that the trigram gray-code cube is already one answer to the question.  There are other ways to arrange the trigrams on a cube, but they will not be grey codes.  Those circular/octahedral arrangements of Fuxi and King Wen could be laid out on the corners of a cube.  But, there would be more than one way to do so, and it would be difficult to identify one that was particularly meaningful.  I've tried, and I've decided that what I'm describing comes close to identifying something useful and meaningful.  If you have other ideas, feel free to let me know.

It turns out that the number of corners on a hypercube is a power of two, and 26 is sixty four.  So, a six-dimensional hypercube has sixty four corners.  But, I'm not to eager to draw out a gray-code hypercube for six bits.  Also, I don't know if this would be useful, and we are looking for a useful arrangement.

Hexagrams

If the answer sought is about the number of hexagrams, there is a way to relate the gray-code cube of trigrams to the hexagrams.  This is done by recognizing that the hexagrams are all the possible combinations of two trigrams.  If we use this to relate the hexagrams to the cube in this way, then what we want is to see how this would be depicted.  The correct way would be with a Directed Graph, and it would have to be a Complete Graph, meaning that everything connects to everything else.  It would also contain self loops for all the corners.  So, every corner would have directed links to all the corners, and the number of directed links would be sixty four.  (yet to be drawn, if I dare)

Showing the sixty four directed connections on a cube (even without self loops) turned out to be messy.  I may yet finish it.  But, I did want to have a diagram that shows exactly what a directed graph with self loops looks like.  So, a radial arrangement of nodes appears below.  Note that not only does every node connect to every other node in two directions, but each node connects to itself in a directed manner.  And, I'll have to go back to count them.  If I got it right, there are sixty four lines in this diagram.

The application these directed links would reasonably be something that takes into account the direction of movement.  In the case of the hexagrams, they are an ordered pair of trigrams.  Each of the directed links represents a particular hexagram.  Instead of simply seeing a hexagram as a combination of two essences, they could be viewed as a transition from one essence to another.  They could also be viewed as a transfer of energy or the opening of a particular one-way channel.

Another possible application is that each of hexagrams can be regarded as having a trigram distance.  This would be the distance between on the gray-code cube of trigrams.  The possible distance values would then be zero, one, two, and three.  A hexagram that consists of one trigram repeated would always have a trigram distance of zero, and there are eight hexagrams with that value.  What value could this have?  That might be an interesting area of study.

I have no idea how useful this will be.  The personality gray-code tesseract (figure 9) may well be one that I put to use myself.  But, I don't think all the questions have been answered, and I do think it's worth putting some more thought into.  I hope you enjoyed it or found it useful.

Nov. 7, 2016: What I've covered here is stuff that I really love to spend time thinking about.  So much so, that it never occurred to me to do any web searches to see if anybody else had covered this.  So today, I finally did and much of it is already out there, though maybe not presented in quite this way.  Most of all I hope it's useful to those who have been asking about this stuff and those like them.

News

Nov. 8, 2019 Shadow
I've replaced the home page, though the old is retained, and I'm going deeper into shining light on the shadow, taking more risks..

May 14, 2017 Listing
I'm now generating a chronological list of postings here (in addition to the sitemap).

Jan. 14, 2017 WOT
I now participate in WOT.

Oct. 20, 2016 New Website!
This is truly in its infancy.  There is much that I want to share, yet it's just beginning.

Print | Sitemap
© 2018 John Æonid All rights reserved
End-User License Agreement — MUST READ