News for hackers. Stuff that matters.

gezhengwen

Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @07:07PM (#47496351)
Each hexagram has two positions: one in the binary natural order (0-63), and one in the King Wen sequence. The rule is: a hexagram moves from its natural order position to its King Wen position. For example, Qian is at position 63 in the natural order and position 0 in the King Wen sequence, so σ(63)=0. Then look at position 0 (Kun), which is at position 1 in the King Wen sequence, so σ(0)=1. Follow this chain until you return to the start. There is no formula — σ is defined by the mapping table between the two orderings.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @09:40AM (#47489404)
The I Ching has a historical connection to magic squares — the Lo Shu is a 3x3 magic square traditionally linked to the I Ching. But cycle decomposition analyzes the permutation between two orderings, which is a different mathematical structure from the row/column/diagonal sums of magic squares. That said, it is an interesting direction worth exploring.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @09:39AM (#47489393)
The Shang dynasty people knew the pairing structure of hexagrams (inverted/complementary pairs), but cycle decomposition is a modern group theory tool that did not exist until the 19th century. These are two different levels of analysis.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @09:35AM (#47489352)
The observation itself is the value — it tells you the King Wen sequence is not a bunch of small local adjustments, but a holistic rearrangement. But it cannot tell you why King Wen arranged it this way.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @07:29AM (#47487995)
Yes, it is essentially the same mathematical concept — both are cycle decompositions of permutations. Carmack used a permutation to ensure every pixel is visited exactly once.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @06:52AM (#47487665)
You are right, the presentation may be overdone. The result itself is a small mathematical fact. I made the interactive page so people can verify it themselves, not to make it look grand. Thank you for the criticism, I will adjust.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @06:51AM (#47487656)
You are right, the expected largest cycle of a random permutation is around 40. 52 is larger but not extreme. I did not claim this result is statistically significant.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @06:47AM (#47487629)
You are right, zero fixed points does not mean total structural difference. Your counterexample is good. My wording was wrong, I will fix it. What interests me is not the statistical rarity, but that 81% of elements are in one orbit — this means the reordering is highly coupled, not a bunch of small local swaps.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @05:48AM (#47487231)
The I Ching has influenced China for over 3000 years. I believe there must be a reason for that. In China, the I Ching is often treated as mysticism. But I believe in science. The end of mysticism must still be science. So I did a lot of research and found a unique pattern inside. I searched all the literature and found nothing about it. So I shared it here.
Re:Show HN: The King Wen Permutation: [52, 10, 2] on Monday March 23, 2026 @04:29AM (#47486724)
I found this by accident while analyzing the I Ching with code. 81% of hexagrams are locked in one chain, none stays in its original position. You can verify it yourself in the browser. Has anyone seen this before?

Show HN: The King Wen Permutation: [52, 10, 2]

https://gzw1987-bit.github.io/iching-math/

I analyzed two orderings of the 64 I Ching hexagrams and found the permutation cycle decomposition between them is [52, 10, 2] with zero fixed points. Nobody has done this kind of analysis before and this cycle type has not been reported in the literature. You can verify it yourself.

( Read More... | 27 comments | 26 points | on HN )