{"id":313,"date":"2012-09-17T12:20:35","date_gmt":"2012-09-17T17:20:35","guid":{"rendered":"https:\/\/blogs.mathworks.com\/cleve\/?p=313"},"modified":"2013-05-02T10:03:14","modified_gmt":"2013-05-02T15:03:14","slug":"game-of-life-part-3-sampler","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/cleve\/2012\/09\/17\/game-of-life-part-3-sampler\/","title":{"rendered":"Game of Life, Part 3, Sampler"},"content":{"rendered":"\r\n<!DOCTYPE html\r\n  PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\">\r\n<style type=\"text\/css\">\r\n\r\nh1 { font-size:18pt; }\r\nh2.titlebg { font-size:13pt; }\r\nh3 { color:#4A4F55; padding:0px; margin:5px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:11pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }\r\nh4 { color:#4A4F55; padding:0px; margin:0px 0px 5px; font-family:Arial, Helvetica, sans-serif; font-size:10pt; font-weight:bold; line-height:140%; border-bottom:1px solid #d6d4d4; display:block; }\r\n   \r\np { padding:0px; margin:0px 0px 20px; }\r\nimg { padding:0px; margin:0px 0px 20px; border:none; }\r\np img, pre img, tt img, li img { margin-bottom:0px; } \r\n\r\nul { padding:0px; margin:0px 0px 20px 23px; list-style:square; }\r\nul li { padding:0px; margin:0px 0px 7px 0px; background:none; }\r\nul li ul { padding:5px 0px 0px; margin:0px 0px 7px 23px; }\r\nul li ol li { list-style:decimal; }\r\nol { padding:0px; margin:0px 0px 20px 0px; list-style:decimal; }\r\nol li { padding:0px; margin:0px 0px 7px 23px; list-style-type:decimal; }\r\nol li ol { padding:5px 0px 0px; margin:0px 0px 7px 0px; }\r\nol li ol li { list-style-type:lower-alpha; }\r\nol li ul { padding-top:7px; }\r\nol li ul li { list-style:square; }\r\n\r\npre, tt, code { font-size:12px; }\r\npre { margin:0px 0px 20px; }\r\npre.error { color:red; }\r\npre.codeinput { padding:10px; border:1px solid #d3d3d3; background:#f7f7f7; }\r\npre.codeoutput { padding:10px 11px; margin:0px 0px 20px; color:#4c4c4c; }\r\n\r\n@media print { pre.codeinput, pre.codeoutput { word-wrap:break-word; width:100%; } }\r\n\r\nspan.keyword { color:#0000FF }\r\nspan.comment { color:#228B22 }\r\nspan.string { color:#A020F0 }\r\nspan.untermstring { color:#B20000 }\r\nspan.syscmd { color:#B28C00 }\r\n\r\n.footer { width:auto; padding:10px 0px; margin:25px 0px 0px; border-top:1px dotted #878787; font-size:0.8em; line-height:140%; font-style:italic; color:#878787; text-align:left; float:none; }\r\n.footer p { margin:0px; }\r\n\r\n  <\/style><div class=\"content\"><!--introduction--><p>The Game of Life.  A few more of my favorite populations.<\/p><!--\/introduction--><h3>Contents<\/h3><div><ul><li><a href=\"#65794522-eaf5-4a82-adea-e0123a88e6c2\">The R-pentomino<\/a><\/li><li><a href=\"#24b84320-d226-461c-bbbe-3c5375eec402\">Gliders by the Dozen<\/a><\/li><li><a href=\"#d3c2bf02-7b7e-4b7c-99fb-ae14e7cc9425\">Canada Goose<\/a><\/li><li><a href=\"#d73ebd1e-02db-4fdd-9bc2-bb3ccdff5db8\">Washerwoman<\/a><\/li><li><a href=\"#b08aeafc-eb30-4cb8-bded-3956e336f4c3\">Spacefiller<\/a><\/li><li><a href=\"#ef18b589-12c0-4a7e-9a15-7267c111975c\">R2D2<\/a><\/li><li><a href=\"#7c129102-1604-4b08-a880-518eabc1e1e2\">L_logo<\/a><\/li><\/ul><\/div><h4>The R-pentomino<a name=\"65794522-eaf5-4a82-adea-e0123a88e6c2\"><\/a><\/h4><p>There are 12 different five-cell starting populations. Conway named them pentominos and distinguished them by the letter of the alphabet that they vaguely resembled.  He was able to establish by hand that 11 of them stabilize in at most 10 generations, but without a computer he was unable to determine the fate of the R-pentomino.<\/p><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/r_pent_pic.gif\" alt=\"\"> <\/p><p>It turns out to take 1103 steps to stabilize, by which time it has spawned a half dozen gliders and reached a population of 116.  Here is a movie showing every tenth step of 1200 steps. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/r_pentomino_movie.gif\">R-pentomino-movie.<\/a><\/p><h4>Gliders by the Dozen<a name=\"24b84320-d226-461c-bbbe-3c5375eec402\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/dozen_pic.gif\" alt=\"\"> <\/p><p>This position stabilizes at step 184. Here is every fourth step for 300 steps. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/gliders_by_the_dozen_movie.gif\">Gliders-by-the-dozen-movie.<\/a><\/p><h4>Canada Goose<a name=\"d3c2bf02-7b7e-4b7c-99fb-ae14e7cc9425\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/canada_goose_init.gif\" alt=\"\"> <\/p><p>At the time of its discovery in 1999, this was the smallest known diagonal spaceship other than the glider. Here is every tenth step for a thousand steps. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/canada_goose_movie.gif\">Canada-Goose-movie.<\/a><\/p><h4>Washerwoman<a name=\"d73ebd1e-02db-4fdd-9bc2-bb3ccdff5db8\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/washerwoman_init.gif\" alt=\"\"> <\/p><p>This represents a group of populations known as <i>fuses<\/i>. Here is every third step for 270 steps. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/washerwoman_movie.gif\">Washerwoman-movie.<\/a><\/p><h4>Spacefiller<a name=\"b08aeafc-eb30-4cb8-bded-3956e336f4c3\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/spacefiller_init.gif\" alt=\"\"> <\/p><p>As the name implies, the spacefiller fills all of space. The number of nonzeros in the sparse matrix increases quadratically with the time step, so the data structure is not efficient in this situation. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/spacefiller_movie.gif\">spacefiller-movie.<\/a><\/p><h4>R2D2<a name=\"ef18b589-12c0-4a7e-9a15-7267c111975c\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/R2D2.gif\" alt=\"\"> <\/p><p>The droid from Star Wars.  Sometimes simpler is better. We don't need a movie here.<\/p><h4>L_logo<a name=\"7c129102-1604-4b08-a880-518eabc1e1e2\"><\/a><\/h4><p><img decoding=\"async\" vspace=\"5\" hspace=\"5\" src=\"https:\/\/blogs.mathworks.com\/images\/cleve\/L_logo_init.gif\" alt=\"\"> <\/p><p>This is not from the Lexicon. Our finale is the Game of Life initialed with a contour from the MathWorks logo.  After creating 12 gliders, it stabilizes at time 2637 with a population of 636. <a href=\"https:\/\/blogs.mathworks.com\/images\/cleve\/L_logo_movie.gif\">L_logo_movie<\/a><\/p><pre class=\"codeinput\">   <span class=\"comment\">% L = membrane(1,25,9,9);<\/span>\r\n   <span class=\"comment\">% U = sparse(91,91);<\/span>\r\n   <span class=\"comment\">% U(21:71,21:71) = L;<\/span>\r\n   <span class=\"comment\">% S = .05&lt;U &amp; U&lt;.15;<\/span>\r\n   <span class=\"comment\">% spy(S)<\/span>\r\n   <span class=\"comment\">% life_lex(S)<\/span>\r\n<\/pre><script language=\"JavaScript\"> <!-- \r\n    function grabCode_6bd77a09b2124299a383ef4eafc3ad3a() {\r\n        \/\/ Remember the title so we can use it in the new page\r\n        title = document.title;\r\n\r\n        \/\/ Break up these strings so that their presence\r\n        \/\/ in the Javascript doesn't mess up the search for\r\n        \/\/ the MATLAB code.\r\n        t1='6bd77a09b2124299a383ef4eafc3ad3a ' + '##### ' + 'SOURCE BEGIN' + ' #####';\r\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 6bd77a09b2124299a383ef4eafc3ad3a';\r\n    \r\n        b=document.getElementsByTagName('body')[0];\r\n        i1=b.innerHTML.indexOf(t1)+t1.length;\r\n        i2=b.innerHTML.indexOf(t2);\r\n \r\n        code_string = b.innerHTML.substring(i1, i2);\r\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\r\n\r\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \r\n        \/\/ in the XML parser.\r\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\r\n        \/\/ doesn't go ahead and substitute the less-than character. \r\n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\r\n\r\n        copyright = 'Copyright 2012 The MathWorks, Inc.';\r\n\r\n        w = window.open();\r\n        d = w.document;\r\n        d.write('<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add copyright line at the bottom if specified.\r\n        if (copyright.length > 0) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\\n');\r\n\r\n        d.title = title + ' (MATLAB code)';\r\n        d.close();\r\n    }   \r\n     --> <\/script><p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><br><a href=\"javascript:grabCode_6bd77a09b2124299a383ef4eafc3ad3a()\"><span style=\"font-size: x-small;        font-style: italic;\">Get \r\n      the MATLAB code <noscript>(requires JavaScript)<\/noscript><\/span><\/a><br><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p><p class=\"footer\"><br>\r\n      Published with MATLAB&reg; 7.14<br><\/p><\/div><!--\r\n6bd77a09b2124299a383ef4eafc3ad3a ##### SOURCE BEGIN #####\r\n%% Game of Life, Part 3, Sampler\r\n% The Game of Life.  A few more of my favorite populations.\r\n\r\n%% The R-pentomino\r\n% There are 12 different five-cell starting populations.\r\n% Conway named them pentominos and distinguished them by the letter of the\r\n% alphabet that they vaguely resembled.  He was able to establish by hand\r\n% that 11 of them stabilize in at most 10 generations, but without a computer\r\n% he was unable to determine the fate of the R-pentomino.\r\n%\r\n% <<r_pent_pic.gif>>\r\n%\r\n% It turns out to take 1103 steps to stabilize, by which time it has spawned\r\n% a half dozen gliders and reached a population of 116.  Here is a movie\r\n% showing every tenth step of 1200 steps.\r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/r_pentomino_movie.gif\r\n% R-pentomino-movie.>\r\n\r\n%% Gliders by the Dozen\r\n%\r\n% <<dozen_pic.gif>>\r\n%\r\n% This position stabilizes at step 184.\r\n% Here is every fourth step for 300 steps. \r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/gliders_by_the_dozen_movie.gif\r\n% Gliders-by-the-dozen-movie.>\r\n\r\n%% Canada Goose\r\n%\r\n% <<canada_goose_init.gif>>\r\n%\r\n% At the time of its discovery in 1999, this was the smallest known\r\n% diagonal spaceship other than the glider.\r\n% Here is every tenth step for a thousand steps. \r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/canada_goose_movie.gif\r\n% Canada-Goose-movie.>\r\n\r\n%% Washerwoman\r\n%\r\n% <<washerwoman_init.gif>>\r\n%\r\n% This represents a group of populations known as _fuses_.\r\n% Here is every third step for 270 steps. \r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/washerwoman_movie.gif\r\n% Washerwoman-movie.>\r\n\r\n%% Spacefiller\r\n%\r\n% <<spacefiller_init.gif>>\r\n%\r\n% As the name implies, the spacefiller fills all of space.\r\n% The number of nonzeros in the sparse matrix increases quadratically with\r\n% the time step, so the data structure is not efficient in this situation.\r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/spacefiller_movie.gif\r\n% spacefiller-movie.>\r\n\r\n%% R2D2\r\n%\r\n% <<R2D2.gif>>\r\n%\r\n% The droid from Star Wars.  Sometimes simpler is better.\r\n% We don't need a movie here.\r\n\r\n%% L_logo\r\n%\r\n% <<L_logo_init.gif>>\r\n%\r\n% This is not from the Lexicon.\r\n% Our finale is the Game of Life initialed with a contour\r\n% from the MathWorks logo.  After creating 12 gliders, it stabilizes\r\n% at time 2637 with a population of 636.\r\n% <https:\/\/blogs.mathworks.com\/images\/cleve\/L_logo_movie.gif\r\n% L_logo_movie>\r\n\r\n   % L = membrane(1,25,9,9);\r\n   % U = sparse(91,91);\r\n   % U(21:71,21:71) = L;\r\n   % S = .05<U & U<.15;\r\n   % spy(S)\r\n   % life_lex(S)\r\n\r\n##### SOURCE END ##### 6bd77a09b2124299a383ef4eafc3ad3a\r\n-->","protected":false},"excerpt":{"rendered":"<!--introduction--><p>The Game of Life.  A few more of my favorite populations.... <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/cleve\/2012\/09\/17\/game-of-life-part-3-sampler\/\">read more >><\/a><\/p>","protected":false},"author":78,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/313"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/users\/78"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":6,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":317,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/posts\/313\/revisions\/317"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/cleve\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}