The I Ching (Wade-Giles) or "Yì Jīng" (pinyin), also known as the Classic of Changes, Book of Changes or Zhouyi, is one of the oldest of the Chinese classic texts.

The text of the I Ching is a set of oracular statements represented by 64 sets of six lines each called hexagrams (卦 guà). Each hexagram is a figure composed of six stacked horizontal lines (爻 yáo), each line is either Yang (an unbroken, or solid line), or Yin (broken, an open line with a gap in the center). With six such lines stacked from bottom to top there are 26 or 64 possible combinations, and thus 64 hexagrams represented.

The hexagram diagram is composed of two three-line arrangements called trigrams (卦 guà). There are 23, hence 8, possible trigrams. The traditional view was that the hexagrams were a later development and resulted from combining two trigrams. However, in the earliest relevant archaeological evidence, groups of numerical symbols on many Western Zhou bronzes and a very few Shang oracle bones, such groups already usually appear in sets of six. A few have been found in sets of three numbers, but these are somewhat later. Numerical sets greatly predate the groups of broken and unbroken lines, leading modern scholars to doubt the mythical early attributions of the hexagram system,

When a hexagram is cast using one of the traditional processes of divination with I Ching, each yin and yang line will be indicated as either moving (that is, changing), or fixed (unchanging). Sometimes called old lines, a second hexagram is created by changing moving lines to their opposite. These are referred to in the text by the numbers six through nine as follows:
Nine is old yang, an unbroken line (—θ—) changing into yin, a broken line (— —);
Eight is young yin, a broken line (— —) without change;
Seven is young yang, an unbroken line (———) without change;
Six is old yin, a broken line (—X—) changing into yang, an unbroken line (———).
The oldest method for casting the hexagrams, the yarrow stalk method, was gradually replaced during the Han Dynasty by the three coins method and the yarrow stalk method was lost.[9] With the coin method, the probability of yin or yang is equal while with the recreated yarrow stalk method of Zhu Xi (1130–1200), the probability of old yang is three times greater than old yin.

There have been several arrangements of the trigrams and hexagrams over the ages. The bā gùa is a circular arrangement of the trigrams, traditionally printed on a mirror, or disk. According to legend, Fu Xi found the bā gùa on the scales of a tortoise's back. They function like a magic square with the four axes summing to the same value, using 0 and 1 to represent yin and yang: 000 + 111 = 101 + 010 = 011 + 100 = 110 + 001 = 111.

The 64 Hexagrams – King Wen Sequence