## 3-state range-1 outer-totalistic rulespace

For discussion of other cellular automata.
muzik
Posts: 3787
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### 3-state range-1 outer-totalistic rulespace

This is an obvious, but to my knowledge not thoroughly explored, extension of the familiar 2-state outer-totalistic rules which are frequently investigated.

The notation of a rulestring is as follows (subject to change, if anyone has any better suggestions reply with them):

BA(nn)/BB(nn)/TA(nn)/TB(nn)/SA(nn)/SB(nn)

where:
BA - conditions for a state-1 cell to be born
BB - conditions for a state-2 cell to be born
TA - conditions for a state-1 cell to become a state-2 cell
TB - conditions for a state-2 cell to become a state-1 cell
SA - conditions for a state-1 cell to stay alive
SB - conditions for a state-2 cell to stay alive

Conditions would be a string of two consecutive digits, with the first digit specifying how many neighbouring state-1 cells and the second digit specifying how many state-2 cells. The sum of the consecutive digits cannot exceed 8. A condition cannot be for both transitioning and surviving for a cell. For example, this would be the three-valued replicator rule (with a lot of transitions since that's how XOR rules work):

Code: Select all

``````x = 1, y = 1, rule = BA020508101316212432354043516270_BB01040712152023263134425053_TA01040712152023263134425053_TB020508101316212432354043516270_SA020508101316212432354043516270_SB01040712152023263134425053
A!``````
The notation can be extended to von Neumann and hexagonal neighbourhoods like with normal notation. As for the LtL/HROT notation, I'm not sure but it could use the usual HROT comma notation, with each two consecutive numbers being considered one transition.

This would allow for the transcription of a broad range of rules (3^27 if I'm not mistaken), but this is only the tip of the iceberg compared to the isotropic non-totalistic extensions to this rulespace I'm currently working on notating.
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

ivtb
Posts: 11
Joined: January 21st, 2018, 6:07 pm

### Re: 3-state range-1 outer-totalistic rulespace

Nice! I always thought we needed to explore more 3-state rules

I'm gonna try and make a python script that generates ruletrees for this kind of automaton

I think most transitions in are unnecessary since there is no way the outer sum of the cell is greater than 16 (8 state-2 cells)

Edit: Misunderstood your notation. I take back the comment
Last edited by ivtb on January 14th, 2020, 1:21 pm, edited 1 time in total.

Moosey
Posts: 3294
Joined: January 27th, 2019, 5:54 pm
Location: A house, or perhaps the OCA board. Or [click to not expand]
Contact:

### Re: 3-state range-1 outer-totalistic rulespace

Would this be the correct rulestring for deadlyenemies?

Code: Select all

``````x = 1, y = 1, rule = BA3021_BB0312_TA_TB_SA2030_SB0203
.A.\$2.A\$3A!``````
I am a prolific creator of many rather pathetic googological functions

My CA rules can be found here

Also, the tree game
Bill Watterson once wrote: "How do soldiers killing each other solve the world's problems?"

ivtb
Posts: 11
Joined: January 21st, 2018, 6:07 pm

### Re: 3-state range-1 outer-totalistic rulespace

Code: Select all

``````name = "BA010407101316_BB0205081114_TA0205081114_TB010407101316_SA010407101316_SB0205081114"
n_states = 3
n_neighbors = 8

transitions = sorted(name.split("_"))

BA = transitions[0][2:]
BB = transitions[1][2:]
SA = transitions[2][2:]
SB = transitions[3][2:]
TA = transitions[4][2:]
TB = transitions[5][2:]

def transition_function(a):

n = a[0]+a[1]+a[2]+a[3]+a[4]+a[5]+a[6]+a[7]

if a[8] == 0:

for i in range(len(BA) // 2):
if (n == int(BA[2*i:2*i + 2])):
return 1

for i in range(len(BB) // 2):
if (n == int(BB[2*i:2*i + 2])):
return 2

if a[8] == 1:

for i in range(len(TA) // 2):
if (n == int(TA[2*i:2*i + 2])):
return 2

for i in range(len(SA) // 2):
if (n == int(SA[2*i:2*i + 2])):
return 1

if a[8] == 2:

for i in range(len(TB) // 2):
if (n == int(TB[2*i:2*i + 2])):
return 1

for i in range(len(SB) // 2):
if (n == int(SB[2*i:2*i + 2])):
return 2
return 0``````

I misunderstood the OP and created a notation for a different class of automata, where the sum of all neighbors (with state 2 counting as 2 state 1 cells) determines each transition; each pair of digits represents one possible value for the sum. If less than 10 a leading zero is placed, ex: 09 instead of 9.

Here is a simple replicator rule in this notation

To explore other rules in this category just change "name", copy the code and run make-ruletree.py

ivtb
Posts: 11
Joined: January 21st, 2018, 6:07 pm

### Re: 3-state range-1 outer-totalistic rulespace

Code: Select all

``````name = "BA02050810131621243235404351627008_BB010407121520232631344250536180_TA010407121520232631344250536180_TB02050810131621243235404351627008_SA02050810131621243235404351627008_SB010407121520232631344250536180"

n_states = 3
n_neighbors = 8

transitions = sorted(name.split("_"))

BA = transitions[0][2:]
BB = transitions[1][2:]
SA = transitions[2][2:]
SB = transitions[3][2:]
TA = transitions[4][2:]
TB = transitions[5][2:]

def transition_function(a):

ones = 0
twos = 0

for i in range(8):
if a[i] == 1:
ones += 1
if a[i] == 2:
twos += 1

if a[8] == 0:

for i in range(len(BA) // 2):
if (ones == int(BA[2*i]) and twos == int(BA[2*i + 1])):
return 1

for i in range(len(BB) // 2):
if (ones == int(BB[2*i]) and twos == int(BB[2*i + 1])):
return 2

if a[8] == 1:

for i in range(len(TA) // 2):
if (ones == int(TA[2*i]) and twos == int(TA[2*i + 1])):
return 2

for i in range(len(SA) // 2):
if (ones == int(SA[2*i]) and twos == int(SA[2*i + 1])):
return 1

if a[8] == 2:

for i in range(len(TB) // 2):
if (ones == int(TB[2*i]) and twos == int(TB[2*i + 1])):
return 1

for i in range(len(SB) // 2):
if (ones == int(SB[2*i]) and twos == int(SB[2*i + 1])):
return 2
return 0``````
Now it's implemented correctly. The rule is your replicator rule with a small correction. Again, just change the rule name and run make-ruletree.py with the code in clipboard

muzik
Posts: 3787
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: 3-state range-1 outer-totalistic rulespace

dvgrn, on the discord, wrote:
December 31st, 1969, 8:11 pm
Maybe the "T" transitions should be "TAB" and "TBA"? -- just because the notation as you describe it doesn't extend cleanly to four or more states, but if you specified both the "from" and "to" states after "T" then it would... up to twenty-six states, theoretically, but the rule strings might get too unwieldy well before then.
(But then the syntax might be simplified by using "Z" as the zero state, so there's always a "from" state and a "to" state listed and you wouldn't need B and S for "birth" and "survival".)
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

muzik
Posts: 3787
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: 3-state range-1 outer-totalistic rulespace

Currently in the process of developing a notation for isotropic non-totalistic 3-state rules:

I've also noticed that the BSFKL rulespace also seems to be a subset of the 3-state outer-totalistic rulespace, so software support for the latter might be a higher priority.

Also, something that could be handy: how about a script that converts an applicable ruletable into outer-totalistic 3-state notation? There's quite a few such rules.
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

ivtb
Posts: 11
Joined: January 21st, 2018, 6:07 pm

### Re: 3-state range-1 outer-totalistic rulespace

muzik wrote:
January 19th, 2020, 7:19 pm
Currently in the process of developing a notation for isotropic non-totalistic 3-state rules:

I've also noticed that the BSFKL rulespace also seems to be a subset of the 3-state outer-totalistic rulespace, so software support for the latter might be a higher priority.

Also, something that could be handy: how about a script that converts an applicable ruletable into outer-totalistic 3-state notation? There's quite a few such rules.
One way to automate this could involve running this pattern for 1 generation in code and adding correspondent transitions into the name string

Code: Select all

``````x = 81, y = 27, rule = 12/34/3
10.B2.B2.B2.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.11B\$4.
A2.B5.A2.B5.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB.3B.2BA5B.2BA4B\$38.B
2.B2.B.2B.2B.29B\$.A2.A2.A2.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.
AB.AB.AB.A2BA2BA2BAB\$4.A2.B5.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB.3B
.2BA5B.2BA4B\$29.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.
2A.2A.2A.2A.2A.2A.2AB2AB2AB2A\$4.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB
.3B.2BA5B.2BA4B\$20.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.
2A.2A.2A.2A.2AB2AB2AB2A\$2.A.2A.BA2.A.2A.BA2.A.2A.BA2.A.2A.BAB.AB2A2BA
B.AB2A2BA\$11.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2AB
2AB2AB2A\$2.A.2A.BA2.A.2A.BA2.A.2A.BAB.AB2A2BAB.AB2A2BA\$2.A2.A2.A.BA.B
A.BA2BA2BA2BA2BA2BA2BA2BA2BA2BA\$.2A.2A.2A.2A.2A.2A.2A.2A.2AB2AB2AB2A\$
2.A.2A.BA2.A.2A.BAB.AB2A2BAB.AB2A2BA\$.2A.2A.2AB2AB2AB2AB2AB2AB2AB2AB
2AB2A\$.2A.2A.2A.2A.2A.2AB2AB2AB2A\$2.A.2A.BAB.AB2A2BAB.AB2A2BA\$27A\$.2A
.2A.2AB2AB2AB2A\$A.5AB2A.5ABA\$18A\$9A\$A.5ABA\$9A!
``````
I tried but something is wrong with my code and I can't make it work using golly.parse and golly.evolve

Up-down dimension is the amount of state-1 cells; Left-right within a group of 3 is center cell state, and between groups of three the amount of state-2 cells

ivtb
Posts: 11
Joined: January 21st, 2018, 6:07 pm

### Re: 3-state range-1 outer-totalistic rulespace

muzik wrote:
January 19th, 2020, 7:19 pm
Also, something that could be handy: how about a script that converts an applicable ruletable into outer-totalistic 3-state notation? There's quite a few such rules.
This python script names an outer-totalistic rule. Just set the current rule in golly to the rule you're inspecting, run the script and the rule name will be copied to the clipboard (Using BA/BB/TA/TB/SA/SB notation)

Code: Select all

``````from golly import *

start = parse('''10.B2.B2.B2.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.2B.11B\$4.
A2.B5.A2.B5.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB.3B.2BA5B.2BA4B\$38.B
2.B2.B.2B.2B.29B\$.A2.A2.A2.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.AB.
AB.AB.AB.A2BA2BA2BAB\$4.A2.B5.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB.3B
.2BA5B.2BA4B\$29.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.
2A.2A.2A.2A.2A.2A.2AB2AB2AB2A\$4.A2.B3.B.AB.2B2.B.AB.2B2.B.AB.2B2.B.AB
.3B.2BA5B.2BA4B\$20.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.
2A.2A.2A.2A.2AB2AB2AB2A\$2.A.2A.BA2.A.2A.BA2.A.2A.BA2.A.2A.BAB.AB2A2BA
B.AB2A2BA\$11.B2.B2.B.2B.2B.29B\$.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2A.2AB
2AB2AB2A\$2.A.2A.BA2.A.2A.BA2.A.2A.BAB.AB2A2BAB.AB2A2BA\$2.A2.A2.A.BA.B
A.BA2BA2BA2BA2BA2BA2BA2BA2BA2BA\$.2A.2A.2A.2A.2A.2A.2A.2A.2AB2AB2AB2A\$
2.A.2A.BA2.A.2A.BAB.AB2A2BAB.AB2A2BA\$.2A.2A.2AB2AB2AB2AB2AB2AB2AB2AB
2AB2A\$.2A.2A.2A.2A.2A.2AB2AB2AB2A\$2.A.2A.BAB.AB2A2BAB.AB2A2BA\$27A\$.2A
.2A.2AB2AB2AB2A\$A.5AB2A.5ABA\$18A\$9A\$A.5ABA\$9A!''')

result = evolve(start,1)

def mygetcell(x,y):
for i in range(len(result) // 3):
if (x==result[3*i]) and (y==result[3*i + 1]):
return result[3*i + 2]
return 0

transitions = []

for s in range(3):
for i in range(9):
for j in range(9 - i):
transitions.append((j,i,s,mygetcell(1+9*i+3*s,1+3*j)))

form = [ [x for x in transitions if x[2] == 0 and x[3] == 1] , [x for x in transitions if x[2] == 0 and x[3] == 2],\
[x for x in transitions if x[2] == 1 and x[3] == 2],[x for x in transitions if x[2] == 2 and x[3] == 1], \
[x for x in transitions if x[2] == 1 and x[3] == 1], [x for x in transitions if x[2] == 2 and x[3] == 2]]

flist = [[],[],[],[],[],[]]
slist = [[],[],[],[],[],[]]
fstr = ["","","","","",""]

for j in range(6):
for i in form[j]:
flist[j].append(str(i[0]) + str(i[1]))

for j in range(6):
slist[j] = sorted(flist[j])
for i in slist[j]:
fstr[j] += i

setclipstr("BA" + fstr[0] + "_BB" + fstr[1] + "_TA" + fstr[2] + "_TB" + fstr[3] + "_SA" + fstr[4] + "_SB" + fstr[5])``````

I ran this script with the generations 12/34/3 rule and it gave me "BA3031323334354041424344_BB_TA000102030405060708303132333435404142434450515253606162707180_TB_SA101112131415161720212223242526_SB"

Using my other script I compiled this into a ruletree:

Code: Select all

``````name = "BA3031323334354041424344_BB_TA000102030405060708303132333435404142434450515253606162707180_TB_SA101112131415161720212223242526_SB"

n_states = 3
n_neighbors = 8

transitions = sorted(name.split("_"))

BA = transitions[0][2:]
BB = transitions[1][2:]
SA = transitions[2][2:]
SB = transitions[3][2:]
TA = transitions[4][2:]
TB = transitions[5][2:]

def transition_function(a):

ones = 0
twos = 0

for i in range(8):
if a[i] == 1:
ones += 1
if a[i] == 2:
twos += 1

if a[8] == 0:

for i in range(len(BA) // 2):
if (ones == int(BA[2*i]) and twos == int(BA[2*i + 1])):
return 1

for i in range(len(BB) // 2):
if (ones == int(BB[2*i]) and twos == int(BB[2*i + 1])):
return 2

if a[8] == 1:

for i in range(len(TA) // 2):
if (ones == int(TA[2*i]) and twos == int(TA[2*i + 1])):
return 2

for i in range(len(SA) // 2):
if (ones == int(SA[2*i]) and twos == int(SA[2*i + 1])):
return 1

if a[8] == 2:

for i in range(len(TB) // 2):
if (ones == int(TB[2*i]) and twos == int(TB[2*i + 1])):
return 1

for i in range(len(SB) // 2):
if (ones == int(SB[2*i]) and twos == int(SB[2*i + 1])):
return 2
return 0``````
And it works exactly like the original 12/34/3 rule

muzik
Posts: 3787
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: 3-state range-1 outer-totalistic rulespace

It should theoretically be easy to generalize this notation up to higher state counts, if we account for all different transitions between cell states. The transitions are as follows:

- 2-state - one alive state - birth of state 1, survival of state 1
- 3-state - two alive states - birth of state 1, birth of state 2, state 2 to state 1, state 1 to state 2, survival of state 1, survival of state 2
- 4-state - three alive states - birth of state 1, birth of state 2, birth of state 3, state 1 to state 2, state 1 to state 3, state 2 to state 3, state 2 to state 1, state 3 to state 1, state 3 to state 2, survival of state 1, survival of state 2, survival of state 3

Beyond 4-state (or arguably 3-state) rules, it does appear to get quite unwieldy with the notation though (especially considering one transition would need four or three digits), so I'd say we're best sticking with outer-totalistic 3-state rules for right now. But to future-proof, it seems best if we heed dave's advice and define more clearly our transition types.

A proposal for the new notation, with only minimal changes:
BA(state 1 birth conditions)/BB(state 2 birth conditions)/TAB(state 1 to 2 transitions)/TBA(state 2 to 1 transitions)/SA(state 1 survival conditions)/SB(state 2 birth conditions)

It may also be worth negating transitions if strings get too long, like with Hensel notation.

I also had a thought about what would happen if, say, a birth condition for state 1 ended up being identical to a birth condition for state 2. How would this end up being handled? I can't think of a good analogy that exists in the 2-state case. Should we simply invalidate such rulestrings, or could another notation which is still human-readable be invented that doesn't have these cases at all?
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!

muzik
Posts: 3787
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

### Re: 3-state range-1 outer-totalistic rulespace

Here are the 3-state equivalents of the block CA found in 2x2:

Code: Select all

``````x = 268, y = 2, rule = marg3
2A2.4A2.6A2.8A2.10A2.12A2.14A2.16A2.18A2.20A2.22A2.24A2.26A2.28A2.30A
\$2A2.4A2.6A2.8A2.10A2.12A2.14A2.16A2.18A2.20A2.22A2.24A2.26A2.28A2.
30A!``````
Currently working on the rule so that any arrangement of blocks can work. Sometimes it breaks down with more complex ones but we can see the gist of the effects here.

Comparison to 2 state:

Code: Select all

``````x = 268, y = 2, rule = B3/S5
2o2b4o2b6o2b8o2b10o2b12o2b14o2b16o2b18o2b20o2b22o2b24o2b26o2b28o2b30o\$
2o2b4o2b6o2b8o2b10o2b12o2b14o2b16o2b18o2b20o2b22o2b24o2b26o2b28o2b30o!``````
Some squares, p4n 4nx4n:

Code: Select all

`````` x = 40, y = 12, rule = marg3
28.12A\$28.12A\$10.8A10.12A\$10.8A10.12A\$4A6.8A10.12A\$4A6.8A10.12A\$4A6.
8A10.12A\$4A6.8A10.12A\$10.8A10.12A\$10.8A10.12A\$28.12A\$28.12A!``````
Bored of using the Moore neighbourhood for everything? Introducing the Range-2 von Neumann isotropic non-totalistic rulespace!