Thread for basic questions

For general discussion about Conway's Game of Life.
User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 19th, 2017, 10:44 pm

Tom Mazanec wrote:
Majestas32 wrote:Somebody did experiments and it turned out to be 37.5% for Life. For Highlife or 2x2 and related it's more like 40%
I suspect that the somebody tried 20 densities from 25% to 75%.
It's a little more complicated -- Achim Flammenkamp did one of those surveys, back in 2003:
Achim Flammenkamp wrote:With the last parameter, there is also the question of what is a good initial
density out of the values from the closed interval [0,1].

Because of the special game of life rules, seed densities in the interval ]0,a[ are decreasing, ]a,b[ are increasing and in ]b,1[ are again decreasing, using the magical constants a= ~0.192469 and b= ~0.370174.

And I have the very strong fe[e]ling (supported by experiments) that also the initial density of b results in the highest final ash density!

Thus this b is a remarkable significant density value. This was also the reason that if I give no initial density to my program, it chooses 96/256=0.375 as the inital density (well, 95/256 would be a slightly better approximation of 0.370174).
Here, "increasing" just means that the population at T=1 is higher on average than at T=0, and "decreasing" means that the T=1 population goes down on average.

User avatar
praosylen
Posts: 2443
Joined: September 13th, 2014, 5:36 pm
Location: Pembina University, Home of the Gliders
Contact:

Re: Thread for basic questions

Post by praosylen » December 20th, 2017, 12:03 am

dvgrn wrote:
gameoflifemaniac wrote:Are there any oscillators with these stators?

Code: Select all

....5x3 block, 5x4 block...
Definitely no for the 5x3 case. You can prove it either by logical analysis or by filling in all 2^15 possible patterns with a script -- no possible fill allows the stator to survive for more than a few ticks. For 5x4 I think the answer is also no, unless you count p1 oscillators:

Code: Select all

x = 14, y = 13, rule = B3/S23
7b2o$7b2o2$5b4o$4bo2bobo$bo2bo4bo2bo$obob2o2b2obobo$bo2bo4bo2bo$4bobo
2bo$5b4o2$5b2o$5b2o!
Here again, 2^20 is only a million patterns, so a script could be written to give a definite answer in a few minutes. Or you could maybe look for great-great-grandchildren with the same stator in JLS or WLS, but I'm not sure how that would work out exactly.
I wrote a program to search for these. It finds no results for all areas smaller (in width*height) than 5x5 except 3x3, 4x3, 4x4, and (odd N)x2, and the first p<2 oscillators it finds past 4x4 are these p4s at 5x7:

Code: Select all

x = 17, y = 31, rule = B3/S23
9b2o$7bo2bo$7b3o2$5b7o$4bo5bobo$bo2bo3b2o2bo2bo$obob3o2bob2obobo$bo2bo
3b2o2bo2bo$4bo5bobo$5b7o2$7b3o$7bo2bo$9b2o2$9b2o$7bo2bo$7b3o2$5b7o$4bo
3bo3bo$bo2bobo3bobo2bo$obobo2bobo2bobobo$bo2b2obobob2o2bo$4bo7bo$5b7o
2$7b3o$7bo2bo$9b2o!
Unfortunately, my computer runs out of memory past that point, so I won't be searching anything larger anytime soon.
former username: A for Awesome
praosylen#5847 (Discord)

The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 20th, 2017, 1:34 pm

Ok, I created a Lua script that looks for such oscillators:

Code: Select all

local g = golly()
while( true )
do
   g.reset()
   g.randfill(20)
   g.run(20)
   g.update()
   if tonumber(g.getwidth()) == 11 and tonumber(g.getheight()) == 12 
   then
      break
   end
end
It works, but even if it found and oscillator, it doesn't stop. What's going on?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
Tom Mazanec
Posts: 32
Joined: December 18th, 2017, 5:22 pm

Re: Thread for basic questions

Post by Tom Mazanec » December 21st, 2017, 10:20 am

dvgrn:
What are the formulae for calculating those "magic constants"?

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 21st, 2017, 12:56 pm

Tom Mazanec wrote:dvgrn:
What are the formulae for calculating those "magic constants"?
There's no formula, for sure. Those numbers are the result of a big statistics-collection project: for gradually increasing values of N, run random N%-fill soups for one tick each, and take the average of the T=1 densities for a lot of these random soups.

When you do that, you find that
-- for small percentages and large percentages, the T=1 average density is going to be smaller than the T=0 density.
-- for percentages in some middle range, the T=1 average density is bigger than the T=0 density.

(if I'm understanding Achim's notes correctly -- I haven't tried this myself, so I could be misinterpreting somehow.)

Achim's observation was that the upper end of that middle range seemed to produce the largest final ash density. I don't know if that's actually true or not. I'm not sure why it would necessarily be precisely true -- maybe it's just approximately true. At least, it would be hard to show statistically that the point of maximum ash density is precisely the same as the point of maximum T=1 density, to the six decimal places that Achim quoted!

The numbers might come out a little different for different initial soup sizes and/or different universe geometries.
E.g., the number might shift a bit depending on if the universe is a bounded torus, or if it has empty space around the edges. Presumably you wouldn't use the empty space in final density calculations, and maybe to be safe you'd just do the density measurement on a smaller central area.

I should also be clear that I don't know any more than I've said already, and maybe I actually know less than I've said! Quite possibly someone has done a statistical survey like Achim's more recently than 2003 -- I haven't necessarily been paying attention.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 21st, 2017, 1:01 pm

gameoflifemaniac wrote:Ok, I created a Lua script that looks for such oscillators:

Code: Select all

local g = golly()
while( true )
do
   g.reset()
   g.randfill(20)
   g.run(20)
   g.update()
   if tonumber(g.getwidth()) == 11 and tonumber(g.getheight()) == 12 
   then
      break
   end
end
It works, but even if it found and oscillator, it doesn't stop. What's going on?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
Tom Mazanec
Posts: 32
Joined: December 18th, 2017, 5:22 pm

Re: Thread for basic questions

Post by Tom Mazanec » December 21st, 2017, 1:04 pm

Majestas32 wrote:
Tom Mazanec wrote:Is there a sort of Idiot's Guide to Golly for Dummies? that would help a newbie like me download it to their system (Mac in my case), learn the notation, tips for finding good patterns, etc.?
Just click the download links. Then we have:

- Set Algorithm and Set Rule in the Control menu
- Next gen (Tab key)
- Hyperspeed (Control menu)
- Clear (Edit menu)
- Select an area; Ctrl-5 for random fill (Preferences - Edit for fill percentage)
- Ctrl-C and Ctrl-V work converting back and forth from RLE.

Tbh I prefer Lifeviewer's interface for a lot of things. I just use Golly for ruletables and huge patterns
Where can I get Lifeviewer?

User avatar
Majestas32
Posts: 549
Joined: November 20th, 2017, 12:22 pm
Location: 'Merica

Re: Thread for basic questions

Post by Majestas32 » December 21st, 2017, 1:48 pm

It just automagically appears when you enclose RLE inside <code></code> (replace the angle brackets with square brackets) tags on the forum. There is a standalone version but it's 3 years out of date.
Searching:
b2-a5k6n7cs12-i3ij4k5j8
b2-a3c7cs12-i

Currently looking for help searching these rules.

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 21st, 2017, 2:12 pm

gameoflifemaniac wrote:It works, but even if it found and oscillator, it doesn't stop. What's going on?
Your question is not very clear. What are you selecting before you start running this script? What else has to be in the universe that you _don't_ have selected?

Also, how do you know the script works, if it doesn't stop? If you put a g.note("Test") statement on the line before "break", do you see the note dialog pop up? Seems as if the break statement should stop the script, but only if the width and height match...

EDIT: Oh. Yes. g.getwidth() and g.getheight() are reporting the height of the universe, not the height of the current pattern in the universe. You probably want local x, y, wd, ht = table.unpack(g.getrect()) and then look at wd and ht.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 22nd, 2017, 8:11 am

dvgrn wrote:
gameoflifemaniac wrote:It works, but even if it found and oscillator, it doesn't stop. What's going on?
Your question is not very clear. What are you selecting before you start running this script? What else has to be in the universe that you _don't_ have selected?

Also, how do you know the script works, if it doesn't stop? If you put a g.note("Test") statement on the line before "break", do you see the note dialog pop up? Seems as if the break statement should stop the script, but only if the width and height match...

EDIT: Oh. Yes. g.getwidth() and g.getheight() are reporting the height of the universe, not the height of the current pattern in the universe. You probably want local x, y, wd, ht = table.unpack(g.getrect()) and then look at wd and ht.
Ok...

Code: Select all

local g = golly()
while( true )
do
   g.reset()
   g.randfill(20)
   g.run(20)
   g.update()
   local x, y, wd, ht = table.unpack(g.getrect())
   if wd ~= 11 and ht ~= 12 
   then
      break
   end
end
It stops, but it never shows an oscillator.
The initial state of the universe is the 3x4 oscillator, a selection in the stator's rectangle, and the x,y of the whole pattern's bounding box is 0,0.
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 22nd, 2017, 9:59 am

gameoflifemaniac wrote:

Code: Select all

...
   if wd ~= 11 and ht ~= 12 
...
It stops, but it never shows an oscillator.
The initial state of the universe is the 3x4 oscillator, a selection in the stator's rectangle, and the x,y of the whole pattern's bounding box is 0,0.
Your two =='s have mysteriously mutated into ~= since the last version, so you're telling Golly to always stop unless you get a good answer. Other than that, the code worked fine for me (found the p8 right away).

You might occasionally get a false positive result unless you improve your conditional, though. Any explosion that happens to be 11 cells wide and 12 cells high at T=20 will trigger a stop. You could check that x and y are the same as when you started, also.

Or you could "just" check that the whole g.getrect() table is the same as at T=0. Then the script automagically works for any stator and selection, with no hard-coded "11" and "12" numbers:

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.randfill(20)
      count=count+1
      if count == 100 then
         g.update()
         count=0
      end
   g.run(20)
   if Equal(r,g.getrect()) then
      break
   end
   g.reset()
end
Unfortunately Lua doesn't have a native way to compare all the items in two different lists so you have to add a comparison function -- which really takes more space than just collectiing x, y, wd, ht and comparing them to x2, y2, wd2, and ht2, but maybe it's a little cleaner anyway.

Another thing maybe worth mentioning is that g.update() is the most time-consuming thing that Golly has to do in this script. If you only update the application window every Nth test, as shown with the 'count' variable above, then Golly will be able to test many more configurations per second. Doesn't matter for 4x3, but it will get you results faster with larger experiments.

(-- If there are any results within reach, at least! For most rectangles that won't be the case.)

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 22nd, 2017, 11:03 am

dvgrn wrote:
gameoflifemaniac wrote:

Code: Select all

...
   if wd ~= 11 and ht ~= 12 
...
It stops, but it never shows an oscillator.
The initial state of the universe is the 3x4 oscillator, a selection in the stator's rectangle, and the x,y of the whole pattern's bounding box is 0,0.
Your two =='s have mysteriously mutated into ~= since the last version, so you're telling Golly to always stop unless you get a good answer. Other than that, the code worked fine for me (found the p8 right away).

You might occasionally get a false positive result unless you improve your conditional, though. Any explosion that happens to be 11 cells wide and 12 cells high at T=20 will trigger a stop. You could check that x and y are the same as when you started, also.

Or you could "just" check that the whole g.getrect() table is the same as at T=0. Then the script automagically works for any stator and selection, with no hard-coded "11" and "12" numbers:

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.randfill(20)
      count=count+1
      if count == 100 then
         g.update()
         count=0
      end
   g.run(20)
   if Equal(r,g.getrect()) then
      break
   end
   g.reset()
end
Unfortunately Lua doesn't have a native way to compare all the items in two different lists so you have to add a comparison function -- which really takes more space than just collectiing x, y, wd, ht and comparing them to x2, y2, wd2, and ht2, but maybe it's a little cleaner anyway.

Another thing maybe worth mentioning is that g.update() is the most time-consuming thing that Golly has to do in this script. If you only update the application window every Nth test, as shown with the 'count' variable above, then Golly will be able to test many more configurations per second. Doesn't matter for 4x3, but it will get you results faster with larger experiments.

(-- If there are any results within reach, at least! For most rectangles that won't be the case.)
Thank you very much! But most of the time it detects things like these:

Code: Select all

x = 15, y = 15, rule = B3/S23
7bo$6bobo$7bo4$bo5bo5bo$obo3bobo3bobo$bo5bo5bo4$7bo$6bobo$7bo!
Is there a way to fix it?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 22nd, 2017, 11:18 am

gameoflifemaniac wrote:Thank you very much! But most of the time it detects things like these:

Code: Select all

x = 15, y = 15, rule = B3/S23
7bo$6bobo$7bo4$bo5bo5bo$obo3bobo3bobo$bo5bo5bo4$7bo$6bobo$7bo!
Is there a way to fix it?
Sure, lots of ways. You could add a few more lines before the "break" to check the population and see if it's too low. Or start with clist = g.getcells(g.getrect()), and then add a loop to look through clist and make sure none of the original stator cells are missing.

Really above a certain size of rectangle, your randomized method of testing will stop being very efficient. And then slightly above that level a non-randomized method (trying all possible combinations of ON and OFF cells in binary-count order, let's say) will take too long to be practical... at which point you should try using WLS or JLS instead, to answer these questions and a lot more similar ones that don't involve simple rectangles.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 22nd, 2017, 11:20 am

dvgrn wrote:
gameoflifemaniac wrote:Thank you very much! But most of the time it detects things like these:

Code: Select all

x = 15, y = 15, rule = B3/S23
7bo$6bobo$7bo4$bo5bo5bo$obo3bobo3bobo$bo5bo5bo4$7bo$6bobo$7bo!
Is there a way to fix it?
Sure, lots of ways. You could add a few more lines before the "break" to check the population and see if it's too low. Or start with clist = g.getcells(g.getrect()), and then add a loop to look through clist and make sure none of the original stator cells are missing.

Really above a certain size of rectangle, your randomized method of testing will stop being very efficient. And then slightly above that level a non-randomized method (trying all possible combinations of ON and OFF cells in binary-count order, let's say) will take too long to be practical... at which point you should try using WLS or JLS instead, to answer these questions and a lot more similar ones that don't involve simple rectangles.

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.reset()
   g.randfill(20)
   local pop = g.getpop()
      count=count+1
      if count == 100 then
         count=0
      end
   g.run(100)
   if Equal(r,g.getrect()) and g.getpop() > pop then
      break
   end
   g.reset()
end
I modified the script so that it checks if the population after 100 gens is bigger or equal to the population of the stator. Will this work?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 22nd, 2017, 11:39 am

gameoflifemaniac wrote:I modified the script so that it checks if the population after 100 gens is bigger or equal to the population of the stator. Will this work?
Sometimes, sure. Not if you happen to get a big explosion. You can figure out other options if you think about it.

For example, you could paste the original stator pattern on top of your new evolved pattern, with the "XOR" option, and see if the population is reduced by the correct number. (If cells are missing, the population won't drop enough.)

Or you could clear the selection with g.clear(0) and then use the Equal() function again, to see if the evolved pattern still matches the original stator exactly.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 22nd, 2017, 12:56 pm

dvgrn wrote:
gameoflifemaniac wrote:I modified the script so that it checks if the population after 100 gens is bigger or equal to the population of the stator. Will this work?
Sometimes, sure. Not if you happen to get a big explosion. You can figure out other options if you think about it.

For example, you could paste the original stator pattern on top of your new evolved pattern, with the "XOR" option, and see if the population is reduced by the correct number. (If cells are missing, the population won't drop enough.)

Or you could clear the selection with g.clear(0) and then use the Equal() function again, to see if the evolved pattern still matches the original stator exactly.
Oh, it doesn't work. My latest version only detects still lifes.
EDIT: This script works! It reduces the probability of not detecting a billiard table thousands of times!

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.reset()
   pop = g.getpop()
   g.randfill(20)
      count=count+1
      if count == 100 then
         count=0
      end
   g.run(100)
   if Equal(r,g.getrect()) and g.getpop() >= pop then
      break
   end
   g.reset()
end
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 23rd, 2017, 1:39 pm

One last step. It would be good if the script avoided still lives.
This script shows how to do it, but it doesn't work anyway. Could you help me, Dave?

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.reset()
   pop = g.getpop()
   g.randfill(20)
      count=count+1
      if count == 100 then
         count=0
      end
   g.run(100)
   if Equal(r,g.getrect()) and g.getpop() >= pop then
      local cells = g.getcells(g.getrect())
      g.run(1)
      if not (g.getcells(g.getrect()) == cells) then
         break
      end
   end
   g.reset()
end
dvgrn wrote: Definitely no for the 5x3 case. You can prove it either by logical analysis or by filling in all 2^15 possible patterns with a script -- no possible fill allows the stator to survive for more than a few ticks. For 5x4 I think the answer is also no, unless you count p1 oscillators.
Wrong. 5x3 also has still lifes.
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 24th, 2017, 4:43 pm

gameoflifemaniac wrote:One last step. It would be good if the script avoided still lives.
This script shows how to do it, but it doesn't work anyway.
Haven't tried it, but it looks like the same problem that meant I had to add the Equal() comparison function. You can't compare a table to another table with ==, because it only checks if the reference pointer is the same. That is, a list is only == to itself, not to any other list even if it happens to have the same contents.

So just use Equal() again to compare g.getcells(g.getrect()) with cells.

You'll have to change Equal() slightly for a more accurate comparison. First check if the lengths are the same, and return false if they're not. Then only do the item-by-item comparison if the lengths are identical.
gameoflifemaniac wrote:Wrong. 5x3 also has still lifes.
Example?

User avatar
toroidalet
Posts: 1514
Joined: August 7th, 2016, 1:48 pm
Location: My computer
Contact:

Re: Thread for basic questions

Post by toroidalet » December 24th, 2017, 5:26 pm

dvgrn wrote:
gameoflifemaniac wrote:Wrong. 5x3 also has still lifes.
Example?

Code: Select all

x = 13, y = 13, rule = B3/S23
6bo$5bobo$6bo2$4b5o$2obobo3bob2o$bobo4b2obo$o2bobo3bo2bo$2o2b5o2b2o2$
6bo$5bobo$6bo!
Any sufficiently advanced software is indistinguishable from malice.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 24th, 2017, 5:55 pm

dvgrn wrote:
gameoflifemaniac wrote:One last step. It would be good if the script avoided still lives.
This script shows how to do it, but it doesn't work anyway.
Haven't tried it, but it looks like the same problem that meant I had to add the Equal() comparison function. You can't compare a table to another table with ==, because it only checks if the reference pointer is the same. That is, a list is only == to itself, not to any other list even if it happens to have the same contents.

So just use Equal() again to compare g.getcells(g.getrect()) with cells.

You'll have to change Equal() slightly for a more accurate comparison. First check if the lengths are the same, and return false if they're not. Then only do the item-by-item comparison if the lengths are identical.
gameoflifemaniac wrote:Wrong. 5x3 also has still lifes.
Example?

Code: Select all

local g = golly()

function Equal(tbl1,tbl2)
    for k,v in pairs(tbl1) do
        if (tbl2[k] ~= v) then
            return false
        end
    end
    return true
end

r=g.getrect()
count=0
while( true )
do
   g.reset()
   pop = g.getpop()
   g.randfill(20)
      count=count+1
      if count == 100 then
         count=0
      end
   g.run(100)
   if Equal(r,g.getrect()) and g.getpop() >= pop then
      local cells = g.getcells(g.getrect())
      g.run(1)
      if not (Equal(g.getcells(g.getrect()),cells)) then
         break
      end
   end
end
Thank you for building the script with me. Now it's complete!
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
gmc_nxtman
Posts: 1150
Joined: May 26th, 2015, 7:20 pm

Re: Thread for basic questions

Post by gmc_nxtman » December 25th, 2017, 5:45 am

Apologies for not necessarily being a "basic" question, but in the rule B2-a3-i/S01c, there exists a set of diagonal oscillators, the periods of which follow the following unusual sequence:

Code: Select all

6, 4, 14, 14, 12, 62, 4, 126, 28, 30, 30, 28, 1022, 24, 126, 124, 4094
I couldn't find it on OEIS, does anyone know about it?

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 25th, 2017, 11:32 am

What is this weird thing?

Oh, there is yet one more thing that must be fixed in the script. The script shows errors like 'Can't create pattermn file!'
Attachments
Zrzut ekranu (42).png
Zrzut ekranu (42).png (106.53 KiB) Viewed 8098 times
Last edited by gameoflifemaniac on December 25th, 2017, 11:34 am, edited 1 time in total.
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

User avatar
dvgrn
Moderator
Posts: 10610
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Thread for basic questions

Post by dvgrn » December 25th, 2017, 11:34 am

gmc_nxtman wrote:Apologies for not necessarily being a "basic" question, but in the rule B2-a3-i/S01c, there exists a set of diagonal oscillators, the periods of which follow the following unusual sequence:

Code: Select all

6, 4, 14, 14, 12, 62, 4, 126, 28, 30, 30, 28, 1022, 24, 126, 124, 4094
I couldn't find it on OEIS, does anyone know about it?
See https://oeis.org/A268754
and https://oeis.org/A160657
and maybe also this list stored on the Wolfram Cloud

-- but at least the last two lists have errors in them, different in each case.

The 18th and 47th terms in A160657 are too big by a factor of three -- in other words, the 2x2 oscillators in question return to their original position unusually quickly, skipping two thirds of the states that the general formula would seem to indicate are possible.

The simplest equivalent mechanism I've heard of that generates the same sequence of periods, is the behavior of a single ON cell in a bounded 1xN plane in B1/S.

When I try small diagonals in the rule you gave, I see

length 3: period 6
length 4: (period 4) [doesn't actually return to original diagonal-line state]
length 5: period 14
length 6: **dies**
length 7: period 14
length 8: (period 12) [doesn't return to original diagonal-line state]
length 9: period 62

Code: Select all

x = 69, y = 9, rule = B2-a3-i/S01c
o9bo9bo9bo9bo9bo9bo$bo9bo9bo9bo9bo9bo9bo$2bo9bo9bo9bo9bo9bo9bo$13bo9bo
9bo9bo9bo9bo$24bo9bo9bo9bo9bo$35bo9bo9bo9bo$46bo9bo9bo$57bo9bo$68bo!
So I think your list skips some cases, like length 6, that some of the other lists include -- and includes other cases, like the length 2^N lines, that are skipped in A160657. But it's really still pretty much the same phenomenon in a slightly different disguise.

Here are some half-baked notes I sent to Nathaniel a while back about the A160657 sequence -- slightly edited:
dvgrn wrote:It's certainly not the case that every period gets reduced if it's
divisible by three. The p126 oscillator is perfectly valid, with no
p41 subperiod. So what makes 524286 and 45812984490 so darn special?

Here's something weird: a Google search turned up the following
"Repetition-Periods" document on wolframcloud.com:

https://www.wolframcloud.com/objects/b2 ... 848a15dcf5

... the 6th, 10th, 14th, etc. values in the Rule=90 lookup table match A160657.

That's not the weird thing, though.

The 74th term is 524286, matching [A160657's] incorrect 18th term.

That's not the really weird thing.

The weird thing is that the 190th term in the Rule 90 series is 45812984490. That corresponds with [A160657]'s 47th term, which comes out to 137438953470... which can also be divided by three, to get 45812984490.

So... why would that Rule 90 Wolfram lookup table match [A160657's] calculated number for the first case but not the second?

User avatar
gmc_nxtman
Posts: 1150
Joined: May 26th, 2015, 7:20 pm

Re: Thread for basic questions

Post by gmc_nxtman » December 25th, 2017, 12:34 pm

Thanks for giving such a detailed response! It's pretty interesting that the sequence occurs in an almost-similar form, but not quite. I didn't know that there was already discussion about this particular sequence, I should've probably searched harder.

User avatar
gameoflifemaniac
Posts: 1242
Joined: January 22nd, 2017, 11:17 am
Location: There too

Re: Thread for basic questions

Post by gameoflifemaniac » December 25th, 2017, 5:29 pm

Is there a place where I can find awesome Life patterns?
I was so socially awkward in the past and it will haunt me for the rest of my life.

Code: Select all

b4o25bo$o29bo$b3o3b3o2bob2o2bob2o2bo3bobo$4bobo3bob2o2bob2o2bobo3bobo$
4bobo3bobo5bo5bo3bobo$o3bobo3bobo5bo6b4o$b3o3b3o2bo5bo9bobo$24b4o!

Post Reply