r/cellular_automata

Image 1 — Collatz simulator using balanced ternary strings and rewrite rules (No arithmetic)
Image 2 — Collatz simulator using balanced ternary strings and rewrite rules (No arithmetic)
Image 3 — Collatz simulator using balanced ternary strings and rewrite rules (No arithmetic)
▲ 25 r/cellular_automata+1 crossposts

Collatz simulator using balanced ternary strings and rewrite rules (No arithmetic)

Hey,

Just wanted to share a little project. Not claiming any crazy math proof here, just a representation of Collatz using **balanced ternary** (`+`, `o`, `-`) instead of normal binary or base-10.

Because of how balanced ternary works, you can basically bypass normal CPU math and run the operations as simple text replacement rules on a string.

How it works:

  • Parity: If the count of non-zero trits (`+` or `-`) is even, the number is even.
  • 3x+1: Just append a `+` to the end of the little-endian string. O(1) time, no real math needed.
  • Divide by 2: The string splits from left to right into blocks bounded by non-zero trits. Then it just uses two basic substitution rules:
  1. Same signs: a(0...n)a` ➔ `aa'... (n+1) times` (e.g., `+000+` becomes `+----`)
  2. Opposite signs: a(0...n)a'` ➔ `0a... (n+1) times` (e.g., `+000-` becomes `0++++`)

Piped the output through `sed` to colorize the trits (`o` = green, `+` = white, `-` = red) so it generates a neat cellular automaton history grid in the terminal as it collapses down to 1.

The photos are seeds of 100, 2^(31) -1, and 27 respectively

Just a cool toy. Let me know what you think or if anyone else has messed with block decomposition for base-3 halving.

u/Mysterious-Insect858 — 9 days ago
▲ 22 r/cellular_automata+4 crossposts

I Simulated Competition vs. Cooperation. Here’s What Happened

I used systems thinking to simulate what I believe makes the difference between a competitive and a cooperative environment. Worked 6 months on this project. Any feedback would be much appreciated.

youtube.com
u/paulcoman — 10 days ago

Made an 8-state 2D automaton generator in Excel

There's 512 possible rules to customize (plus the starting state and whether or not the sides loop), so most of these come at least from a starting point of randomly generating the ruleset. The large majority of them end up looking almost completely chaotic, but every once in a while there's a very interesting result.

u/monkeysky — 12 days ago