<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Simulation on Programmer.ie: Modern AI programming</title>
    <link>http://programmer.ie/categories/simulation/</link>
    <description>Recent content in Simulation on Programmer.ie: Modern AI programming</description>
    <generator>Hugo</generator>
    <language>en-us</language>
    <lastBuildDate>Mon, 10 Aug 2026 18:59:00 +0100</lastBuildDate>
    <atom:link href="http://programmer.ie/categories/simulation/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Cellular Automata From First Principles 26: Cellular Automata as Computation</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-26/</link>
      <pubDate>Mon, 10 Aug 2026 18:59:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-26/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-26-cellular-automata-as-computation&#34;&gt;Cellular Automata From First Principles 26: Cellular Automata as Computation&lt;/h1&gt;&#xA;&lt;p&gt;A cellular automaton is a state machine distributed across space.&lt;/p&gt;&#xA;&lt;p&gt;Each cell reads local information, applies the same transition rule, and writes a new state.&lt;/p&gt;&#xA;&lt;p&gt;That is already a form of computation.&lt;/p&gt;&#xA;&lt;p&gt;The deeper question is whether local patterns can carry, transform and combine information in a way that supports general computation.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;information-needs-carriers&#34;&gt;Information needs carriers&lt;/h2&gt;&#xA;&lt;p&gt;In ordinary software, information lives in variables and memory addresses.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 25: Evolve Rules for Desired Behaviour</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-25/</link>
      <pubDate>Mon, 10 Aug 2026 18:58:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-25/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-25-evolve-rules-for-desired-behaviour&#34;&gt;Cellular Automata From First Principles 25: Evolve Rules for Desired Behaviour&lt;/h1&gt;&#xA;&lt;p&gt;Once we can represent a rule, mutate it and measure its behavior, we can evolve cellular automata.&lt;/p&gt;&#xA;&lt;p&gt;The key idea is simple:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;population of rules&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;simulate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;measure&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;select&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;mutate&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      ↓&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;repeat&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This chapter builds that loop without hiding it behind an optimization framework.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;represent-a-rule-as-bits&#34;&gt;Represent a rule as bits&lt;/h2&gt;&#xA;&lt;p&gt;For an elementary CA, eight output bits completely define the rule:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 24: Search Larger Rule Spaces</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-24/</link>
      <pubDate>Mon, 10 Aug 2026 18:57:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-24/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-24-search-larger-rule-spaces&#34;&gt;Cellular Automata From First Principles 24: Search Larger Rule Spaces&lt;/h1&gt;&#xA;&lt;p&gt;The 256 elementary rules are small enough to enumerate.&lt;/p&gt;&#xA;&lt;p&gt;Most interesting cellular-automata design spaces are not.&lt;/p&gt;&#xA;&lt;p&gt;Add more states, a larger neighborhood, continuous parameters, or several channels and exhaustive search quickly becomes impossible.&lt;/p&gt;&#xA;&lt;p&gt;So we need search strategies.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;why-the-rule-space-explodes&#34;&gt;Why the rule space explodes&lt;/h2&gt;&#xA;&lt;p&gt;For &lt;code&gt;k&lt;/code&gt; possible cell states and a neighborhood containing &lt;code&gt;n&lt;/code&gt; cells, there are:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;k^n possible neighborhood configurations&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A deterministic rule chooses one of &lt;code&gt;k&lt;/code&gt; outputs for every configuration, giving:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 23: Search All 256 Elementary Rules</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-23/</link>
      <pubDate>Mon, 10 Aug 2026 18:56:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-23/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-23-search-all-256-elementary-rules&#34;&gt;Cellular Automata From First Principles 23: Search All 256 Elementary Rules&lt;/h1&gt;&#xA;&lt;p&gt;Elementary cellular automata give us a rare luxury.&lt;/p&gt;&#xA;&lt;p&gt;The complete rule space is tiny.&lt;/p&gt;&#xA;&lt;p&gt;There are only:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;256 rules&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So we do not need sampling, intuition or famous examples.&lt;/p&gt;&#xA;&lt;p&gt;We can evaluate every rule.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;build-an-experiment-runner&#34;&gt;Build an experiment runner&lt;/h2&gt;&#xA;&lt;p&gt;Assume we already have:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;run_rule(rule_number, width, generations, initial_state)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;fingerprint(history)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then exhaustive search is simple:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;scan_rules&lt;/span&gt;(initial_state, width&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;201&lt;/span&gt;, generations&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    records &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; []&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;for&lt;/span&gt; rule &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; range(&lt;span style=&#34;color:#ae81ff&#34;&gt;256&lt;/span&gt;):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        history &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; run_rule(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            rule,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            width&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;width,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            generations&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;generations,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            initial_state&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;initial_state,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        )&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        records&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;append({&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#34;rule&amp;#34;&lt;/span&gt;: rule,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#f92672&#34;&gt;**&lt;/span&gt;fingerprint(history),&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        })&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; records&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The hard part is no longer execution.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 22: Classify Rule Behaviour</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-22/</link>
      <pubDate>Mon, 10 Aug 2026 18:55:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-22/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-22-classify-rule-behaviour&#34;&gt;Cellular Automata From First Principles 22: Classify Rule Behaviour&lt;/h1&gt;&#xA;&lt;p&gt;Cellular automata are often described using four broad behavioral classes:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Class I   -&amp;gt; settles to homogeneous behavior&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Class II  -&amp;gt; settles to simple stable or periodic structures&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Class III -&amp;gt; chaotic or apparently random behavior&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;Class IV  -&amp;gt; persistent local structures and complex interactions&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These labels are useful vocabulary.&lt;/p&gt;&#xA;&lt;p&gt;But if we want to use them experimentally, we should connect them to measurable evidence rather than treating them as magic categories.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 21: Sensitivity to Initial Conditions</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-21/</link>
      <pubDate>Mon, 10 Aug 2026 18:54:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-21/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-21-sensitivity-to-initial-conditions&#34;&gt;Cellular Automata From First Principles 21: Sensitivity to Initial Conditions&lt;/h1&gt;&#xA;&lt;p&gt;Change one cell.&lt;/p&gt;&#xA;&lt;p&gt;Then run the same rule twice.&lt;/p&gt;&#xA;&lt;p&gt;If the two futures remain almost identical, the rule is insensitive to that perturbation.&lt;/p&gt;&#xA;&lt;p&gt;If the difference spreads, the rule amplifies local uncertainty.&lt;/p&gt;&#xA;&lt;p&gt;That is one of the cleanest experiments we can perform on a cellular automaton.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;create-two-nearby-initial-states&#34;&gt;Create two nearby initial states&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;width &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;201&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;base &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(width, dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;uint8)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;base[width &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;perturbed &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; base&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;copy()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;perturbed[width &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;^=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The two states differ by exactly one bit.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 20: Periodicity and Attractors</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-20/</link>
      <pubDate>Mon, 10 Aug 2026 18:53:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-20/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-20-periodicity-and-attractors&#34;&gt;Cellular Automata From First Principles 20: Periodicity and Attractors&lt;/h1&gt;&#xA;&lt;p&gt;Many cellular automata eventually repeat.&lt;/p&gt;&#xA;&lt;p&gt;A fixed point repeats every generation.&lt;/p&gt;&#xA;&lt;p&gt;An oscillator repeats after several generations.&lt;/p&gt;&#xA;&lt;p&gt;On a finite grid, deterministic cellular automata must eventually revisit a previous state because only finitely many states exist.&lt;/p&gt;&#xA;&lt;p&gt;That makes cycle detection a fundamental measurement.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;hash-each-state&#34;&gt;Hash each state&lt;/h2&gt;&#xA;&lt;p&gt;For binary arrays we can store the bytes:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;state_key&lt;/span&gt;(state):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; state&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;tobytes()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Then track when each state first appeared:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 19: Entropy and Information</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-19/</link>
      <pubDate>Mon, 10 Aug 2026 18:52:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-19/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-19-entropy-and-information&#34;&gt;Cellular Automata From First Principles 19: Entropy and Information&lt;/h1&gt;&#xA;&lt;p&gt;A row with almost all zeros is highly predictable.&lt;/p&gt;&#xA;&lt;p&gt;A row containing a balanced mixture of zeros and ones is less predictable.&lt;/p&gt;&#xA;&lt;p&gt;Shannon entropy gives us a precise way to measure that uncertainty.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;binary-entropy&#34;&gt;Binary entropy&lt;/h2&gt;&#xA;&lt;p&gt;If a binary state contains a fraction &lt;code&gt;p&lt;/code&gt; of ones, then:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;H = -p log2(p) - (1-p) log2(1-p)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;In Python:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; math&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;binary_entropy&lt;/span&gt;(state):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    p &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; float(np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;mean(state))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; p &lt;span style=&#34;color:#f92672&#34;&gt;in&lt;/span&gt; (&lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;1.0&lt;/span&gt;):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;(p &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; math&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;log2(p) &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; (&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; p) &lt;span style=&#34;color:#f92672&#34;&gt;*&lt;/span&gt; math&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;log2(&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt; p))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The maximum is &lt;code&gt;1&lt;/code&gt; bit when zeros and ones occur equally often.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 18: Activity, Density and Change</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-18/</link>
      <pubDate>Mon, 10 Aug 2026 18:51:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-18/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-18-activity-density-and-change&#34;&gt;Cellular Automata From First Principles 18: Activity, Density and Change&lt;/h1&gt;&#xA;&lt;p&gt;A cellular automaton can look busy while doing very little that persists.&lt;/p&gt;&#xA;&lt;p&gt;It can also look visually quiet while preserving a small moving structure for hundreds of generations.&lt;/p&gt;&#xA;&lt;p&gt;So we need to separate several properties that are easy to confuse:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;occupancy&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;temporal change&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;spatial variation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;persistence&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This chapter turns those ideas into explicit measurements.&lt;/p&gt;&#xA;&lt;p&gt;Together they form our first useful &lt;strong&gt;behavioral fingerprint&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 17: Measure a Cellular Automaton</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-17/</link>
      <pubDate>Mon, 10 Aug 2026 18:50:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-17/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-17-measure-a-cellular-automaton&#34;&gt;Cellular Automata From First Principles 17: Measure a Cellular Automaton&lt;/h1&gt;&#xA;&lt;p&gt;Up to this point we have mostly &lt;strong&gt;looked at&lt;/strong&gt; cellular automata.&lt;/p&gt;&#xA;&lt;p&gt;That is useful.&lt;/p&gt;&#xA;&lt;p&gt;It is also limiting.&lt;/p&gt;&#xA;&lt;p&gt;A human can inspect a handful of spacetime diagrams.&lt;/p&gt;&#xA;&lt;p&gt;We cannot reliably inspect:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;256 elementary rules&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;× several initial conditions&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;× several widths&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;× hundreds of generations&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;× repeated stochastic runs&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;by eye.&lt;/p&gt;&#xA;&lt;p&gt;If we want to compare rules, search for interesting behavior or eventually optimize a rule for some objective, we need to turn behavior into data.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 13: Build a Predator-Prey Ecosystem</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-13/</link>
      <pubDate>Mon, 10 Aug 2026 18:44:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-13/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-13-build-a-predator-prey-ecosystem&#34;&gt;Cellular Automata From First Principles 13: Build a Predator-Prey Ecosystem&lt;/h1&gt;&#xA;&lt;p&gt;A forest fire mostly transforms cells in place.&lt;/p&gt;&#xA;&lt;p&gt;Rule 184 moves occupancy in one constrained direction.&lt;/p&gt;&#xA;&lt;p&gt;An ecosystem adds a harder problem:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;organisms move&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;organisms reproduce&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;predators consume prey&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;several organisms may want one destination&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now local intentions can conflict.&lt;/p&gt;&#xA;&lt;p&gt;That means update semantics become part of the model.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;separate-visible-kind-from-internal-state&#34;&gt;Separate visible kind from internal state&lt;/h2&gt;&#xA;&lt;p&gt;Start with:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 = empty&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;1 = prey&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2 = predator&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;EMPTY &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;PREY &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;PREDATOR &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;kind &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    (&lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;, &lt;span style=&#34;color:#ae81ff&#34;&gt;100&lt;/span&gt;),&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;uint8,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A richer model may need predator energy, age or reproduction state.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 12: Reaction-Diffusion and Pattern Formation</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-12/</link>
      <pubDate>Mon, 10 Aug 2026 18:42:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-12/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-12-reaction-diffusion-and-pattern-formation&#34;&gt;Cellular Automata From First Principles 12: Reaction-Diffusion and Pattern Formation&lt;/h1&gt;&#xA;&lt;p&gt;Diffusion smooths differences.&lt;/p&gt;&#xA;&lt;p&gt;Reaction can amplify them.&lt;/p&gt;&#xA;&lt;p&gt;Put the two processes together and a nearly uniform field can develop persistent spots, stripes and fronts.&lt;/p&gt;&#xA;&lt;p&gt;We will use a discrete Gray-Scott reaction-diffusion simulation because it gives us a compact bridge from local cellular updates to continuous pattern-forming dynamics.&lt;/p&gt;&#xA;&lt;p&gt;Each lattice cell stores two values:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;U = concentration of chemical U&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;V = concentration of chemical V&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;So our cell state is now a vector:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 11: Diffusion as Local Exchange</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-11/</link>
      <pubDate>Mon, 10 Aug 2026 18:40:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-11/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-11-diffusion-as-local-exchange&#34;&gt;Cellular Automata From First Principles 11: Diffusion as Local Exchange&lt;/h1&gt;&#xA;&lt;p&gt;Until now most cells have stored discrete state:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 / 1&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;empty / tree / fire&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;road / car&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now let each cell store a continuous quantity.&lt;/p&gt;&#xA;&lt;p&gt;For diffusion:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state[y, x] = concentration&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The local transition is no longer birth, death or movement.&lt;/p&gt;&#xA;&lt;p&gt;It is local exchange.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-a-pulse&#34;&gt;Start with a pulse&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;size &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;121&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;grid &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    (size, size),&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;float64,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;grid[&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    size &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    size &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1.0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;At the beginning one cell contains all the concentration.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 10: Simulate Traffic with Rule 184</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-10/</link>
      <pubDate>Mon, 10 Aug 2026 18:38:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-10/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-10-simulate-traffic-with-rule-184&#34;&gt;Cellular Automata From First Principles 10: Simulate Traffic with Rule 184&lt;/h1&gt;&#xA;&lt;p&gt;Rule 184 is a beautiful example of moving from an abstract rule table to a model with a concrete interpretation.&lt;/p&gt;&#xA;&lt;p&gt;Use a one-dimensional ring road:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;1 = car&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 = empty road&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;A car moves one cell to the right when the destination is empty.&lt;/p&gt;&#xA;&lt;p&gt;That is enough to produce free flow, queues and a macroscopic density-flow relationship.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;write-the-traffic-mechanism-directly&#34;&gt;Write the traffic mechanism directly&lt;/h2&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;traffic_step&lt;/span&gt;(road):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    cars &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; road &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    empty_ahead &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; (&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;roll(road, &lt;span style=&#34;color:#f92672&#34;&gt;-&lt;/span&gt;&lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;) &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    )&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    moving &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; cars &lt;span style=&#34;color:#f92672&#34;&gt;&amp;amp;&lt;/span&gt; empty_ahead&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    next_road &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; road&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;copy()&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    next_road[moving] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;0&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    next_road[&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;roll(moving, &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    ] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt; next_road&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The road is periodic, so the final road cell connects back to the first.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 09: Build a Forest Fire Simulation</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-09/</link>
      <pubDate>Mon, 10 Aug 2026 18:36:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-09/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-09-build-a-forest-fire-simulation&#34;&gt;Cellular Automata From First Principles 09: Build a Forest Fire Simulation&lt;/h1&gt;&#xA;&lt;p&gt;A forest fire is almost an ideal cellular-automaton exercise.&lt;/p&gt;&#xA;&lt;p&gt;The visible states are obvious:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;0 = empty&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;1 = tree&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2 = burning&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The interactions are local.&lt;/p&gt;&#xA;&lt;p&gt;And small changes in fuel density or ignition assumptions can produce very different global outcomes.&lt;/p&gt;&#xA;&lt;p&gt;This is not intended as a high-fidelity wildfire model.&lt;/p&gt;&#xA;&lt;p&gt;It is a deliberately simplified &lt;strong&gt;spread model&lt;/strong&gt; designed to isolate one mechanism:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 08: Add Randomness Without Losing the Model</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-08/</link>
      <pubDate>Mon, 10 Aug 2026 18:34:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-08/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-08-add-randomness-without-losing-the-model&#34;&gt;Cellular Automata From First Principles 08: Add Randomness Without Losing the Model&lt;/h1&gt;&#xA;&lt;p&gt;So far every transition in the book has been deterministic.&lt;/p&gt;&#xA;&lt;p&gt;Given the same state, the next state is fixed.&lt;/p&gt;&#xA;&lt;p&gt;That makes deterministic automata unusually easy to debug: if we preserve the initial condition and rule, we preserve the trajectory.&lt;/p&gt;&#xA;&lt;p&gt;But many useful models need another ingredient.&lt;/p&gt;&#xA;&lt;p&gt;A tree may ignite.&lt;/p&gt;&#xA;&lt;p&gt;An organism may reproduce.&lt;/p&gt;&#xA;&lt;p&gt;A driver may hesitate.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 07: Beyond Conway — Life-like and Multi-State Rules</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-07/</link>
      <pubDate>Mon, 10 Aug 2026 18:27:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-07/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-07-beyond-conway--life-like-and-multi-state-rules&#34;&gt;Cellular Automata From First Principles 07: Beyond Conway — Life-like and Multi-State Rules&lt;/h1&gt;&#xA;&lt;p&gt;Conway&amp;rsquo;s Game of Life is famous enough that it can accidentally become the definition of cellular automata.&lt;/p&gt;&#xA;&lt;p&gt;It is not.&lt;/p&gt;&#xA;&lt;p&gt;Life is one point in a much larger design space.&lt;/p&gt;&#xA;&lt;p&gt;Keep the same two-dimensional grid and the same eight-cell Moore neighborhood, then change only the birth and survival counts.&lt;/p&gt;&#xA;&lt;p&gt;You immediately get a family of &lt;strong&gt;Life-like cellular automata&lt;/strong&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 06: Patterns as Data — Oscillators, Spaceships and Gliders</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-06/</link>
      <pubDate>Mon, 10 Aug 2026 18:26:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-06/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-06-patterns-as-data--oscillators-spaceships-and-gliders&#34;&gt;Cellular Automata From First Principles 06: Patterns as Data — Oscillators, Spaceships and Gliders&lt;/h1&gt;&#xA;&lt;p&gt;Once we can run Conway&amp;rsquo;s Game of Life, the next step is not to add more graphics.&lt;/p&gt;&#xA;&lt;p&gt;It is to make the patterns themselves inspectable.&lt;/p&gt;&#xA;&lt;p&gt;A blinker is not interesting because somebody named it.&lt;/p&gt;&#xA;&lt;p&gt;It is interesting because it returns to the same state after two generations.&lt;/p&gt;&#xA;&lt;p&gt;A glider is not interesting because it has a familiar shape.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 05: Conway&#39;s Game of Life</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-05/</link>
      <pubDate>Mon, 10 Aug 2026 18:25:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-05/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-05-conways-game-of-life&#34;&gt;Cellular Automata From First Principles 05: Conway&amp;rsquo;s Game of Life&lt;/h1&gt;&#xA;&lt;p&gt;Conway&amp;rsquo;s Game of Life is one of the cleanest examples of complex two-dimensional behavior emerging from a tiny local rule.&lt;/p&gt;&#xA;&lt;p&gt;The world is a grid of dead and live cells.&lt;/p&gt;&#xA;&lt;p&gt;Each cell sees its eight surrounding neighbors.&lt;/p&gt;&#xA;&lt;p&gt;Then four ideas decide the next generation:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;underpopulation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;survival&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;overpopulation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;birth&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The standard rule is usually written &lt;strong&gt;B3/S23&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a dead cell is born with exactly 3 live neighbors,&lt;/li&gt;&#xA;&lt;li&gt;a live cell survives with 2 or 3 live neighbors.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Everything else becomes or remains dead.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 04: Rule 110 and Computation in a Grid</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-04/</link>
      <pubDate>Mon, 10 Aug 2026 18:24:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-04/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-04-rule-110-and-computation-in-a-grid&#34;&gt;Cellular Automata From First Principles 04: Rule 110 and Computation in a Grid&lt;/h1&gt;&#xA;&lt;p&gt;Rule 110 looks like another one-byte transition table.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;111 110 101 100 011 010 001 000&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; 0   1   1   0   1   1   1   0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;But its behavior gives us a much deeper idea: a cellular automaton can become a computational medium.&lt;/p&gt;&#xA;&lt;p&gt;The important shift is this:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;pattern generator&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      -&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;signal system&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;      -&amp;gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;computation&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Rule 110 is computationally universal. Matthew Cook published the universality proof in &lt;em&gt;Complex Systems&lt;/em&gt; in 2004, showing that this elementary one-dimensional automaton can emulate universal computation.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 03: Rule 30 and the Surprise of Complexity</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-03/</link>
      <pubDate>Mon, 10 Aug 2026 18:23:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-03/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-03-rule-30-and-the-surprise-of-complexity&#34;&gt;Cellular Automata From First Principles 03: Rule 30 and the Surprise of Complexity&lt;/h1&gt;&#xA;&lt;p&gt;Rule 30 is a perfect demonstration of why cellular automata are worth studying.&lt;/p&gt;&#xA;&lt;p&gt;Its transition table contains eight bits:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;111 110 101 100 011 010 001 000&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt; 0   0   0   1   1   1   1   0&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Start from one active cell and repeatedly apply that rule.&lt;/p&gt;&#xA;&lt;p&gt;The result rapidly stops looking like something generated by a tiny deterministic program.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 02: Encode All 256 Elementary Rules</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-02/</link>
      <pubDate>Mon, 10 Aug 2026 18:22:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-02/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-02-encode-all-256-elementary-rules&#34;&gt;Cellular Automata From First Principles 02: Encode All 256 Elementary Rules&lt;/h1&gt;&#xA;&lt;p&gt;An elementary cellular automaton has only three inputs per cell:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;left centre right&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Each input is one bit.&lt;/p&gt;&#xA;&lt;p&gt;That means there are only eight possible neighborhoods:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;111 110 101 100 011 010 001 000&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For each neighborhood the rule chooses either &lt;code&gt;0&lt;/code&gt; or &lt;code&gt;1&lt;/code&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Eight binary choices means:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;2^8 = 256&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;possible rules.&lt;/p&gt;&#xA;&lt;p&gt;The elegant part is that we can store one complete rule table in one byte.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 01: Build Your First Automaton</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-01/</link>
      <pubDate>Mon, 10 Aug 2026 18:21:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-01/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-01-build-your-first-automaton&#34;&gt;Cellular Automata From First Principles 01: Build Your First Automaton&lt;/h1&gt;&#xA;&lt;p&gt;In the previous chapter we reduced a cellular automaton to four things:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-text&#34; data-lang=&#34;text&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;space&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;neighborhood&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;rule&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now we are going to build one.&lt;/p&gt;&#xA;&lt;p&gt;Not a framework.&lt;/p&gt;&#xA;&lt;p&gt;Not a library.&lt;/p&gt;&#xA;&lt;p&gt;One update step.&lt;/p&gt;&#xA;&lt;p&gt;That is enough to expose the whole mechanism.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;start-with-a-one-dimensional-world&#34;&gt;Start with a one-dimensional world&lt;/h2&gt;&#xA;&lt;p&gt;Create a row of cells and turn on the centre cell:&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; numpy &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; np&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;width &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;41&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;zeros(width, dtype&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;np&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;uint8)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;state[width &lt;span style=&#34;color:#f92672&#34;&gt;//&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;2&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;1&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;print(state)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Conceptually:&lt;/p&gt;</description>
    </item>
    <item>
      <title>Cellular Automata From First Principles 00: How Can Tiny Rules Build Complex Worlds?</title>
      <link>http://programmer.ie/post/cellular-automata-from-first-principles-00/</link>
      <pubDate>Mon, 10 Aug 2026 18:20:00 +0100</pubDate>
      <guid>http://programmer.ie/post/cellular-automata-from-first-principles-00/</guid>
      <description>&lt;h1 id=&#34;cellular-automata-from-first-principles-00-how-can-tiny-rules-build-complex-worlds&#34;&gt;Cellular Automata From First Principles 00: How Can Tiny Rules Build Complex Worlds?&lt;/h1&gt;&#xA;&lt;p&gt;A cellular automaton begins with almost nothing.&lt;/p&gt;&#xA;&lt;p&gt;You need:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;a collection of cells,&lt;/li&gt;&#xA;&lt;li&gt;a state for each cell,&lt;/li&gt;&#xA;&lt;li&gt;a neighborhood,&lt;/li&gt;&#xA;&lt;li&gt;and a rule that tells each cell what to become next.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;That is enough.&lt;/p&gt;&#xA;&lt;p&gt;There is no central controller.&lt;/p&gt;&#xA;&lt;p&gt;There is no object that knows what the final pattern should look like.&lt;/p&gt;&#xA;&lt;p&gt;There is only local state changing through time.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
