I need help with a rule table, please.

For general discussion about Conway's Game of Life.
Post Reply
User avatar
iconmaster
Posts: 42
Joined: July 2nd, 2009, 7:22 pm

I need help with a rule table, please.

Post by iconmaster » July 22nd, 2009, 8:14 pm

I am bad at making tables, so I need help with this. Here are the rules.

There are 6 states: OFF,YELLOW,RED,BLUE,GREEN, and WHITE.

Birth rules:
If a cell is surrounded by 3 YELLOW cells, that cell becomes YELLOW.
If a cell is surrounded by 3 or 6 RED cells, that cell becomes RED.
If a cell is surrounded by 3, 6, or 8 BLUE cells, that cell becomes BLUE.
If a cell is surrounded by 3, 5, or 7 GREEN cells, that cell becomes GREEN.

Stablility rules:
If a YELLOW cell is not surrounded by 2 or 3 YELLOW cells, that cell becomes OFF.
If a RED cell is not surrounded by 1, 2, or 5 RED cells, that cell becomes OFF.
If a BLUE cell is not surrounded by 2, 4, or 5 BLUE cells, that cell becomes OFF.
If a GREEN cell is not surrounded by 1, 3, 5, or 8 GREEN cells, that cell becomes OFF.

Other rules:
If 2 birth rules apply to a cell, that cell becomes WHITE.
a WHITE cell will become OFF at the next generation.
an OFF cell will stay OFF.

H. V. McIntosh
Posts: 49
Joined: June 20th, 2009, 5:26 pm
Location: Mexico

Re: I need help with a rule table, please.

Post by H. V. McIntosh » July 23rd, 2009, 12:40 am

iconmaster wrote:I am bad at making tables, so I need help with this. Here are the rules. ..... .
Good or bad, this is going to end up being a huge rule table, depending on exactly what it is you want. Given six states, and presumably a Moore neighborhood, there will be 6^9 of them. For each, the table must state the new state of the central cell, according to the prescription laid out. Writing a program to fill in the table should not be hard; doing it by hand well nigh impossible. But once you have the table, what will you do with it? Table lookup would be quick, but using the program on demand to decide the evolution might not be that much slower and would evidently require less storage space.
-hvm

User avatar
calcyman
Moderator
Posts: 2938
Joined: June 1st, 2009, 4:32 pm

Re: I need help with a rule table, please.

Post by calcyman » July 23rd, 2009, 10:58 am

Good or bad, this is going to end up being a huge rule table, depending on exactly what it is you want.
Not using Golly's format of rule tables. They can be compressed by the use of variables and spatial symmetry.


The rule table is quite easy to construct, with the exception of the rule:

"If two birth rules apply to a cell, the cell becomes white", which is very difficult to implement.
What do you do with ill crystallographers? Take them to the mono-clinic!

User avatar
iconmaster
Posts: 42
Joined: July 2nd, 2009, 7:22 pm

Re: I need help with a rule table, please.

Post by iconmaster » July 23rd, 2009, 11:10 am

Would it still work without that rule?

User avatar
calcyman
Moderator
Posts: 2938
Joined: June 1st, 2009, 4:32 pm

Re: I need help with a rule table, please.

Post by calcyman » July 23rd, 2009, 11:18 am

Would it still work without that rule?

You tell me. All rule tables 'work' as valid cellular automata. It depends whether it's sufficient for your needs.

Is that rule arbitrary, or is there a motive for doing it? It looks like you've tried to unify Life, B36/S125, B368/S245 and B357/S1358.


Final question: Do the birth rules only apply to OFF cells, or all cells?
What do you do with ill crystallographers? Take them to the mono-clinic!

User avatar
iconmaster
Posts: 42
Joined: July 2nd, 2009, 7:22 pm

Re: I need help with a rule table, please.

Post by iconmaster » July 23rd, 2009, 11:19 am

It applys to all cells. And I think it can go without white.

And yes, I am unifying rules. I want to see if two rules can "coexist" and form new shapes, among other things.

User avatar
calcyman
Moderator
Posts: 2938
Joined: June 1st, 2009, 4:32 pm

Re: I need help with a rule table, please.

Post by calcyman » July 24th, 2009, 10:59 am

Should the [yellow] birth rule also apply to cells that are already [yellow]? If so, then it doesn't correctly unify rules.


Here's the table assuming that is not the case:

Code: Select all

n_states:5
neighborhood:Moore
symmetries:rotate8reflect

# yellow = 1
# red = 2
# blue = 3
# green = 4

var a={0,1,2,3,4}
var b={0,1,2,3,4}
var c={0,1,2,3,4}
var d={0,1,2,3,4}
var e={0,1,2,3,4}
var f={0,1,2,3,4}
var g={0,1,2,3,4}
var h={0,1,2,3,4}
var i={0,1,2,3,4}

var ya={0,2,3,4}
var yb={0,2,3,4}
var yc={0,2,3,4}
var yd={0,2,3,4}
var ye={0,2,3,4}
var yf={0,2,3,4}
var yg={0,2,3,4}
var yh={0,2,3,4}
var yi={0,2,3,4}

var ra={0,1,3,4}
var rb={0,1,3,4}
var rc={0,1,3,4}
var rd={0,1,3,4}
var re={0,1,3,4}
var rf={0,1,3,4}
var rg={0,1,3,4}
var rh={0,1,3,4}
var ri={0,1,3,4}

var ba={0,1,2,4}
var bb={0,1,2,4}
var bc={0,1,2,4}
var bd={0,1,2,4}
var be={0,1,2,4}
var bf={0,1,2,4}
var bg={0,1,2,4}
var bh={0,1,2,4}
var bi={0,1,2,4}

var ga={0,1,2,3}
var gb={0,1,2,3}
var gc={0,1,2,3}
var gd={0,1,2,3}
var ge={0,1,2,3}
var gf={0,1,2,3}
var gg={0,1,2,3}
var gh={0,1,2,3}
var gi={0,1,2,3}



# birth rules

yi,1,1,1,ya,yb,yc,yd,ye,1
yi,1,1,ya,1,yb,yc,yd,ye,1
yi,1,1,ya,yb,1,yc,yd,ye,1
yi,1,ya,1,yb,1,yc,yd,ye,1
yi,1,ya,1,yb,yc,1,yd,ye,1



ri,2,2,2,ra,rb,rc,rd,re,2
ri,2,2,ra,2,rb,rc,rd,re,2
ri,2,2,ra,rb,2,rc,rd,re,2
ri,2,ra,2,rb,2,rc,rd,re,2
ri,2,ra,2,rb,rc,2,rd,re,2

ri,ra,rb,2,2,2,2,2,2,2
ri,ra,2,rb,2,2,2,2,2,2
ri,ra,2,2,rb,2,2,2,2,2
ri,ra,2,2,2,rb,2,2,2,2



bi,3,3,3,ba,bb,bc,bd,be,3
bi,3,3,ba,3,bb,bc,bd,be,3
bi,3,3,ba,bb,3,bc,bd,be,3
bi,3,ba,3,bb,3,bc,bd,be,3
bi,3,ba,3,bb,bc,3,bd,be,3

bi,ba,bb,3,3,3,3,3,3,3
bi,ba,3,bb,3,3,3,3,3,3
bi,ba,3,3,bb,3,3,3,3,3
bi,ba,3,3,3,bb,3,3,3,3

bi,3,3,3,3,3,3,3,3,3



gi,4,4,4,ga,gb,gc,gd,ge,4
gi,4,4,ga,4,gb,gc,gd,ge,4
gi,4,4,ga,gb,4,gc,gd,ge,4
gi,4,ga,4,gb,4,gc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,gd,ge,gf,gg,4

4,4,4,4,ga,gb,gc,gd,ge,4
4,4,4,ga,4,gb,gc,gd,ge,4
4,4,4,ga,gb,4,gc,gd,ge,4
4,4,ga,4,gb,4,gc,gd,ge,4
4,4,ga,4,gb,gc,4,gd,ge,4

4,4,4,4,4,4,ga,gb,gc,4
4,4,4,4,4,ga,4,gb,gc,4
4,4,4,4,ga,4,4,gb,gc,4
4,4,4,ga,4,gb,4,gc,4,4
4,ga,4,4,gb,4,4,gc,4,4

4,4,4,4,4,4,4,4,4,4

a,b,c,d,e,f,g,h,i,0
What do you do with ill crystallographers? Take them to the mono-clinic!

User avatar
iconmaster
Posts: 42
Joined: July 2nd, 2009, 7:22 pm

Re: I need help with a rule table, please.

Post by iconmaster » July 24th, 2009, 8:30 pm

Thank you. I am very greatful.

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » August 9th, 2009, 3:15 pm

How can I implement the following one-dimensional rule in Golly?
I have played with this rule a lot on an Amiga computer before and it is quite interesting.

Each cell has one of four possible states: 00,01,10,11
Each cell has two neighbors: Left and Right
The rule is a ten-digit base-4 number representing a lookup table:
The sum of the states of a cell and its two neighbors is a number 0-9 decimal.
Use the sum as an index into the 10-digit rule (Lookup table).
The result of the lookup is the next state of the center cell.

Display each new generation as a horizontal line just below the current generation, just like Wolfram's one-dimensional automata displays in Golly.
Colors to represent states: 00 = black, 01= blue, 10=yellow, 11=red

You will be changing the 10-digit rule often to experiment, by the way, so hopefully that is easily done.
The rule itself is what produces interesting results, The starting pattern can be random.

Is it even possible to do this with Golly?

H. V. McIntosh
Posts: 49
Joined: June 20th, 2009, 5:26 pm
Location: Mexico

Re: I need help with a rule table, please.

Post by H. V. McIntosh » August 9th, 2009, 7:53 pm

knightlife wrote: ..... Is it even possible to do this with Golly?
Golly is pretty versatile, so one supposes that it can be done. As in someone's question from a couple of weeks ago, this seems to be a question of how to use Golly, which someone else will have to explain. However, the proposed automation is a (4,1) automaton by Wolfram's reckoning, with 64 neighborhoods and 2^24 or about 10^8 rules in the table; this may actually require a ten digit decimal number. My comment is: why convert to decimal, why not use base 4 directly, which is hexadecimal? With that it is easier to relate the numbers to the behavior of the automaton. We've had a program NXLCAU41 which plays with these automata and yes, you can make some nice rules, even ones apparently lying in class 4. If I'm not mistaken there was even a magazine article about one of them, 3BD24, quite a while ago.

*edit* the article was: Kenneth E. Perry, ``Abstract mathematical art,'' Byte, vol. 11, no. 13 (December 1986), pp. 181-192.
Last edited by H. V. McIntosh on August 10th, 2009, 12:54 am, edited 1 time in total.
-hvm

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » August 9th, 2009, 9:23 pm

H. V. McIntosh wrote:64 neighborhoods and 2^24 or about 10^8 rules in the table
The table is just ten 2-bit numbers or 20 bits. So there are 2^20 or 1,048,576 possible rules. Still, one million is a lot to experiment with. I agree Golly is versatile with the rule tables, but I guess the question boils down to:

Is there a provision in Golly for 1-dimensional automata to display the next generation on the next horizontal line, the same as the built in Wolfram rules?
Or, will the automata always update in place as with all the 2-dimensional automata Golly supports?

This makes quite a difference in the appeal of viewing 1-dimensional automata. I suppose I can write a Golly script since performance is not as much of an issue with 1-dimensional computation (i.e. a smaller universe, perhaps 10000 x 1 would suffice).

H. V. McIntosh
Posts: 49
Joined: June 20th, 2009, 5:26 pm
Location: Mexico

Re: I need help with a rule table, please.

Post by H. V. McIntosh » August 10th, 2009, 12:03 am

knightlife wrote: ..... Is there a provision in Golly for 1-dimensional automata to display the next generation on the next horizontal line .....
A technique we used to use on the two-dimensional CAM/PC was to trick it by introducing a marker (essentially doubling the state space) showing the active line. Then the rule in the Moore neighborhood was that no matter what, put the cell to sleep. Except that if the top row was awake, read it (time runs downward) and apply the selected rule to get a wakened state for the middle row, which is where the cells to be updated sit. A new line appears for each step of two-dimensional evolution. To start, clear the arena to sleeping zero or whatever, with a wakened line as the initial configuration of the one-dimensional automaton. Of course clearing is not necessary, given that the good evolution overwrites the trashy background.
-hvm

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » August 10th, 2009, 2:49 am

H. V. McIntosh wrote:Except that if the top row was awake, read it (time runs downward)
After some thought I solved the issue just as you say, considering a two dimensional automata with only the top row of 3 cells contributing to the result in the center. Golly can easily clear the screen for the next initial pattern. One requirement would be to produce a state "00" result if the top row is all "00"'s in order to produce the desired effect of a new line for each generation and maintaining a black ("00") background. Of course the entire 2D field is being updated redundantly each generation except for the line below the last active line, but I am sure the performance using this method would be quite a bit higher than using a script file (which may not have access to colors either).

Thanks for your insight into the matter.

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » August 11th, 2009, 7:08 am

knightlife wrote:Each cell has one of four possible states: 00,01,10,11
Each cell has two neighbors: Left and Right
The rule is a ten-digit base-4 number representing a lookup table:
The sum of the states of a cell and its two neighbors is a number 0-9 decimal.
Use the sum as an index into the 10-digit rule (Lookup table).
The result of the lookup is the next state of the center cell.

Display each new generation as a horizontal line just below the current generation, just like Wolfram's one-dimensional automata displays in Golly.
Colors to represent states: 00 = black, 01= blue, 10=yellow, 11=red
I was able to get this to work using a 2D rule table although it was a little tricky. One file can only implement one ten digit rule and it is not simple to change. At least it is easy to clear the field and try a new random starting pattern. I will post some examples when I find some interesting 1D rules.

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » September 5th, 2009, 8:30 am

knightlife wrote:I will post some examples when I find some interesting 1D rules
One dimensional life is a little off topic but I will post one rule table example:

Code: Select all

# filename: ONE_D.table
# 1D 4-state totalistic CA with range = 1
#
# Golly rule-table format.
# Each rule: C,N,NE,E,SE,S,SW,W,NW,C'
#
# Default for transitions not listed: no change
# (note that the first transition rule could be omitted since
# the center cell "f" remains unchaged)
#
# Variables are bound within each transition. 
# For example, if a={1,2} then 4,a,0->a represents
# two transitions: 4,1,0->1 and 4,2,0->2
#
# symmetry strings:
#{"none","rotate4","rotate8","reflect","rotate4reflect","rotate8reflect"}
#

n_states:4
neighborhood:Moore
symmetries:none
var a={0,1,2,3}
var b={0,1,2,3}
var c={0,1,2,3}
var d={0,1,2,3}
var e={0,1,2,3}
var f={0,1,2,3}

# 0123456789 = use (top row) sum 0-9 as index
# 0310202211 = rule (base-4 lookup table) first digit must be zero.
#
# this first transition rule keeps top row alive without adding more states.
# center cell "f" is unchanged if top row are all zeros (black):
f,0,0,a,b,c,d,e,0,f #0 sum is zero, 10-digit rule must start with zero.

# the 63 other possible neighborhoods:
# the sum of the top row of states is shown as a comment
f,0,0,a,b,c,d,e,1,3 #1
f,0,0,a,b,c,d,e,2,1 #2
f,0,0,a,b,c,d,e,3,0 #3
f,0,1,a,b,c,d,e,0,3 #1
f,0,1,a,b,c,d,e,1,1 #2
f,0,1,a,b,c,d,e,2,0 #3
f,0,1,a,b,c,d,e,3,2 #4
f,0,2,a,b,c,d,e,0,1 #2
f,0,2,a,b,c,d,e,1,0 #3
f,0,2,a,b,c,d,e,2,2 #4
f,0,2,a,b,c,d,e,3,0 #5
f,0,3,a,b,c,d,e,0,0 #3
f,0,3,a,b,c,d,e,1,2 #4
f,0,3,a,b,c,d,e,2,0 #5
f,0,3,a,b,c,d,e,3,2 #6
f,1,0,a,b,c,d,e,0,3 #1
f,1,0,a,b,c,d,e,1,1 #2
f,1,0,a,b,c,d,e,2,0 #3
f,1,0,a,b,c,d,e,3,2 #4
f,1,1,a,b,c,d,e,0,1 #2
f,1,1,a,b,c,d,e,1,0 #3
f,1,1,a,b,c,d,e,2,2 #4
f,1,1,a,b,c,d,e,3,0 #5
f,1,2,a,b,c,d,e,0,0 #3
f,1,2,a,b,c,d,e,1,2 #4
f,1,2,a,b,c,d,e,2,0 #5
f,1,2,a,b,c,d,e,3,2 #6
f,1,3,a,b,c,d,e,0,2 #4
f,1,3,a,b,c,d,e,1,0 #5
f,1,3,a,b,c,d,e,2,2 #6
f,1,3,a,b,c,d,e,3,1 #7
f,2,0,a,b,c,d,e,0,1 #2
f,2,0,a,b,c,d,e,1,0 #3
f,2,0,a,b,c,d,e,2,2 #4
f,2,0,a,b,c,d,e,3,0 #5
f,2,1,a,b,c,d,e,0,0 #3
f,2,1,a,b,c,d,e,1,2 #4
f,2,1,a,b,c,d,e,2,0 #5
f,2,1,a,b,c,d,e,3,2 #6
f,2,2,a,b,c,d,e,0,2 #4
f,2,2,a,b,c,d,e,1,0 #5
f,2,2,a,b,c,d,e,2,2 #6
f,2,2,a,b,c,d,e,3,1 #7
f,2,3,a,b,c,d,e,0,0 #5
f,2,3,a,b,c,d,e,1,2 #6
f,2,3,a,b,c,d,e,2,1 #7
f,2,3,a,b,c,d,e,3,1 #8
f,3,0,a,b,c,d,e,0,0 #3
f,3,0,a,b,c,d,e,1,2 #4
f,3,0,a,b,c,d,e,2,0 #5
f,3,0,a,b,c,d,e,3,2 #6
f,3,1,a,b,c,d,e,0,2 #4
f,3,1,a,b,c,d,e,1,0 #5
f,3,1,a,b,c,d,e,2,2 #6
f,3,1,a,b,c,d,e,3,1 #7
f,3,2,a,b,c,d,e,0,0 #5
f,3,2,a,b,c,d,e,1,2 #6
f,3,2,a,b,c,d,e,2,1 #7
f,3,2,a,b,c,d,e,3,1 #8
f,3,3,a,b,c,d,e,0,2 #6
f,3,3,a,b,c,d,e,1,1 #7
f,3,3,a,b,c,d,e,2,1 #8
f,3,3,a,b,c,d,e,3,1 #9 sum is 9, only possible if top row is 3,3,3 (all are state 3)

four colors defined:

Code: Select all

# filename: ONE_D.colors

color=1   0 128 255     light blue
color=2 255 255   0     yellow
color=3 255   0   0     red
Save the two files in the "Rules" directory under Golly 2.0 and call out the "ONE_D" rule after starting Golly.
Then make a long horizontal line with random states to start (use random fill).
Use the spacebar to generate new lines. You should see an interesting growing pattern. Now run it for 1000 generations.
The one dimensional rule creates a two-dimensional pattern line by line but Golly is actually recalculating each cell every time.
It is best to start with a cleared screen because this rule depends on the background state to preserve the initial pattlern.
It would be "better" to have an eight-state rule using four states for just the initial pattern and four states for the following generations.
But this complicates pretty much everything...

It is tedious to change the rule, but search and replace can help a lot. For example to change what happens when the top row sum is 8, search and replace "0 #8" with "x #8" where x is the new value you want for the resulting state of the center cell when the top row is (3,3,2), (3,2,3), or (2,3,3).
If you try to change the rule you will quickly find that most rules either die quickly or explode in an uninteresting way.

Does anyone know of websites that have a 1D cellular automata forum that is currently active?

H. V. McIntosh
Posts: 49
Joined: June 20th, 2009, 5:26 pm
Location: Mexico

Re: I need help with a rule table, please.

Post by H. V. McIntosh » September 5th, 2009, 5:46 pm

knightlife wrote:Does anyone know of websites that have a 1D cellular automata forum that is currently active?
So far as I know, this activity has mostly died out. However, much of the previous discussion has been archived and may still contain interesting commentary. Have you looked over Perry's Hundred? I may still have the list if you don't find it on the Internet. Multistate automata offer interesting possibilities which are not available in binary automata, such as the Greenberg-Hastings rules or the Belousov-Zhabotinsky reactions.
-hvm

knightlife
Posts: 566
Joined: May 31st, 2009, 12:08 am

Re: I need help with a rule table, please.

Post by knightlife » September 6th, 2009, 1:51 pm

H. V. McIntosh wrote:Have you looked over Perry's Hundred?
I believe I have, back in 1986! I probably still have that December issue of Byte magazine also. It inspired me to investigate further using the Amiga's bit-blitter, but Conway's life continues to intrigue.

Post Reply