<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ethan Lin · HexSage</title>
    <description>The latest articles on DEV Community by Ethan Lin · HexSage (@hexsage).</description>
    <link>https://dev.to/hexsage</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4222010%2F58426ce8-5cbf-482d-bbe7-9430bcd62887.jpg</url>
      <title>DEV Community: Ethan Lin · HexSage</title>
      <link>https://dev.to/hexsage</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hexsage"/>
    <language>en</language>
    <item>
      <title>Building a 6-Bit Combinatorial State Machine &amp; True Solar Time Engine for the Classical Zhouyi</title>
      <dc:creator>Ethan Lin · HexSage</dc:creator>
      <pubDate>Mon, 02 Nov 2026 09:43:15 +0000</pubDate>
      <link>https://dev.to/hexsage/building-a-6-bit-combinatorial-state-machine-true-solar-time-engine-for-the-classical-zhouyi-fb1</link>
      <guid>https://dev.to/hexsage/building-a-6-bit-combinatorial-state-machine-true-solar-time-engine-for-the-classical-zhouyi-fb1</guid>
      <description>&lt;p&gt;In 1703, Gottfried Wilhelm Leibniz published &lt;em&gt;Explication de l'Arithmétique Binaire&lt;/em&gt; after corresponding with Joachim Bouvet and studying Shao Yong's 11th-century arrangement of the 64 hexagrams of the &lt;em&gt;Zhouyi&lt;/em&gt; (&lt;em&gt;I Ching&lt;/em&gt; / Book of Changes).&lt;/p&gt;

&lt;p&gt;Strip away the pop-culture mystification, and the classical &lt;em&gt;Zhouyi&lt;/em&gt; is a clean &lt;strong&gt;6-bit binary hypercube (&lt;code&gt;2^6 = 64&lt;/code&gt; states)&lt;/strong&gt; where every state has 6 addressable coordinates (&lt;code&gt;L1 ... L6&lt;/code&gt;), and moving lines represent single- or multi-bit Hamming transitions between a Primary State (&lt;em&gt;Ben Gua&lt;/em&gt;) and a Resulting State (&lt;em&gt;Zhi Gua&lt;/em&gt;).&lt;/p&gt;

&lt;p&gt;Over the past few months, we built &lt;strong&gt;&lt;a href="https://hexsage.ai/" rel="noopener noreferrer"&gt;HexSage&lt;/a&gt;&lt;/strong&gt; — a zero-login browser workbench for exploring classical combinatorial casting algorithms, astronomical solar-time calibration, and structured decision debiasing.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Why Three Coins != Fifty Yarrow Stalks (&lt;code&gt;1:3:3:1&lt;/code&gt; vs &lt;code&gt;1:3:5:7&lt;/code&gt;)
&lt;/h3&gt;

&lt;p&gt;Most web implementations just call &lt;code&gt;Math.random() &amp;lt; 0.5&lt;/code&gt; six times. Historically, that misses the core asymmetry of classical protocols:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Three-Coin Binomial Throw&lt;/strong&gt; (&lt;a href="https://hexsage.ai/i-ching-coins" rel="noopener noreferrer"&gt;interactive 3-coin simulator&lt;/a&gt;): Three independent Bernoulli trials yield symmetric moving-line probabilities — &lt;code&gt;P(Old Yin 6) = 2/16&lt;/code&gt; (&lt;code&gt;12.5%&lt;/code&gt;) and &lt;code&gt;P(Old Yang 9) = 2/16&lt;/code&gt; (&lt;code&gt;12.5%&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;50-Stalk Yarrow Remainder Algorithm (&lt;em&gt;Dayan Zhi Shu&lt;/em&gt;)&lt;/strong&gt; (&lt;a href="https://hexsage.ai/yarrow-stalks-i-ching" rel="noopener noreferrer"&gt;50-stalk step-by-step trace&lt;/a&gt;): Separating 49 active stalks through three modulo-4 remainder operations produces an asymmetric distribution: &lt;code&gt;P(6) = 1/16&lt;/code&gt;, &lt;code&gt;P(9) = 3/16&lt;/code&gt;, &lt;code&gt;P(7) = 5/16&lt;/code&gt;, &lt;code&gt;P(8) = 7/16&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Shao Yong Two-Number Modulo Coordinate&lt;/strong&gt;: Maps an upper integer &lt;code&gt;(N1 mod 8)&lt;/code&gt; and lower integer &lt;code&gt;(N2 mod 8)&lt;/code&gt; onto the 8x8 trigram grid, with &lt;code&gt;(N1 + N2) mod 6&lt;/code&gt; isolating a deterministic pivot line.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Inquiry Framing &amp;amp; Multi-Line Transition Resolution
&lt;/h3&gt;

&lt;p&gt;When 2, 3, or 5 bits flip simultaneously in a single reading, beginners often get stuck reading contradictory line statements. In our new &lt;strong&gt;&lt;a href="https://hexsage.ai/consult-the-i-ching" rel="noopener noreferrer"&gt;step-by-step guide to consult the I Ching&lt;/a&gt;&lt;/strong&gt;, we implemented Zhu Xi's classical transition hierarchy alongside an interactive &lt;strong&gt;Inquiry Scope Guardrail&lt;/strong&gt; that helps reframe vague yes/no anxieties into concrete 90-day risk-control milestones.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Equation of Time (True Solar Time) Calibration
&lt;/h3&gt;

&lt;p&gt;Standard civil time zones span 15 degrees of longitude (&lt;code&gt;+/- 30&lt;/code&gt; minutes of solar offset), plus Earth's orbital eccentricity and axial tilt add another &lt;code&gt;-14.2&lt;/code&gt; to &lt;code&gt;+16.4&lt;/code&gt; minutes via the Equation of Time:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;true_solar_time_offset_minutes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;longitude_deg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;std_meridian_deg&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;day_of_year&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;int&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="nb"&gt;float&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;b_rad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;radians&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mf"&gt;360.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;day_of_year&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mi"&gt;81&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;/&lt;/span&gt; &lt;span class="mf"&gt;365.0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;eot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mf"&gt;9.87&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;2&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;b_rad&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;7.53&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;cos&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b_rad&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="mf"&gt;1.5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="n"&gt;math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b_rad&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="mf"&gt;4.0&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;longitude_deg&lt;/span&gt; &lt;span class="o"&gt;-&lt;/span&gt; &lt;span class="n"&gt;std_meridian_deg&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="n"&gt;eot&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Calibrating civil timestamps to True Solar Time prevents boundary-hour off-by-one shifts near local solar midnight and noon.&lt;/p&gt;

&lt;p&gt;If you enjoy mathematical history, binary state graphs, or structured cognitive debiasing tools, you can test the no-sign-up sandbox directly at &lt;strong&gt;&lt;a href="https://hexsage.ai/" rel="noopener noreferrer"&gt;hexsage.ai&lt;/a&gt;&lt;/strong&gt; or grab the free &lt;a href="https://hexsage.ai/widgets" rel="noopener noreferrer"&gt;embeddable hexagram widget&lt;/a&gt;. Feedback on the UI and probability visualizations is very welcome!&lt;/p&gt;




&lt;h2&gt;
  
  
  2K Mathematical Visualization: Shao Yong (1060 AD) &amp;amp; Leibniz's 6-Bit Binary Matrix
&lt;/h2&gt;

&lt;p&gt;Watch how the 6-layer binary tree (&lt;code&gt;2^0 -&amp;gt; 2^6 = 64&lt;/code&gt;), the &lt;code&gt;8x8&lt;/code&gt; Kronecker tensor grid (&lt;code&gt;H + H_bar = 63&lt;/code&gt;), and bitwise XOR state transitions (&lt;code&gt;s' = s ^ m&lt;/code&gt;) operate visually in 2K UltraHD:&lt;/p&gt;

&lt;p&gt;  &lt;iframe src="https://www.youtube.com/embed/7WVz_Qa8fVc" width="710" height="399"&gt;
  &lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;You can also inspect all 64 binary vertices in our &lt;a href="https://hexsage.ai/hexagrams" rel="noopener noreferrer"&gt;64-Hexagram Binary Matrix Directory&lt;/a&gt;, test bitwise palace transitions in the &lt;a href="https://hexsage.ai/six-lines-najia" rel="noopener noreferrer"&gt;Jing Fang Six-Lines Matrix&lt;/a&gt;, or run unified 3-coin / 50-stalk / modulo casts in the &lt;a href="https://hexsage.ai/i-ching-generator" rel="noopener noreferrer"&gt;Free 6-Line I Ching Generator&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>javascript</category>
    </item>
  </channel>
</rss>
