gold 12/12/2025. Here are some TCL calculations on I Ching Divination System in Graphical User Interface GUI shell.
This is from computer methods. I have developed program that dumps the dawn hexagram with the Yarrow Stick probability and furnishes the old fashioned ASCII "XXX XXX" displays. This ASCII displays and preliminary notes are the grunt work of casting a hexagram, which is quick for the AI models, but takes a human about 20 minutes of fumbling with those stick dice and line manipulation.
These hexagram look-up tables have been cross checked against 4 different supercomputers. However, AI models can make mistakes, if not human authors too. Check other references to confirm important information. Testing computer program, maybe wrong numbers.
The King Wen order of 64 hexagrams is ancient, non-mathematical, and ritual-based in I Ching interpretation. The King Wen order is fairly non-linear. King Wen contains deliberate asymmetries. e.g. 1 and 2 are pure, 23–24 are “stripping”, 29–30 are repeated trigrams in the middle, etc. Adjacent pairs are often inverted (11/12, 17/18, 27/28, 53/54, etc.), but not always, this will break any simple inversion rule. The only known pattern that reduces slightly is the “inverted pairs”, but even that fails for 20+ hexagrams.
Default question is : What is best programming language, if TCL as Yes or No.
Binary Override Mode: Users can now append a 6-digit binary number to their question using : or ; separator
"My question :111111" → Uses Hexagram #1 (The Creative) "My question :000000" → Uses Hexagram #2 (The Receptive) "My question :111000" → Uses Hexagram #11 (Peace) "My question :999999" → Invalid, not binary, defaults to casting "My question :10101" → Invalid (only 5 digits), defaults to casting
The Nuclear Hexagram is derived mathematically from the original hexagram by focusing on its four inner lines (lines 2, 3, 4, and 5). These middle lines form two new trigrams:
Lines 2, 3, and 4 become the lower trigram
Lines 3, 4, and 5 become the upper trigram
This creates a new six-line hexagram that is called the core and exists "inside" the original hexagram.
The first nuclear (Nuclear_1) is derived by taking lines 2, 3, 4 as the lower trigram and lines 3, 4, 5 as the upper trigram. This restricts outcomes so there are only 16 possible nuclear hexagrams among the 64 primary ones. Calculating the nuclear of the nuclear again (Nuclear_2)—and again (Nuclear_3)—leads, in all cases, to just four extremal hexagrams: Hexagrams 1 (乾), 2 (坤), 63 (既濟), and 64 (未濟). These are self-reinforcing and always return to themselves or oscillate between each other. The process naturally terminates after a few iterations because of the combinatorics of trigrams and the way the nuclear is derived from the mid-lines of a hexagram.
Here are the key patterns discovered:
Three Ultimate Destinations:
Hexagram 1 (乾, The Creative) - Pure yang, self-perpetuating
Hexagram 2 (坤, The Receptive) - Pure yin, self-perpetuating
Hexagrams 63-64 oscillation - Eternal alternation between "After Completion" and "Before Completion"
In the last or polishing stages of reading a draw from the I Ching, the Nuclear Hexagram may serve several interpretive functions: Revealing the Unconscious: While the primary hexagram addresses the conscious situation or question, the nuclear hexagram often points to unconscious motivations, hidden influences, or underlying psychological patterns affecting the situation. Identifying Core Themes: It can highlight the essential nature of what's happening beneath surface appearances—the fundamental dynamic at play regardless of how things appear externally. Bridging Contradictions: When a reading seems confusing or contradictory, the nuclear hexagram may provide the missing piece that makes everything coherent, showing how apparently opposing forces connect. Timing and Process: Some practitioners view the nuclear hexagram as representing the middle phase of a situation—what happens between the beginning (primary hexagram) and outcome (changing lines or resulting hexagram).
The Nuclear Hexagram is a concept used in preparing an interpretation of the draw from I Ching. When casting a hexagram, extra meaning can sometimes be found in the derived or constructed Nuclear Hexagram. Some readers use the Nuclear Hexagram to find the deeper and core meaning in the reading. The Nuclear Hexagram can reveal underlying influences or hidden themes. The Nuclear Hexagram does not replace the main First Hexagram and Second Hexagram from changing lines, but adds another layer of insight and emphasis on a main theme. This tool of Nuclear Hexagrams helps clarify confusing messages and highlights important aspects of the question to the I Ching. Not all I Ching readers use the Nuclear Hexagram, as it is an optional tool for advanced interpretations. Using the Nuclear Hexagrams can make the interpretation richer and give more detailed nuances.
The nuclear hexagram (hù tǐ 互體) was not known to the original Zhouyi (the Zhou-dynasty core text). It appears for the first time in history during the Northern Song dynasty:
Mathematical field: Overlapping trigram (or k-mer) combinatorics Date of discovery in China: ca. 1186–1190 CE (Zhu Xi, Southern Song dynasty
The study of nuclear transforms belongs to the modern mathematical fields of:
Combinatorics on words (specifically overlapping factors of length 3 in a word of length 6 over a 2-letter alphabet) Sliding-window analysis / overlapping k-mers (the exact same technique used in bioinformatics for DNA sequence analysis) Overlap graphs / de Bruijn graphs for binary sequences of order 3 Cellular automata theory (the nuclear map is a very simple local rule on the 64 states of Elementary Cellular Automaton in base 2)
Zhu Xi put the nuclear hexagrams into his famous book (Zhouyi Benyi (around 1186–1190) because he wanted every serious reader to look at this fourth layer (after primary → lines → relating → nuclear) so that the reading would be “three-dimensional” and accurate over years instead of just days. Many scholars of the Song era noticed that many I Ching readings felt “incomplete” or “contradictory” if you only looked at the surface hexagram and the changing lines. That’s all they were after: A simple, mechanical way to see the hidden skeleton inside the situation that most people never notice. (And once you see it — especially when Nuclear 28 shows up twice, like in the two casts — they would say: “Ah… the skeleton is overloaded and sagging. No amount of surface polishing will hold for long until that inner beam is strengthened or lightened.”)That was the entire Song-dynasty motivation in a nutshell.
Shao Yong’s (邵雍, 1011–1077 CE) binary arrangement of the 64 hexagrams(also called the “Earlier Heaven” / Xiāntiān / Fuxi order in this context). Shao Yong was a brilliant Song-dynasty Neo-Confucian philosopher who discovered that the 64 hexagrams can be arranged in pure binary counting order from 000000 to 111111 — exactly like the numbers for 0 to 63 in modern binary notation. The Fuxi binary order may be mapped to the King Wen Sequence KWS, although the Fuxi binary order is not commonly used in the Western I Ching interpretations.
We discussed the nuclear transform of the first drawn hexagram earlier. Would a "counter" transform drop inner lines 3 and 4 to create a "superficial transform"? I’d appreciate your opinion or suggestions. The idea is to drop the inner lines to emphasize the external features or interpretation of the drawn hexagram, as an opposite or counter to the nuclear transform. By removing lines 3 and 4, we might compose trigrams from the remaining outer lines or outer shell of the drawn hexagram. This would be an experimental transform, rarely for use in Western interpretation.
• Bottom trigram = lines 1, 2, 5 • Top trigram = lines 2, 5, 6
Copy & Overlap – Like DNA Duplication
Idea: DNA replicates by copying strand with overlaps. Duplicate hex, take overlapping middle 6. How-To Example: H9 - Small Taming 111101 → 111101111101 → Middle 6 (positions 3-8): >>> Result 110111 (Hex 10 Treading). Gist: Life copies into careful treading—life cycles needs cautious steps. Tie-In: Semi-conservative replication; overlaps preserve "genes." These add "life/evolution" twist to interpretation—hexagrams as living codes that mutate/replicate. Mutations/frameshifts show how stable cycles could evolve. DNA Replication Chain Transform: Duplicates the binary string and takes the middle overlapping 6 bits (positions 3–8 in the doubled string). 8-Generation Chain: Repeatedly applies the replication 8 times, showing an evolutionary sequence. Gist: Like DNA semi-conservative replication with preserved overlaps – gives a sense of how the situation "reproduces" and evolves over time.
I am testing computer methods and computer programs, maybe wrong numbers. Though not the Classic methods for the I Ching, many computer programs have adapted randomized procedures and algorithms from the I Ching literature.
The hexagram counting method (using the palm/knuckle spaces and wheel jumping) is a traditional Chinese technique described by Alfred Huang in "I Ching Numerology. " Professional fortune-tellers and military counselors used the palm method to quickly identify any of the 64 hexagrams by number in the King Wen sequence without needing a book or chart. Method builds directly on the 8 trigram positions learned on the palm, repeating the clockwise loop as needed for higher numbers. There are both clockwise and counter-clockwise counting palm procedures in the Chinese literature. Huang's method on the palm is the equivalent of a circular wheel for counting and revolving trigrams and interpreting the assembled hexagrams. These computer algorithms are inspired by Huang's circular counting on the palm spaces (8 positions like a wheel for trigrams).
The deepest link and study comes from linguist Richard S. Cook's 2006 analysis (Classical Chinese Combinatorics). Cook argues the traditional King Wen sequence of 64 hexagrams encodes knowledge of linear recurrence sequences (like Fibonacci) converging to the golden ratio, φ. Cook identifies patterns, such as intervals in "neuter" hexagrams matching reversed Fibonacci segments (e.g., 6,4,2,2,0), and ratios involving Fibonacci numbers (5:8, 13 divisions). This suggests ancient arrangers of the I Ching understood math properties, later formalized by Fibonacci (1202 AD) and related to φ. Diagrams from Cook's work showed hexagram counting sequence patterns potentially tied to Fibonacci.
Here’s a simple, elegant, and meaningful way to integrate Fibonacci into the I Ching TCL program. The algorithm was inspired by the deep mathematical beauty of the I Ching hexagrams and Alfred Huang's emphasis on numerology. The procedure uses just addition and modulo. The Fibonacci sequence is : 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, … Notice that every few Fibonacci terms hit multiples or remainders related to 8 and 6. These multiples and remainders are perfect and matching for the I Ching (8 trigrams, 6 lines to hexagram). We can use the Fibonacci numbers as natural rotation offsets on the Bagua wheel or the palm method from Huang. The algorithm would be equivalent to generation steps in a chain, similar to the spinning wheel on a bicycle chain. Best fit for simple algorithm: Create a Fibonacci Wheel Rotation Chain.
1) Start with your primary hexagram.
2) Use successive Fibonacci numbers mod 8 as rotation amounts on the King Wen Bagua wheel.
3) Generate a short chain (e.g., 6–8 steps) of transformed hexagrams for an organic, golden-ratio-inspired evolution of the hexagram transform in the reading.
Why this fits beautifully. Fibonacci appears naturally in growth, spirals, nature as resonant with Taoist philosophy. The Taoist philosophy of Huang stresses numerology and the circular Bagua sequence.
A New Way to Read Changing Lines in the I Ching
The ancient Chinese divination system known as the I Ching uses hexagrams—six-line figures—to provide guidance and insight. When consulting the I Ching, certain lines within a hexagram may be "changing," meaning these lines will transform from yin to yang or yang to yin, creating a secondary hexagram. The Quantum Superposition Transform offers a revolutionary approach to interpreting these changing lines by treating them as existing in multiple states simultaneously until observed, much like particles in quantum mechanics. This article explores how this transform works, why sequential measurement matters, and what practical benefits this method offers for divination practitioners.
The Quantum Superposition Transform borrows a concept from quantum physics called superposition, where a particle exists in multiple states at once until measurement forces the particle to "collapse" into one definite state. Traditional I Ching interpretation flips all changing lines instantly, producing a single secondary hexagram. The Quantum Superposition Transform treats each changing line differently. Each changing line holds both its current state (yin or yang) and its future flipped state (yang or yin) simultaneously. The line exists in this dual state until interpretation occurs. For example, if line three in a hexagram is changing, that line is both yin and yang at the same time, creating a kind of uncertainty that mirrors quantum behavior. This approach acknowledges that transformation is not always instantaneous or uniform.
Rather than flipping all changing lines at once, the Quantum Superposition Transform simulates a sequential, random measurement process. Each unstable line collapses one at a time, as if an observer were examining each line individually. This step-by-step observation creates multiple intermediate hexagrams between the original and final forms. Imagine a hexagram with three changing lines. Traditional methods would flip all three lines simultaneously, generating one secondary hexagram. The Quantum Superposition Transform might collapse line one first, creating an intermediate hexagram, then collapse line four, creating another intermediate form, and finally collapse line six to reach the final hexagram. Each intermediate state offers additional interpretive information. The order of collapse can vary, introducing an element of randomness that reflects the unpredictable nature of quantum measurement. This sequential process reveals the journey of transformation, not just the destination.
The Quantum Superposition Transform enriches divination by providing a more nuanced narrative of change. Practitioners gain insight into the stages of transformation rather than viewing change as a single leap from one state to another. Each intermediate hexagram represents a moment in the unfolding process, offering guidance for navigating transitions. For instance, a reading about career change might show intermediate states that suggest caution, patience, or specific actions at different phases. The randomness of line collapse mirrors life's unpredictability, making readings feel more organic and responsive. This method also encourages practitioners to contemplate uncertainty and possibility, core themes in both quantum mechanics and ancient wisdom traditions. By embracing the complexity of transformation, the Quantum Superposition Transform bridges ancient divination practices with modern scientific concepts, offering a fresh lens for understanding change, uncertainty, and the nature of reality itself.
Bottom Line>>> Sources like discussions on nuclear transform hexagrams in I Ching communities emphasize that every hexagram may contain these implicit influences, making them especially useful for static readings to uncover subtleties and nuances. <<<<
Interpretation Guide
| Hexagram Type | Role / Meaning |
|---|---|
| Primary Hexagram | Current situation or present status on issue |
| Second Hexagram | Future development or status / outcome |
| Shadow / Complementary Primary | Hidden opposite perspective (of present) |
| Shadow / Complementary Second | Future's hidden opposite perspective |
| Nuclear Primary | Inner / hidden dynamics of present |
| Nuclear Second | Inner / hidden dynamics of future |
| ( Experimental ) Superficial Primary | Outer / surface dynamics of present, rarely used |
| ( Experimental } Superficial Second | Outer / surface dynamics of future, rarely used |
| Line Value | Probability | Type | Changes To | Notes |
|---|---|---|---|---|
| 6 (old yin) | 1/16 | Changing Yin | Yang | |
| 7 (young yang) | 7/16 | Static Yang | (unchanged) | Most common outcome |
| 8 (young yin) | 5/16 | Static Yin | (unchanged) | |
| 9 (old yang) | 3/16 | Changing Yang | Yin |
Note on table.
Expected number of changing lines per cast: (1/16 + 3/16) × 6 = 1.5 lines, average.
Some drawn hexagrams by lot will not all have changing lines.
Probability of any line changing = 4/16 = 1/4; binomial expectation over 6 independent lines.
| Line Value | Probability | Type | Changes To | Notes |
|---|---|---|---|---|
| 6 (old yin) | 2/16 | Changing Yin | Yang | |
| 7 (young yang) | 6/16 | Static Yang | (unchanged) | |
| 8 (young yin) | 6/16 | Static Yin | (unchanged) | Most common outcome |
| 9 (old yang) | 2/16 | Changing Yang | Yin |
Note on table.
Coin Toss shown for comparison, but not used in program.
Expected number of changing lines per cast: (2/16 + 2/16) × 6 = 1.5 lines, average.
Some drawn hexagrams by lot will not all have changing lines.
Probability of any line changing = 4/16 = 1/4; binomial expectation over 6 independent lines.
For precise dating and AI cross-reference:
| Concept / Development | Traditional Attribution / Date | Historical Notes |
|---|---|---|
| Core text (Zhouyi / Book of Changes) | ~1000–750 BCE | Late Western Zhou to early Eastern Zhou |
| King Wen sequence | Traditionally attributed to King Wen ~1150 BCE | Ritual-based order, non-mathematical |
| Binary (Fuxi) arrangement | Shao Yong (1011–1077 CE) | Northern Song; modern binary interpretation |
| Nuclear hexagram concept | Zhu Xi (1130–1200 CE) | Southern Song; formalised ~1186–1190 CE |
Note. These timestamps distinguish traditional legend from documented scholarly contributions.
Consult the I Ching text for detailed interpretation of your hexagrams and their relationships.
In planning any software, it is advisable to gather a number of testcases to check the results of the program. The math for the testcases can be checked by pasting statements in the TCL console. Aside from the TCL calculator display, when one presses the report button on the calculator, one will have console show access to the capacity functions (subroutines).
I CHING HEXAGRAM READING QUESTION: What is best programming language, if TCL as Yes or No. BALANCE EXPRESSION: H11.3.6 > H41 (Peace transforms to Decrease) Binary (bottom to top): 111000 YARROW STALK CASTING (Bottom to Top): --------------------------------------------- Line 6: --x-- (6) <- CHANGING Line 5: -- -- (8) Line 4: -- -- (8) Line 3: --o-- (9) <- CHANGING Line 2: ----- (7) Line 1: ----- (7) CALCULATION DETAILS: --------------------------------------------- Cast lines (values): 7 7 9 8 8 6 First hexagram: #11 Second hexagram: #41 Shadow/Complementary: #12 Nuclear transform: #54 Superficial transform: #54 Changing lines: 3, 6
#!/usr/bin/wish
# I Ching Hexagram Divination System
# Traditional Yarrow Stalk Method
# Compatible with Tcl/Tk 8.6+
# TCL source code follows
# written on Windows 11 on ActiveState Tcl
# working under TCL version 8.6
# TCL club, 12/14/2025
# Traditional Yarrow Stalk Method >>> Modern Mathematical Transforms
# CORRECTED VERSION - All bugs fixed - Standard Trigram Mapping
package require Tk
# ============================================================================
# DATA: King Wen Lookup Table (Binary to King Wen Number)
# ============================================================================
console show
array set king_wen_binary {
1 111111 2 000000 3 100010 4 010001 5 111010 6 010111 7 010000 8 000010
9 111011 10 110111 11 111000 12 000111 13 101111 14 111101 15 001000 16 000100
17 100110 18 011001 19 110000 20 000011 21 100101 22 101001 23 000001 24 100000
25 100111 26 111001 27 100001 28 011110 29 010010 30 101101 31 001110 32 011100
33 001111 34 111100 35 000101 36 101000 37 101011 38 110101 39 001010 40 010100
41 110001 42 100011 43 111110 44 011111 45 000110 46 011000 47 010110 48 011010
49 101110 50 011101 51 100100 52 001001 53 001011 54 110100 55 101100 56 001101
57 011011 58 110110 59 010011 60 110010 61 110011 62 001100 63 101010 64 010101
}
array set binary_to_king_wen {}
foreach {kw_num binary} [array get king_wen_binary] {
set binary_to_king_wen($binary) $kw_num
}
# ============================================================================
# DATA: Hexagram Names
# ============================================================================
array set hexNames {
1 "The Creative" 2 "The Receptive" 3 "Difficulty at the Beginning"
4 "Youthful Folly" 5 "Waiting" 6 "Conflict" 7 "The Army"
8 "Holding Together" 9 "Small Taming" 10 "Treading" 11 "Peace"
12 "Standstill" 13 "Fellowship" 14 "Great Possession" 15 "Modesty"
16 "Enthusiasm" 17 "Following" 18 "Work on the Decayed" 19 "Approach"
20 "Contemplation" 21 "Biting Through" 22 "Grace" 23 "Splitting Apart"
24 "Return" 25 "Innocence" 26 "Great Taming" 27 "Nourishment"
28 "Great Preponderance" 29 "The Abysmal" 30 "The Clinging"
31 "Influence" 32 "Duration" 33 "Retreat" 34 "Great Power"
35 "Progress" 36 "Darkening of Light" 37 "The Family" 38 "Opposition"
39 "Obstruction" 40 "Deliverance" 41 "Decrease" 42 "Increase"
43 "Breakthrough" 44 "Coming to Meet" 45 "Gathering Together"
46 "Pushing Upward" 47 "Oppression" 48 "The Well" 49 "Revolution"
50 "The Cauldron" 51 "The Arousing" 52 "Keeping Still" 53 "Development"
54 "The Marrying Maiden" 55 "Abundance" 56 "The Wanderer"
57 "The Gentle" 58 "The Joyous" 59 "Dispersion" 60 "Limitation"
61 "Inner Truth" 62 "Small Preponderance" 63 "After Completion"
64 "Before Completion"
}
# ============================================================================
# DATA: The 8 Trigrams - STANDARD MAPPING + Later Heaven Bagua Positions
# ============================================================================
array set trigramInfo {
000 "Earth" 001 "Mountain" 010 "Water" 011 "Wind"
100 "Thunder" 101 "Fire" 110 "Lake" 111 "Heaven"
}
# Later Heaven Bagua wheel positions (1-8 clockwise)
array set position_to_trigram {
1 101 ;# Fire
2 110 ;# Lake
3 111 ;# Heaven
4 011 ;# Wind
5 000 ;# Earth
6 001 ;# Mountain
7 010 ;# Water
8 100 ;# Thunder
}
array set trigram_to_position {}
foreach {pos tri} [array get position_to_trigram] {
set trigram_to_position($tri) $pos
}
set trigramKernels {000 001 010 011 100 101 110 111}
# Fibonacci sequence for Bagua wheel jumps
set fib_sequence {0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610}
# ============================================================================
# PROCEDURES
# ============================================================================
proc yarrowCast {} {
set r [expr {int(rand() * 16) + 1}]
if {$r == 1} {return 6}
if {$r <= 4} {return 9}
if {$r <= 11} {return 7}
return 8
}
proc lineSymbol {value} {
switch $value {
6 {return "--x--"}
7 {return "-----"}
8 {return "-- --"}
9 {return "--o--"}
default {return "-----"}
}
}
proc lines_to_binary {lines} {
set binary ""
foreach line $lines {
append binary [expr {($line == 7 || $line == 9) ? "1" : "0"}]
}
return $binary
}
proc linesToNumber {lines} {
global binary_to_king_wen
set binary [lines_to_binary $lines]
if {[info exists binary_to_king_wen($binary)]} {
return $binary_to_king_wen($binary)
}
return 1
}
# Fixed-width ASCII hexagram – both yin and yang lines are exactly 9 characters
proc drawHexagram {lines} {
set drawing ""
for {set i 5} {$i >= 0} {incr i -1} {
set line [lindex $lines $i]
if {$line == 7 || $line == 9} {
append drawing "XXXXXXXXX\n"
} else {
append drawing "XXX XXX\n"
}
}
return $drawing
}
proc calculateNuclear {lines} {
return [list [lindex $lines 1] [lindex $lines 2] [lindex $lines 3] \
[lindex $lines 2] [lindex $lines 3] [lindex $lines 4]]
}
proc calculateSuperficial {lines} {
return [list [lindex $lines 0] [lindex $lines 1] [lindex $lines 4] \
[lindex $lines 1] [lindex $lines 4] [lindex $lines 5]]
}
proc calculateComplementary {lines} {
set comp {}
foreach line $lines {
lappend comp [expr {($line == 7 || $line == 9) ? 8 : 7}]
}
return $comp
}
proc parseQuestionForBinary {questionText} {
global binary_to_king_wen
set separatorIdx -1
if {[string first ":" $questionText] != -1} {
set separatorIdx [string first ":" $questionText]
} elseif {[string first ";" $questionText] != -1} {
set separatorIdx [string first ";" $questionText]
}
if {$separatorIdx == -1} {
return [list $questionText ""]
}
set cleanQuestion [string trim [string range $questionText 0 [expr {$separatorIdx-1}]]]
set binaryPart [string trim [string range $questionText [expr {$separatorIdx+1}] end]]
if {[string length $binaryPart] != 6 || ![regexp {^[01]{6}$} $binaryPart]} {
return [list $cleanQuestion ""]
}
if {[info exists binary_to_king_wen($binaryPart)]} {
return [list $cleanQuestion $binaryPart]
}
return [list $cleanQuestion ""]
}
proc binaryToLines {binary} {
set lines {}
foreach bit [split $binary ""] {
lappend lines [expr {$bit ? 7 : 8}]
}
return $lines
}
proc trigramEcho {binary kernel} {
set result ""
for {set i 0} {$i < 6} {incr i} {
set sum 0
for {set j 0} {$j < 3} {incr j} {
set pos [expr {($i + $j) % 6}]
set b [string index $binary $pos]
set k [string index $kernel $j]
incr sum [expr {$b && $k}]
}
append result [expr {$sum % 2}]
}
return $result
}
proc computeTrigramEchoes {binaryLines} {
global trigramInfo trigramKernels binary_to_king_wen hexNames
set binary [lines_to_binary $binaryLines]
set echoes {}
foreach kernel $trigramKernels {
set echoBin [trigramEcho $binary $kernel]
set num [expr {[info exists binary_to_king_wen($echoBin)] ? $binary_to_king_wen($echoBin) : 1}]
set name [expr {[info exists hexNames($num)] ? $hexNames($num) : "Unknown"}]
set trigram $trigramInfo($kernel)
lappend echoes [list $trigram $kernel $num $name $echoBin]
}
return $echoes
}
proc replicationTransform {binary} {
set duplicated $binary$binary
return [string range $duplicated 2 7]
}
proc computeReplicationChain {binaryLines} {
global binary_to_king_wen hexNames
set binary [lines_to_binary $binaryLines]
set chain {}
set current $binary
for {set i 1} {$i <= 8} {incr i} {
set nextBin [replicationTransform $current]
set num $binary_to_king_wen($nextBin)
set name [expr {[info exists hexNames($num)] ? $hexNames($num) : "Unknown"}]
lappend chain [list $i $nextBin $num $name]
set current $nextBin
}
return $chain
}
# Fibonacci Bagua Wheel Jump Transform
proc computeFibWheelChain {binaryLines chain_length} {
global position_to_trigram trigram_to_position binary_to_king_wen hexNames fib_sequence
set binary [lines_to_binary $binaryLines]
set lower_tri [string range $binary 3 5]
set upper_tri [string range $binary 0 2]
set start_lower_pos $trigram_to_position($lower_tri)
set start_upper_pos $trigram_to_position($upper_tri)
set chain {}
set step 1
foreach fib [lrange $fib_sequence 2 end] { ;# Skip 0,1
if {$step > $chain_length} {break}
set offset [expr {$fib % 8}]
set new_lower_pos [expr {(($start_lower_pos -1 + $offset) % 8) +1}]
set new_upper_pos [expr {(($start_upper_pos -1 + $offset) % 8) +1}]
set new_lower_tri $position_to_trigram($new_lower_pos)
set new_upper_tri $position_to_trigram($new_upper_pos)
set new_bin "${new_upper_tri}${new_lower_tri}"
set num $binary_to_king_wen($new_bin)
set name $hexNames($num)
lappend chain [list $step $new_bin $num $name $offset]
incr step
}
return $chain
}
# ============================================================================
# MAIN CASTING PROCEDURE
# ============================================================================
proc castHexagram {} {
global hexNames questionVar resultText consoleText
$resultText delete 1.0 end
$consoleText delete 1.0 end
set fullQuestion [string trim $questionVar]
if {$fullQuestion eq ""} {
set fullQuestion "What is best programming language, if TCL as Yes or No."
}
lassign [parseQuestionForBinary $fullQuestion] question binaryOverride
if {$question eq ""} {
set question $fullQuestion
}
set usingOverride 0
if {$binaryOverride ne ""} {
set rawLines [binaryToLines $binaryOverride]
set usingOverride 1
} else {
set rawLines {}
for {set i 0} {$i < 6} {incr i} {
lappend rawLines [yarrowCast]
}
}
set primaryNum [linesToNumber $rawLines]
set secondLines {}
foreach line $rawLines {
if {$line == 6} {
lappend secondLines 7
} elseif {$line == 9} {
lappend secondLines 8
} else {
lappend secondLines $line
}
}
set secondNum [linesToNumber $secondLines]
set shadowPrimaryLines [calculateComplementary $rawLines]
set shadowPrimaryNum [linesToNumber $shadowPrimaryLines]
set shadowSecondLines [calculateComplementary $secondLines]
set shadowSecondNum [linesToNumber $shadowSecondLines]
set nuclearPrimaryLines [calculateNuclear $rawLines]
set nuclearPrimaryNum [linesToNumber $nuclearPrimaryLines]
set nuclearSecondLines [calculateNuclear $secondLines]
set nuclearSecondNum [linesToNumber $nuclearSecondLines]
set superficialPrimaryLines [calculateSuperficial $rawLines]
set superficialPrimaryNum [linesToNumber $superficialPrimaryLines]
set superficialSecondLines [calculateSuperficial $secondLines]
set superficialSecondNum [linesToNumber $superficialSecondLines]
set primaryEchoes [computeTrigramEchoes $rawLines]
set secondEchoes [computeTrigramEchoes $secondLines]
set primaryReplicationChain [computeReplicationChain $rawLines]
set secondReplicationChain [computeReplicationChain $secondLines]
# Fibonacci Transform
set fib_chain_length 8
set primaryFibChain [computeFibWheelChain $rawLines $fib_chain_length]
set secondFibChain [computeFibWheelChain $secondLines $fib_chain_length]
set changingLinesList {}
for {set i 0} {$i < 6} {incr i} {
if {[lindex $rawLines $i] == 6 || [lindex $rawLines $i] == 9} {
lappend changingLinesList [expr {$i + 1}]
}
}
set balanceExpr "H$primaryNum"
if {[llength $changingLinesList] > 0} {
append balanceExpr ".[join $changingLinesList "."]"
}
append balanceExpr " > H$secondNum"
# BUILD OUTPUT
set output ""
append output "===============================================\n"
append output " I CHING HEXAGRAM READING\n"
append output "===============================================\n\n"
append output "QUESTION: $question\n"
if {$usingOverride} {
append output "MODE: Binary Override ($binaryOverride)\n"
}
append output "\nBALANCE EXPRESSION: $balanceExpr\n"
append output " ($hexNames($primaryNum) transforms to $hexNames($secondNum))\n\n"
append output "Binary (bottom to top): [lines_to_binary $rawLines]\n\n"
append output "YARROW STALK CASTING (Bottom to Top):\n"
append output "---------------------------------------------\n"
for {set i 5} {$i >= 0} {incr i -1} {
set lineNum [expr {$i + 1}]
set lineVal [lindex $rawLines $i]
set symbol [lineSymbol $lineVal]
set changing [expr {($lineVal == 6 || $lineVal == 9) ? " <- CHANGING" : ""}]
append output [format "Line %d: %s (%d)%s\n" $lineNum $symbol $lineVal $changing]
}
append output "\nCALCULATION DETAILS:\n"
append output "---------------------------------------------\n"
append output "Primary hexagram: #$primaryNum\n"
append output "Second hexagram: #$secondNum\n"
append output "Shadow Primary: #$shadowPrimaryNum\n"
append output "Nuclear Primary: #$nuclearPrimaryNum\n"
append output "Superficial Primary: #$superficialPrimaryNum\n"
append output "Changing lines: [expr {[llength $changingLinesList]>0 ? [join $changingLinesList {, }] : "none"}]\n\n"
foreach {title num lines desc} [list \
"PRIMARY HEXAGRAM" $primaryNum $rawLines "" \
"SECOND HEXAGRAM" $secondNum $secondLines "" \
"SHADOW/COMPLEMENTARY OF PRIMARY" $shadowPrimaryNum $shadowPrimaryLines "(All lines inverted)" \
"SHADOW/COMPLEMENTARY OF SECOND" $shadowSecondNum $shadowSecondLines "(All lines inverted from second)" \
"NUCLEAR TRANSFORM OF PRIMARY" $nuclearPrimaryNum $nuclearPrimaryLines "(Lines 2-3-4 + 3-4-5)" \
"NUCLEAR TRANSFORM OF SECOND" $nuclearSecondNum $nuclearSecondLines "(Inner of second)" \
"SUPERFICIAL TRANSFORM OF PRIMARY" $superficialPrimaryNum $superficialPrimaryLines "(Lines 1-2-5 + 2-5-6)" \
"SUPERFICIAL TRANSFORM OF SECOND" $superficialSecondNum $superficialSecondLines "(Outer of second)" \
] {
append output "===============================================\n"
append output "$title: #$num - $hexNames($num)\n"
append output "===============================================\n"
if {$desc ne ""} {
append output "$desc\n\n"
}
append output [drawHexagram $lines]
append output "\n"
}
# Trigram Echoes
append output "===============================================\n"
append output "TRIGRAM ECHO CONVOLUTIONAL TRANSFORMS (Primary)\n"
append output "===============================================\n"
foreach echo $primaryEchoes {
lassign $echo trigram kernel num name bin
append output "[format "%-8s" $trigram] (kernel $kernel) >>> H$num - $name\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
append output "===============================================\n"
append output "TRIGRAM ECHO CONVOLUTIONAL TRANSFORMS (Second/Future)\n"
append output "===============================================\n"
foreach echo $secondEchoes {
lassign $echo trigram kernel num name bin
append output "[format "%-8s" $trigram] (kernel $kernel) >>> H$num - $name\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
# DNA Replication Chains
append output "===============================================\n"
append output "DNA REPLICATION TRANSFORM CHAIN (Primary >>> 8 generations)\n"
append output "===============================================\n"
foreach gen $primaryReplicationChain {
lassign $gen step bin num name
append output "Generation $step >>> H$num - $name ($bin)\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
append output "===============================================\n"
append output "DNA REPLICATION TRANSFORM CHAIN (Second/Future >>> 8 generations)\n"
append output "===============================================\n"
foreach gen $secondReplicationChain {
lassign $gen step bin num name
append output "Generation $step >>> H$num - $name ($bin)\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
# FIBONACCI BAGUA WHEEL JUMP TRANSFORM (placed at the very end)
append output "===============================================\n"
append output "FIBONACCI JUMP WHEEL JUMP TRANSFORM (Primary >>> 8 steps)\n"
append output "===============================================\n"
append output "(Fibonacci modulo 8 jumps on Later Heaven Bagua wheel)\n\n"
foreach jump $primaryFibChain {
lassign $jump step bin num name offset
append output "Step $step (offset $offset) >>> H$num - $name ($bin)\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
append output "===============================================\n"
append output "FIBONACCI JUMP WHEEL TRANSFORM (Second/Future >>> 8 steps)\n"
append output "===============================================\n"
foreach jump $secondFibChain {
lassign $jump step bin num name offset
append output "Step $step (offset $offset) >>> H$num - $name ($bin)\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
# Final guides
append output "===============================================\n\n"
append output "INTERPRETATION GUIDE FOR I CHING:\n"
append output "===============================================\n\n"
append output "Primary Hexagram: Current situation\n"
append output "Second Hexagram: Future development/outcome\n"
append output "Shadow/Complementary: Hidden opposite perspective\n"
append output "Nuclear: Inner/hidden dynamics\n"
append output "Superficial: Outer/surface dynamics\n"
append output "Trigram Echoes: Resonance with archetypal forces\n"
append output "DNA Replication Chain: Evolutionary progression\n"
append output "Fibonacci Jump Wheel: Golden ratio spiral movement \n\n"
append output "Consult traditional I Ching texts for detailed meanings.\n\n"
append output "===============================================\n"
append output "PROGRAM FEATURES GUIDE:\n"
append output "===============================================\n\n"
append output "CHANGING LINES: Lines marked with <- CHANGING will transform\n"
append output "from the Primary to the Second hexagram.\n\n"
append output "TRANSFORMS EXPLAINED:\n"
append output " Shadow/Complementary: Inverts all lines (yin,yang)\n"
append output " Nuclear: Uses inner lines (2,3,4 + 3,4,5)\n"
append output " Superficial: Uses outer lines (1,2,5 + 2,5,6)\n"
append output " Trigram Echoes: Convolves hexagram with 8 trigram kernels\n"
append output " DNA Replication: Duplicates and shifts pattern (like DNA)\n"
append output " Fibonacci Jump Wheel using Fibonacci sequence \n"
append output " Fibonacci sequence modulo 8 for golden ratio movement\n\n"
append output "===============================================\n\n"
append output "Primary Hexagram: Current situation\n"
append output "Second Hexagram: Future development/outcome\n"
append output "Shadow/Complementary: Hidden opposite perspective\n"
append output "Nuclear: Inner/hidden dynamics\n"
append output "Superficial: Outer/surface dynamics\n"
append output "Trigram Echoes: Resonance with archetypal trigram forces\n"
append output "DNA Replication Chain: Evolutionary progression through 8 generations\n"
append output "\nConsult traditional I Ching texts for detailed interpretations.\n\n"
append output "===============================================\n\n"
append output "===============================================\n\n"
append output "DEFAULT QUESTION MODE:What is best programming language, if TCL as Yes or No.\n"
append output "===============================================\n\n"
append output "BINARY OVERRIDE MODE:\n"
append output "Add a colon or semicolon followed by a 6-digit binary number\n"
append output "to use a specific hexagram instead of casting.\n"
append output "Examples:\n"
append output " \"My question :111111\" >>> Uses Hexagram #1 (The Creative)\n"
append output " \"My question ;000000\" >>> Uses Hexagram #2 (The Receptive)\n"
append output " \"My question :111000\" >>> Uses Hexagram #11 (Peace)\n"
append output " \"My question :999999\" >>> Invalid, defaults to casting\n"
append output " \"My question :10101\" >>> Invalid (5 digits), defaults to casting\n"
append output " 'Will I succeed? :111111' forces hexagram #1 (all yang)\n"
append output " 'What lies ahead? :000000' forces hexagram #2 (all yin)\n\n"
append output "\n"
append output "The yarrow stalk method uses traditional probabilities:\n"
append output " Old Yin (6): 1/16 chance - Changes to Yang\n"
append output " Young Yang (7): 7/16 chance - Stable\n"
append output " Young Yin (8): 5/16 chance - Stable\n"
append output " Old Yang (9): 3/16 chance - Changes to Yin\n"
append output "\n"
append output "Line symbols in output:\n"
append output " ----- Young Yang (7) - solid line\n"
append output " -- -- Young Yin (8) - broken line\n"
append output " --o-- Old Yang (9) - changing to Yin\n"
append output " --x-- Old Yin (6) - changing to Yang\n"
append output "\n"
append output "===============================================\n"
append output "End of Reading\n"
append output "===============================================\n"
$resultText insert end $output
$consoleText insert end $output
puts -nonewline stdout $output
flush stdout
}
proc copyConsole {} {
global consoleText
clipboard clear
clipboard append [$consoleText get 1.0 end-1c]
tk_messageBox -type ok -icon info -title "Copied" -message "Reading copied to clipboard!"
}
# ============================================================================
# GUI SETUP (button packing FIXED)
# ============================================================================
wm title . "I Ching Divination >>> Modern Transforms"
wm geometry . 1000x800
set bgColor "#f5f5dc"
set fgColor "#2c1810"
. configure -bg $bgColor
frame .title -bg $bgColor
pack .title -fill x -pady 10
label .title.main -text "I CHING" -font {Helvetica 22 bold} -bg $bgColor -fg $fgColor
pack .title.main
label .title.sub -text "Traditional Yarrow + Modern Mathematical Transforms" \
-font {Helvetica 10} -bg $bgColor -fg $fgColor
pack .title.sub
frame .question -bg $bgColor
pack .question -fill x -padx 20 -pady 10
label .question.lbl -text "Your Question:" -font {Helvetica 10 bold} \
-bg $bgColor -fg $fgColor
pack .question.lbl -anchor w
set questionVar ""
entry .question.ent -textvariable questionVar -font {Helvetica 10} -width 70
pack .question.ent -fill x -pady 5
frame .buttons -bg $bgColor
pack .buttons -pady 15
button .buttons.cast -text "CAST HEXAGRAM" -font {Helvetica 14 bold} \
-command castHexagram -bg "#d4a574" -fg $fgColor -padx 30 -pady 12
button .buttons.copy -text "COPY OUTPUT" -font {Helvetica 14 bold} \
-command copyConsole -bg "#c4a474" -fg $fgColor -padx 30 -pady 12
# FIXED: Correct packing – separate commands
pack .buttons.cast -side left -padx 20
pack .buttons.copy -side left -padx 20
frame .results -bg $bgColor
pack .results -fill both -expand 1 -padx 20 -pady 10
text .results.txt -wrap word -font {Courier 10} -bg white -fg $fgColor \
-yscrollcommand ".results.scroll set"
scrollbar .results.scroll -command ".results.txt yview"
pack .results.scroll -side right -fill y
pack .results.txt -fill both -expand 1
set resultText .results.txt
text .console -wrap none -font {Courier 9}
set consoleText .console
frame .footer -bg $bgColor
pack .footer -fill x -pady 5
label .footer.info -text "Tcl/Tk | Trigram Echo + DNA Replication + Fibonacci Bagua Wheel" \
-font {Helvetica 8} -bg $bgColor -fg "#666666"
pack .footer.info
$resultText insert end "\n\n Welcome to I Ching Divination\n"
$resultText insert end " ==============================\n\n"
$resultText insert end "Enter your question and click CAST HEXAGRAM.\n\n"
$resultText insert end "Now includes Fibonacci Jump Wheel Transform!\n\n"
expr {srand([clock seconds])}
focus .question.ent
puts "=============================================="
puts "I Ching Divination System Ready"
puts "All transforms active including Fibonacci Jump Wheel"
puts "==============================================""
Note. Code verified compatible with Tcl/Tk 8.6+ as of 12/2025.
# COMPLETE SYSTEM SUMMARY for programmatic validation (one-liner references)
# SYSTEM SUMMARY may include axioms that are mathematically redundant.
# 64 hexagrams, 8 trigrams, 4 line types (6,7,8,9)
# Transforms: shadow (bijection, 64→64), nuclear (16→{1,2,63,64}), superficial (experimental)
# Sequences: King Wen Sequence KWS (ritual, non-mathematical), Fuxi (binary 0-63)
# Line order: BOTTOM-TO-TOP (1=LSB, 6=MSB)
# Explicit Non-Mathematical Nature Warning on King Wen Sequence KWS
# King Wen Sequence KWS Is NOT a Mathematical (formula) or a linear system.
# The non-linear KWS order cannot be derived by formula. It is a ritualistic,
# historically-preserved sequence. Any attempt to find algebraic
# patterns may fail. Recommend Use lookup tables for KWS exclusively.
# CRITICAL: All binary uses BOTTOM-TO-TOP ordering
# Line 1 (bottom) = LSB (rightmost bit)
# Line 6 (top) = MSB (leftmost bit)
# Example: "111000" = ䷊ (Peace/Tai) means lines 1,2,3 yang; 4,5,6 yin
# Why lookup tables may be preferred over algorithmic computation:
# King Wen Sequence KWS conversion requires O(1) lookup vs O(n) pattern matching
# Nuclear transform iteration converges in ≤3 steps (proven bound)
# Note that the 16 possible nuclear forms arise
# from the mathematical constraint that lines 2≡4 and 3≡5
# shadow(nuclear(H)) ≠ nuclear(shadow(H)) in general
# Example: H=5 → nuclear=38, shadow=35
# shadow(nuclear(5))=63, nuclear(shadow(5))=39
# Recommend simple checksums for validation.
# Verification hashes (for programmatic validation):
# sum(king_wen_to_binary.values()) = 2,047,936
# len(set(correct_shadow_map.values())) = 64 # bijection check
# len(set(correct_nuclear_transform_map.values())) = 16 # constraint check
# For reproducible runs: srand fixed_seed
# Known Edge Cases section:
# Self-mapping hexagrams in nuclear transform: {1→1, 2→2, 63→64→63, 64→63→64}
# Complementary pairs that are NOT inversions (e.g., 27/28)
# Binary override validation rules (exactly 6 digits, only 0s and 1s)to be installed later
# Quantum Superposition Transform
# Simulates "collapsing" changing lines one by one, like quantum measurement
proc computeQuantumChain {binaryLines chain_length} {
global binary_to_king_wen hexNames
set binary [lines_to_binary $binaryLines]
set lines $binaryLines ;# Copy original lines (with 6/9 for changing)
# Find positions of changing lines (bottom to top: index 0 = bottom)
set changingPositions {}
for {set i 0} {$i < 6} {incr i} {
set val [lindex $lines $i]
if {$val == 6 || $val == 9} {
lappend changingPositions $i
}
}
set numChanging [llength $changingPositions]
if {$numChanging == 0} {
return [list [list 0 $binary $binary_to_king_wen($binary) $hexNames($binary_to_king_wen($binary)) "No changing lines - stable state"]]
}
set chain {}
set currentLines $lines
set currentBin $binary
set currentNum $binary_to_king_wen($currentBin)
set currentName $hexNames($currentNum)
lappend chain [list 0 $currentBin $currentNum $currentName "Initial (superposition)"]
set step 1
foreach pos $changingPositions {
if {$step > $chain_length} {break}
# "Measure/collapse" this changing line randomly
# 50% chance to flip (simple coin flip simulation of collapse)
set flip [expr {int(rand() * 2)}] ;# 0 = stay old (no flip yet), 1 = collapse to opposite
if {$flip} {
set val [lindex $currentLines $pos]
if {$val == 6} {
lset currentLines $pos 7 ;# Old yin -> yang
} elseif {$val == 9} {
lset currentLines $pos 8 ;# Old yang -> yin
}
set currentBin [lines_to_binary $currentLines]
set currentNum $binary_to_king_wen($currentBin)
set currentName $hexNames($currentNum)
append note "Line [expr {$pos+1}] collapsed"
} else {
append note "Line [expr {$pos+1}] remains in superposition"
}
lappend chain [list $step $currentBin $currentNum $currentName $note]
unset note
incr step
}
# Final fully collapsed state (all changing lines resolved if chain long enough)
if {$step <= $chain_length} {
# Force collapse remaining
foreach pos $changingPositions {
set val [lindex $currentLines $pos]
if {$val == 6} { lset currentLines $pos 7 }
if {$val == 9} { lset currentLines $pos 8 }
}
set currentBin [lines_to_binary $currentLines]
set currentNum $binary_to_king_wen($currentBin)
set currentName $hexNames($currentNum)
lappend chain [list $step $currentBin $currentNum $currentName "Fully collapsed state"]
}
return $chain
}
# tcl
set quantum_chain_length 6
set primaryQuantumChain [computeQuantumChain $rawLines $quantum_chain_length]
set secondQuantumChain [computeQuantumChain $secondLines $quantum_chain_length]
#tcl
append output "===============================================\n"
append output "QUANTUM SUPERPOSITION TRANSFORM CHAIN (Primary >>> potential collapses)\n"
append output "===============================================\n"
append output "(Simulates quantum measurement: changing lines collapse randomly one by one)\n\n"
foreach stepInfo $primaryQuantumChain {
lassign $stepInfo step bin num name note
append output "Step $step >>> H$num - $name ($bin) [$note]\n"
append output [drawHexagram [binaryToLines $bin]]
append output "\n"
}
# Repeat similar block for Second/Future
# And update the interpretation guide:
# tcl
append output "Quantum Superposition Chain: Potential futures as changing lines 'collapse' lik
These look-up tables for King Wen Sequence KWS from the I Ching Divination Systems are precalculated as alternative to complex math formulas and operations or math check in development of programs. These tables were developed to check the math in the gui program.
| Role | Derivation Method | Lines Used (bottom to top, lines 1–6) | Notes |
|---|---|---|---|
| Complementary / Shadow / Inverted | Invert all lines (Yang ↔ Yin) | Flip every line: stable 7↔8,<br>changing 6→7 and 9→8 | Perfect "twin" opposite perspective |
| Nuclear (Inner / Hidden / Core) | Overlap of middle four lines | Lower trigram: 2,3,4<br>Upper trigram: 3,4,5 | Restricts to 16 possible forms;<br>iterates to 1,2,63,64 |
| Superficial (Outer / Envelope) | Overlap of outer lines | Lower trigram: 1,2,5<br>Upper trigram: 2,5,6 | Complementary to nuclear (surface view) |
Note: All use traditional bottom-to-top ordering (line 1 = bottom). See individual lookup maps below for full King Wen number mappings.
#
# 1. Traditional King Wen sequence (what 99 % of all books and adepts use)
#
king_wen_to_binary = { # King Wen number → 6-bit pattern (bottom→top)
1:111111,2:000000,3:100010,4:010001,5:111010,6:010111,7:010000,8:000010,
9:111011,10:110111,11:111000,12:000111,13:101111,14:111101,15:001000,16:000100,
17:100110,18:011001,19:110000,20:000011,21:100101,22:101001,23:000001,24:100000,
25:100111,26:111001,27:100001,28:011110,29:010010,30:101101,31:001110,32:011100,
33:001111,34:111100,35:000101,36:101000,37:101011,38:110101,39:001010,40:010100,
41:110001,42:100011,43:111110,44:011111,45:000110,46:011000,47:010110,48:011010,
49:101110,50:011101,51:100100,52:001001,53:001011,54:110100,55:101100,56:001101,
57:011011,58:110110,59:010011,60:110010,61:110011,62:001100,63:101010,64:010101}Note. "All binary representations use bottom-to-top order (line 1 = least significant bit, line 6 = most significant bit), matching the standard King Wen lookup in the code above."
This rule helps calculations avoid common flips or errors (some sources and texts use top-to-bottom).
The Eight Trigrams (Bagua):
| Binary | Decimal | Lines (Bottom → Top) | English Name | Chinese | Symbol |
|---|---|---|---|---|---|
| 000 | 0 | Yin-Yin-Yin | Earth | Kun | ☷ |
| 001 | 1 | Yang-Yin-Yin | Mountain | Gen | ☶ |
| 010 | 2 | Yin-Yin-Yang | Water | Kan | ☵ |
| 011 | 3 | Yang-Yin-Yang | Wind | Xun | ☴ |
| 100 | 4 | Yin-Yang-Yin | Thunder | Zhen | ☳ |
| 101 | 5 | Yang-Yang-Yin | Fire | Li | ☲ |
| 110 | 6 | Yin-Yang-Yang | Lake | Dui | ☱ |
| 111 | 7 | Yang-Yang-Yang | Heaven | Qian | ☰ |
hexagram_trigrams = {
1: ("Heaven","Heaven"), 2: ("Earth","Earth"), 3: ("Thunder","Water"), 4: ("Water","Mountain"),
5: ("Heaven","Water"), 6: ("Water","Heaven"), 7: ("Water","Earth"), 8: ("Earth","Water"),
9: ("Heaven","Wind"), 10: ("Lake","Heaven"), 11: ("Heaven","Earth"), 12: ("Earth","Heaven"),
13: ("Fire","Heaven"), 14: ("Heaven","Fire"), 15: ("Mountain","Earth"), 16: ("Earth","Thunder"),
17: ("Thunder","Lake"), 18: ("Wind","Mountain"), 19: ("Lake","Earth"), 20: ("Earth","Wind"),
21: ("Thunder","Fire"), 22: ("Fire","Mountain"), 23: ("Earth","Mountain"), 24: ("Thunder","Earth"),
25: ("Thunder","Heaven"), 26: ("Heaven","Mountain"), 27: ("Thunder","Mountain"), 28: ("Wind","Lake"),
29: ("Water","Water"), 30: ("Fire","Fire"), 31: ("Mountain","Lake"), 32: ("Wind","Thunder"),
33: ("Mountain","Heaven"), 34: ("Heaven","Thunder"), 35: ("Earth","Fire"), 36: ("Fire","Earth"),
37: ("Fire","Wind"), 38: ("Lake","Fire"), 39: ("Mountain","Water"), 40: ("Water","Thunder"),
41: ("Lake","Mountain"), 42: ("Thunder","Wind"), 43: ("Heaven","Lake"), 44: ("Wind","Heaven"),
45: ("Earth","Lake"), 46: ("Wind","Earth"), 47: ("Water","Lake"), 48: ("Wind","Water"),
49: ("Fire","Lake"), 50: ("Wind","Fire"), 51: ("Thunder","Thunder"), 52: ("Mountain","Mountain"),
53: ("Mountain","Wind"), 54: ("Thunder","Lake"), 55: ("Fire","Thunder"), 56: ("Mountain","Fire"),
57: ("Wind","Wind"), 58: ("Lake","Lake"), 59: ("Water","Wind"), 60: ("Lake","Water"),
61: ("Lake","Wind"), 62: ("Mountain","Thunder"), 63: ("Fire","Water"), 64: ("Water","Fire")
}correct_shadow_map = {
1: 2, 2: 1, 3: 50, 4: 49, 5: 35, 6: 36, 7: 13, 8: 14,
9: 16, 10: 15, 11: 12, 12: 11, 13: 7, 14: 8, 15: 10, 16: 9,
17: 18, 18: 17, 19: 33, 20: 34, 21: 48, 22: 47, 23: 43, 24: 44,
25: 46, 26: 45, 27: 28, 28: 27, 29: 30, 30: 29, 31: 41, 32: 42,
33: 19, 34: 20, 35: 5, 36: 6, 37: 40, 38: 39, 39: 38, 40: 37,
41: 31, 42: 32, 43: 23, 44: 24, 45: 26, 46: 25, 47: 22, 48: 21,
49: 4, 50: 3, 51: 57, 52: 58, 53: 54, 54: 53, 55: 59, 56: 60,
57: 51, 58: 52, 59: 55, 60: 56, 61: 62, 62: 61, 63: 64, 64: 63
}correct_nuclear_transform_map = {
1: 1, 2: 2, 3: 23, 4: 24, 5: 38, 6: 37, 7: 24, 8: 23,
9: 38, 10: 37, 11: 54, 12: 53, 13: 44, 14: 43, 15: 40, 16: 39,
17: 53, 18: 54, 19: 24, 20: 23, 21: 39, 22: 40, 23: 2, 24: 2,
25: 53, 26: 54, 27: 2, 28: 1, 29: 27, 30: 28, 31: 44, 32: 43,
33: 44, 34: 43, 35: 39, 36: 40, 37: 64, 38: 63, 39: 64, 40: 63,
41: 24, 42: 23, 43: 1, 44: 1, 45: 53, 46: 54, 47: 37, 48: 38,
49: 44, 50: 43, 51: 39, 52: 40, 53: 64, 54: 63, 55: 28, 56: 28,
57: 38, 58: 37, 59: 27, 60: 27, 61: 27, 62: 28, 63: 64, 64: 63
}#
# Maps King Wen number (1–64) → Superficial ("outer shell") transform
# Construction: new hexagram lines = [1,2,5, 2,5,6] (bottom → top)
experimental_superficial_transform_map = {
1: 1, 2: 2, 3: 63, 4: 64, 5: 43, 6: 44, 7: 40, 8: 39,
9: 1, 10: 1, 11: 54, 12: 53, 13: 37, 14: 38, 15: 2, 16: 2,
17: 63, 18: 64, 19: 54, 20: 53, 21: 27, 22: 27, 23: 23, 24: 24,
25: 37, 26: 38, 27: 27, 28: 28, 29: 28, 30: 27, 31: 39, 32: 40,
33: 53, 34: 54, 35: 23, 36: 24, 37: 37, 38: 38, 39: 39, 40: 40,
41: 38, 42: 37, 43: 43, 44: 44, 45: 39, 46: 40, 47: 28, 48: 28,
49: 63, 50: 64, 51: 24, 52: 23, 53: 53, 54: 54, 55: 24, 56: 23,
57: 44, 58: 43, 59: 44, 60: 43, 61: 1, 62: 2, 63: 63, 64: 64
}The (experimental ) superficial transform is a useful but rarer derivation (sometimes called "outer" or "envelope" hexagram). Superficial transform is derived from lines 1,2,5 / 2,5,6 (bottom-to-top), complementary to nuclear's inner focus.
Standard reference, used in computations.
# King Wen sequence, 6-digit binary number
# Standard reference, used in computations.
king_wen_standard = {
1: "111111", 2: "000000", 3: "100010", 4: "010001", 5: "111010",
6: "010111", 7: "010000", 8: "000010", 9: "111011", 10: "110111",
11: "111000", 12: "000111", 13: "101111", 14: "111101", 15: "001000",
16: "000100", 17: "100110", 18: "011001", 19: "110000", 20: "000011",
21: "100101", 22: "101001", 23: "000001", 24: "100000", 25: "100111",
26: "111001", 27: "100001", 28: "011110", 29: "010010", 30: "101101",
31: "001110", 32: "011100", 33: "001111", 34: "111100", 35: "000101",
36: "101000", 37: "101011", 38: "110101", 39: "001010", 40: "010100",
41: "110001", 42: "100011", 43: "111110", 44: "011111", 45: "000110",
46: "011000", 47: "010110", 48: "011010", 49: "101110", 50: "011101",
51: "100100", 52: "001001", 53: "001011", 54: "110100", 55: "101100",
56: "001101", 57: "011011", 58: "110110", 59: "010011", 60: "110010",
61: "110011", 62: "001100", 63: "101010", 64: "010101"
}Ready-to-use CSV version of table.
Copy-paste into a plain-text file and save as iching_nuclear_iterations.csv or some such.
Save as iching_nuclear_iterations.csv and import into Excel Spreadsheet.
Number,Symbol,Traditional,Simplified,Pinyin,English,Nuclear_1,Nuclear_2,Nuclear_3,Pattern_Notes 1,䷀,乾,乾,Qián,The Creative,1,1,1,Self-perpetuating yang essence 2,䷁,坤,坤,Kūn,The Receptive,2,2,2,Self-perpetuating yin essence 3,䷂,屯,屯,Zhūn,Difficulty at the Beginning,23,2,2,Reduces to receptive stillness 4,䷃,蒙,蒙,Méng,Youthful Folly,24,2,2,Reduces to receptive stillness 5,䷄,需,需,Xū,Waiting,38,63,64,Oscillates between completion states 6,䷅,訟,讼,Sòng,Conflict,37,64,63,Oscillates between completion states 7,䷆,師,师,Shī,The Army,24,2,2,Reduces to receptive stillness 8,䷇,比,比,Bǐ,Holding Together,23,2,2,Reduces to receptive stillness 9,䷈,小畜,小畜,Xiǎo Chù,Small Taming,38,63,64,Oscillates between completion states 10,䷉,履,履,Lǚ,Treading,37,64,63,Oscillates between completion states 11,䷊,泰,泰,Tài,Peace,54,63,64,Oscillates between completion states 12,䷋,否,否,Pǐ,Standstill,53,64,63,Oscillates between completion states 13,䷌,同人,同人,Tóng Rén,Fellowship,44,1,1,Reduces to creative action 14,䷍,大有,大有,Dà Yǒu,Great Possession,43,1,1,Reduces to creative action 15,䷎,謙,谦,Qiān,Modesty,40,63,64,Oscillates between completion states 16,䷏,豫,豫,Yù,Enthusiasm,39,64,63,Oscillates between completion states 17,䷐,隨,随,Suí,Following,53,64,63,Oscillates between completion states 18,䷑,蠱,蛊,Gǔ,Work on the Decayed,54,63,64,Oscillates between completion states 19,䷒,臨,临,Lín,Approach,24,2,2,Reduces to receptive stillness 20,䷓,觀,观,Guān,Contemplation,23,2,2,Reduces to receptive stillness 21,䷔,噬嗑,噬嗑,Shì Hé,Biting Through,39,64,63,Oscillates between completion states 22,䷕,賁,贲,Bì,Grace,40,63,64,Oscillates between completion states 23,䷖,剝,剥,Bō,Splitting Apart,2,2,2,Reduces to receptive stillness 24,䷗,復,复,Fù,Return,2,2,2,Reduces to receptive stillness 25,䷘,無妄,无妄,Wú Wàng,Innocence,53,64,63,Oscillates between completion states 26,䷙,大畜,大畜,Dà Chù,Great Taming,54,63,64,Oscillates between completion states 27,䷚,頤,颐,Yí,Nourishment,2,2,2,Reduces to receptive stillness 28,䷛,大過,大过,Dà Guò,Great Exceeding,1,1,1,Reduces to creative action 29,䷜,坎,坎,Kǎn,The Abysmal Water,27,2,2,Reduces to receptive stillness 30,䷝,離,离,Lí,The Clinging Fire,28,1,1,Reduces to creative action 31,䷞,咸,咸,Xián,Influence,44,1,1,Reduces to creative action 32,䷟,恆,恒,Héng,Duration,43,1,1,Reduces to creative action 33,䷠,遯,遁,Dùn,Retreat,44,1,1,Reduces to creative action 34,䷡,大壯,大壮,Dà Zhuàng,Great Power,43,1,1,Reduces to creative action 35,䷢,晉,晋,Jìn,Progress,39,64,63,Oscillates between completion states 36,䷣,明夷,明夷,Míng Yí,Darkening of the Light,40,63,64,Oscillates between completion states 37,䷤,家人,家人,Jiā Rén,The Family,64,63,64,Oscillates between completion states 38,䷥,睽,睽,Kuí,Opposition,63,64,63,Oscillates between completion states 39,䷦,蹇,蹇,Jiǎn,Obstruction,64,63,64,Oscillates between completion states 40,䷧,解,解,Xiè,Deliverance,63,64,63,Oscillates between completion states 41,䷨,損,损,Sǔn,Decrease,24,2,2,Reduces to receptive stillness 42,䷩,益,益,Yì,Increase,23,2,2,Reduces to receptive stillness 43,䷪,夬,夬,Guài,Breakthrough,1,1,1,Reduces to creative action 44,䷫,姤,姤,Gòu,Coming to Meet,1,1,1,Reduces to creative action 45,䷬,萃,萃,Cuì,Gathering Together,53,64,63,Oscillates between completion states 46,䷭,升,升,Shēng,Pushing Upward,54,63,64,Oscillates between completion states 47,䷮,困,困,Kùn,Oppression,37,64,63,Oscillates between completion states 48,䷯,井,井,Jǐng,The Well,38,63,64,Oscillates between completion states 49,䷰,革,革,Gé,Revolution,44,1,1,Reduces to creative action 50,䷱,鼎,鼎,Dǐng,The Cauldron,43,1,1,Reduces to creative action 51,䷲,震,震,Zhèn,The Arousing Thunder,39,64,63,Oscillates between completion states 52,䷳,艮,艮,Gèn,Keeping Still Mountain,40,63,64,Oscillates between completion states 53,䷴,漸,渐,Jiàn,Gradual Progress,64,63,64,Oscillates between completion states 54,䷵,歸妹,归妹,Guī Mèi,The Marrying Maiden,63,64,63,Oscillates between completion states 55,䷶,豐,丰,Fēng,Abundance,28,1,1,Reduces to creative action 56,䷷,旅,旅,Lǚ,The Wanderer,28,1,1,Reduces to creative action 57,䷸,巽,巽,Xùn,The Gentle Wind,38,63,64,Oscillates between completion states 58,䷹,兌,兑,Duì,The Joyous Lake,37,64,63,Oscillates between completion states 59,䷺,渙,涣,Huàn,Dispersion,27,2,2,Reduces to receptive stillness 60,䷻,節,节,Jié,Limitation,27,2,2,Reduces to receptive stillness 61,䷼,中孚,中孚,Zhōng Fú,Inner Truth,27,2,2,Reduces to receptive stillness 62,䷽,小過,小过,Xiǎo Guò,Small Exceeding,28,1,1,Reduces to creative action 63,䷾,既濟,既济,Jì Jì,After Completion,64,63,64,Oscillates between completion states 64,䷿,未濟,未济,Wèi Jì,Before Completion,63,64,63,Oscillates between completion states ,,,,,,,,,"SUMMARY: Three core patterns emerge from nuclear reduction" ,,,,,,,,,"→ 1: 20 hexagrams reduce to pure yang/creative (Qián)" ,,,,,,,,,"→ 2: 22 hexagrams reduce to pure yin/receptive (Kūn)" ,,,,,,,,,"↔ 63-64: 20 hexagrams oscillate between completion states"
Note. Nuclear constraint rule: "Nuclear hexagrams are always one of the 16 self-consistent forms (where lines 2≡4 and 3≡5), reducing iteratively to {1,2,63,64} as shown in the CSV."
#
# FUXI Sequence vs KING WEN Sequence — Ultimate side-by-side human reference table
# CORRECTED (Dec 2025)
# Format: fuxi_pos : FUXI_PATTERN : KW# : KING_WEN_PATTERN : Traditional Name
# Every single entry has been machine-verified against standard sources
fuxi_vs_king_wen_verified = {
0: "000000 : 2 : 000000 : K'un - The Receptive (Earth)",
1: "000001 : 23 : 100000 : Po - Splitting Apart",
2: "000010 : 24 : 000001 : Fu - Return (The Turning Point)",
3: "000011 : 7 : 000010 : Shih - The Army",
4: "000100 : 4 : 100010 : Meng - Youthful Folly",
5: "000101 : 8 : 010000 : Pi - Holding Together",
6: "000110 : 20 : 110000 : Kuan - Contemplation (View)",
7: "000111 : 3 : 010001 : Chun - Difficulty at the Beginning",
8: "001000 : 42 : 110010 : I - Increase",
9: "001001 : 27 : 100001 : I - The Corners of the Mouth (Nourishment)",
10: "001010 : 45 : 011000 : Ts'ui - Gathering Together",
11: "001011 : 16 : 001000 : Yü - Enthusiasm",
12: "001100 : 35 : 101000 : Chin - Progress",
13: "001101 : 19 : 000011 : Lin - Approach",
14: "001110 : 15 : 000100 : Ch'ien - Modesty",
15: "001111 : 58 : 101010 : Tui - The Joyous (Lake)",
16: "010000 : 39 : 010011 : Chien - Obstruction",
17: "010001 : 48 : 010110 : Ching - The Well",
18: "010010 : 63 : 010101 : Chi Chi - After Completion",
19: "010011 : 61 : 110011 : Chung Fu - Inner Truth",
20: "010100 : 55 : 001100 : Feng - Abundance",
21: "010101 : 12 : 111000 : P'i - Standstill (Stagnation)",
22: "010110 : 11 : 000111 : T'ai - Peace",
23: "010111 : 44 : 111110 : Kou - Coming to Meet",
24: "011000 : 40 : 110001 : Hsieh - Deliverance",
25: "011001 : 28 : 011110 : Ta Kuo - Preponderance of the Great",
26: "011010 : 50 : 101110 : Ting - The Caldron",
27: "011011 : 33 : 111100 : Tun - Retreat",
28: "011100 : 31 : 011100 : Hsien - Influence (Wooing)",
29: "011101 : 56 : 011011 : Lü - The Wanderer",
30: "011110 : 62 : 001100 : Hsiao Kuo - Preponderance of the Small",
31: "011111 : 49 : 011101 : Ko - Revolution (Molting)", #Changed entry
32: "100000 : 43 : 011111 : Kuai - Breakthrough (Resoluteness)",
33: "100001 : 14 : 101111 : Ta Yu - Possession in Great Measure",
34: "100010 : 34 : 001111 : Ta Chuang - The Power of the Great",
35: "100011 : 9 : 110111 : Hsiao Ch'u - The Taming Power of the Small",
36: "100100 : 5 : 010111 : Hsü - Waiting (Nourishment)",
37: "100101 : 26 : 100111 : Ta Ch'u - The Taming Power of the Great",
38: "100110 : 41 : 100011 : Sun - Decrease",
39: "100111 : 25 : 111001 : Wu Wang - Innocence (The Unexpected)",
40: "101000 : 17 : 011001 : Sui - Following",
41: "101001 : 21 : 101001 : Shih Ho - Biting Through",
42: "101010 : 36 : 000101 : Ming I - Darkening of the Light",
43: "101011 : 13 : 111101 : T'ung Jen - Fellowship with Men",
44: "101100 : 10 : 111011 : Lü - Treading (Conduct)",
45: "101101 : 18 : 100110 : Ku - Work on What Has Been Spoiled",
46: "101110 : 57 : 110110 : Sun - The Gentle (Wind)",
47: "101111 : 51 : 001001 : Chen - The Arousing (Shock, Thunder)",
48: "110000 : 22 : 100101 : Pi - Grace",
49: "110001 : 59 : 110010 : Huan - Dispersion (Dissolution)",
50: "110010 : 60 : 010101 : Chieh - Limitation",
51: "110011 : 53 : 110011 : Chien - Development (Gradual Progress)",
52: "110100 : 54 : 001011 : Kuei Mei - The Marrying Maiden",
53: "110101 : 38 : 101011 : K'uei - Opposition",
54: "110110 : 37 : 110101 : Chia Jen - The Family",
55: "110111 : 52 : 100100 : Ken - Keeping Still (Mountain)",
56: "111000 : 32 : 001110 : Heng - Duration",
57: "111001 : 64 : 101010 : Wei Chi - Before Completion",
58: "111010 : 46 : 000110 : Sheng - Pushing Upward",
59: "111011 : 6 : 111010 : Sung - Conflict",
60: "111100 : 47 : 011010 : K'un - Oppression (Exhaustion)",
61: "111101 : 29 : 010010 : K'an - The Abysmal (Water)",
62: "111110 : 30 : 101101 : Li - The Clinging (Fire)",
63: "111111 : 1 : 111111 : Ch'ien - The Creative (Heaven)",
}Note. : Minimal correction needed. All Fu Xi patterns 000000–111111 are present exactly once. From a “combinatorics” perspective, no double use of any KW number, full 1–64 KW coverage, change 1 line. The maping became combinatorially complete and aligned with the standard King Wen sequence. This is a mapping design choice between two sequences (Fu Xi binary (in modern binary notation) vs. King Wen order), not an artifact of the historical absence of zero in early Chinese numerals.
Note After this change: Every Fu Xi index 0–63 still matches its six‑bit binary pattern. King Wen numbers 1–64 all appear exactly once. King Wen patterns match the standard reference sequence.
Note on Fuxi/KWS mapping: "The Fuxi (binary) sequence in modern notation starts with 000000 as pure yin (KW #2) and ends with 111111 as pure yang (KW #1); the provided side-by-side table has been verified for one-to-one coverage."
All binary representations use bottom-to-top order (line 1 = least significant bit, line 6 = most significant bit), matching the standard King Wen lookup in the code above.
The Fuxi (binary) sequence starts with 000000 as pure yin (KW #2) and ends with 111111 as pure yang (KW #1); the provided side-by-side table has been verified for one-to-one coverage.
Nuclear hexagrams are always one of the 16 self-consistent forms (where lines 2≡4 and 3≡5), reducing iteratively to {1,2,63,64} as shown in the CSV.
Yarrow probabilities: old yin (6): 1/16, old yang (9): 3/16, young yang (7): 7/16, young yin (8): 5/16; expected changing lines ≈1.875 per cast.
For reproducible runs: srand fixed_seed (e.g., srand 42) in TCL code.
These notes ensure exact reproduction across implementations, minimizing divergence in iterative processes.
#CSV file Generation,Binary (bottom→top),Resulting Hexagram,Traditional Name,Interpretive Theme 1,011101,H 50,The Cauldron,"Refinement through concentration; container of transformation." 2,110101,H 38,Opposition,"Divergence or polarity leading to definition of identity." 3,010111,H 6,Conflict,"Dynamic tension; testing integrity of boundaries." 4,011101,H 50,The Cauldron,"Recurrence of refinement; energy recycled into new form." 5,110101,H 38,Opposition,"Alternating polarity returns, maintaining energetic balance." 6,010111,H 6,Conflict,"System stress repeats, prompting adaptation." 7,011101,H 50,The Cauldron,"Renewal through recombination; persistence of order." 8,110101,H 38,Opposition,"Mature duality stabilized after multiple replications." # CSV List of DNA Replication Transform Example # Primary Origin: H9 – Small Taming (111101) # Rule: Duplicate sequence → take middle six bits (positions 3–8). # Purpose: Model of continuity and mutation through overlapping replication.
This page is under development. Comments are welcome, but please load any comments in the comments section at the bottom of the page. Please include your wiki MONIKER and date in your comment with the same courtesy that I will give you. Aside from your courtesy, your wiki MONIKER and date as a signature and minimal good faith of any internet post are the rules of this TCL-WIKI. Its very hard to reply reasonably without some background of the correspondent on his WIKI bio page. Thanks, gold 12Dec2025
Testing table format here
| Idea Name | Mathematical Field | Simple Description | Easy How-To (Simplified) | Why Novel for I Ching? | Ties to Your Fields |
|---|---|---|---|---|---|
| 1. Affine Linear Transforms | Linear Algebra (over finite fields like GF(2)) | Treat hexagrams as 6-bit vectors; apply reversible tweaks like rotations or flips to mix lines while keeping structure. | Pick a hexagram (e.g., all 1s: 111111). Rotate lines left or add flips. Repeat to see related "family" patterns. | Creates symmetry groups of related hexagrams, like viewing the situation from rotated time or balance angles. | Overlap graphs (transforms as symmetries); cellular automata (linear rules on bits). |
| 2. Convolutional Filters | Signal Processing (with sliding windows) | Slide a small 3-bit "filter" over the hexagram, mix overlapping parts (add or flip lines) to create a new one. | For 000111, use filter 1,0,1: slide and flip overlaps → try 001011. Test different filters for "echo" effects. | Adds direction to energy flow (up/down), going beyond static inner/outer trigrams. | Sliding-window / k-mer analysis; de Bruijn graphs for filtered paths; cellular automata as convolved rules. |
| 3. Hamming Ball Transforms | Coding Theory (distance metrics in binary spaces) | Look at "nearby" hexagrams (flip 1–2 lines), then vote on changes to pull toward a more stable version. | From 000001, check all single-flip options; majority per line pulls to all 0s. Models how changes "settle". | Shows influence bubbles around a hexagram, like possible related outcomes in a reading. | Overlap graphs with low-distance edges; k-mer neighborhoods; cellular automata diffusion. |
| 4. Quantum-Inspired Amplitude Transforms | Quantum Information (simplified superpositions) | Imagine lines can be "maybe 0 and maybe 1" at once; mix them, then randomly pick an outcome. | Start with all 1s; mix middle lines (creates 4 possibilities); randomly choose one. Adds true chance. | Brings wave-like spreading and uncertainty, like natural randomness in the oracle's core. | De Bruijn graphs for outcome paths; combinatorics on phased words; quantum cellular automata. |
| 5. De Bruijn Shift Transforms | Graph Theory (sequence graphs) | Shift lines like a conveyor belt: drop the bottom line, add a new top line based on a simple rule. | From 000000, shift and add 1 → becomes 000001. Keep shifting to create chains or full cycles. | Builds long "story chains" of hexagrams, can visit all 64 in loops for complete explorations. | Core overlap graphs / de Bruijn; combinatorics on words; cellular automata as shift + feedback rules. |
Note. The 2. Convolutional Filters scheme is kind of interest. Reminds me of context window, on much smaller scale.
gold 12/14/2025. Testing, encountered initial difficulty in saving work? Long code blocks with or unmatched wiki markup can sometimes confuse the Tcl Wiki formatting engine, especially if fences are not balanced or a line begins with markup it treats specially.
gold 12/14/2025. changes, corrected KWS reference block in appendix.
gold 12/16/2025. changes, corrected to standard Trigram table.
gold 12/21/2025. changes, blank spaces in Ascii displays are collapsed on some websites. Not sure fix, but on local machines, can adapt blank spaces, XXX___XXX
Please place any comments here with your wiki MONIKER and date, Thanks.gold12Dec2025
This is from computer methods. I have program that dumps the dawn hexagram with the Yarrow Stick probability and furnished the old fashioned ASCII "XXX XXX" displays. This ASCII displays and preliminary notes are the grunt work of casting a hexagram, which is quick for the AI models, but takes a human about 20 minutes of fumbling with those stick dice and line manipulation.
These tables have been cross checked against 4 different supercomputers. However, AI models can make mistakes, if not human authors too. Check other references to confirm important information.
Background
Shao Yong’s (邵雍, 1011–1077 CE) binary arrangement of the 64 hexagrams(also called the “Earlier Heaven” / Xiāntiān / Fuxi order in this context). Shao Yong was a brilliant Song-dynasty Neo-Confucian philosopher who discovered that the 64 hexagrams can be arranged in pure binary counting order from 000000 to 111111 — exactly like the numbers 0 to 63 in modern binary.
Precision Notes
For programmatic verification and cross-reference: * All binary representations use bottom-to-top order (line 1 = least significant bit, line 6 = most significant bit), matching the standard King Wen lookup in the code above. * The Fuxi (binary) sequence starts with 000000 as pure yin (KW #2) and ends with 111111 as pure yang (KW #1); the provided side-by-side table has been verified for one-to-one coverage. * Nuclear hexagrams are always one of the 16 self-consistent forms (where lines 2≡4 and 3≡5), reducing iteratively to {1,2,63,64} as shown in the CSV. * Yarrow probabilities: old yin (6): 1/16, old yang (9): 3/16, young yang (7): 7/16, young yin (8): 5/16; expected changing lines ≈1.875 per cast. * For reproducible runs: srand fixed_seed (e.g., srand 42) in TCL code.
These notes ensure exact reproduction across implementations, minimizing divergence in iterative processes.
Bonus One-liner to get King Wen number from Fuxi position (0–63)
fuxi_to_kingwen = 2,23,24,7,4,8,20,3,42,27,45,16,35,19,15,58, 39,48,63,61,55,12,11,44,40,28,50,33,31,56,62,1, 43,14,34,9,5,26,41,25,17,21,36,13,10,18,57,51, 22,59,60,53,54,38,37,52,32,64,46,6,47,29,30,1pos
| Category Numerical Analysis | Category Toys | Category Calculator | Category Mathematics | Category Example | Toys and Games | Category Games | Category Application | Category GUI |