康威生命遊戲——孤獨會致命,擁擠也同樣
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
英國Atkins建築事務所設計的劍橋北站於2017年5月落成,它的表皮引發了一場小波瀾。緣由在於它使用了數學家熟悉的Rule 30圖案(黑白反轉並旋轉了45°),而這一圖案是劍橋大學的競爭對手牛津大學的校友史蒂芬·沃爾夫勒姆(Stephen Wolfram)創造的。但建築師解釋,它其實是劍橋校友約翰·康威(John Conway)的生命遊戲規則衍生的幾個著名圖案之一。web
這事也吸引了圖案原創者沃爾夫勒姆本人的注意,他專門寫了篇長文介紹這些圖案,上圖就是這篇文章裏的。app
讓咱們拋開劍橋、牛津之爭,回到這一圖形的源頭,康威生命遊戲。ide
![](http://static.javashuo.com/static/loading.gif)
約翰·康威全名John Horton Conway,1937年12月26日出生於英國利物浦。網站
他少時便對數學感興趣,後來進入劍橋大學攻讀數學專業,終於如願以償成了數學家。他活躍於有限羣的研究、趣味數學、紐結理論、數論、組合博弈論和編碼學等範疇。ui
Game of Life
約翰·康威最常被專業人士和大衆拿來討論的成果,就是他在1970年發明的生命遊戲,Game of Life。它的意義在於驗證了某些科學家的宇宙觀,即最簡單的邏輯規則能產生出複雜有趣的活動。google
康威生命遊戲在方格網上進行,有點像圍棋。有填充的網格表明有生命,或理解成一個細胞,再或者按中國傳統,把填充和無填充理解成「有」和「無」。遊戲規則只有四條:編碼
1 當週圍僅有1個或沒有存活細胞時, 原來的存活細胞進入死亡狀態。(模擬生命數量稀少)url
2 當週圍有2個或3個存活細胞時, 網格保持原樣。spa
3 當週圍有4個及以上存活細胞時,原來的存活細胞亦進入死亡狀態。(模擬生命數量過多)
4 當週圍有3個存活細胞時,空白網格變成存活細胞。(模擬繁殖)
![](http://static.javashuo.com/static/loading.gif)
「種子」長成「花朵」,「花朵」死後留下四個「種子」
康威生命遊戲的四條規則一目瞭然地對應着宇宙中的生命規律,它是一種元胞自動機(cellular automaton),體現了馮·諾依曼(Von Neumann)關於機器自我進化的思想。
簡單圖形
早在計算機尚未普及的時候,人們就已經發現了生命遊戲的許多表明性圖形。好比靜物(still lifes),細胞分佈形態很是穩定,永遠都保持一開始的樣子,不會有變化。
![](http://static.javashuo.com/static/loading.gif)
方塊(Block) 蜂窩(Beehive) 吐司(Loaf) 小船(Boat) 浴缸(Tub)
還有一類叫作振盪器(oscillator),從初始形態開始,在有限圖形之間切換,周而復始。數學家發現了不少週期的振盪器,但至今尚未找到週期爲1九、2三、3四、3八、41的。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
甚至還有會總體移動的,好比太空飛船(spaceship)類型。圖形會在方格世界內一直沿固定方向運動。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
複雜圖形
後來人們又發現了不少更爲複雜的變化,看幾個例子。
![](http://static.javashuo.com/static/loading.gif)
康威最初認爲生命遊戲中沒有任何圖形能夠無限增加,但很快高斯帕滑翔機槍(Gosper glider gun)推翻了他的想法。這個圖形每15代產生一架滑翔機,無限延續。
![](http://static.javashuo.com/static/loading.gif)
複雜振盪器一類裏有一個繁殖者(breeder),也是高斯帕的傑做。它擁有二次增加率。
河豚(puffer或puffer train)則是大型運動的表明。它也是高斯帕發現的,根據碎片多少分爲髒河豚和淨河豚兩類。
![](http://static.javashuo.com/static/loading.gif)
還有一個變型,叫作耙子(rakes)。
![](http://static.javashuo.com/static/loading.gif)
其實還有更爲大型複雜的圖形。也有一些研究者經過對規則稍微修改或補充而得到了意想不到的成功。
Rule 30
1983年,沃爾夫勒姆在研究了康威生命遊戲之後,本身制定規則,作出了一個一維元胞自動機(更接近於馮·諾依曼的思路)。表示方法是將下一代的圖形畫在前一代的下面。這個規則組稱爲Rule 30(由於按順序排列的二進制數00011110對應的十進制就是30)。
![](http://static.javashuo.com/static/loading.gif)
Rule 30通過多代演化後顯示出一部分規律一部分隨機的結果。
![](http://static.javashuo.com/static/loading.gif)
天然界中的織錦芋螺(Conus textile)花紋與Rule 30很是類似,這個發現估計讓沃爾夫勒姆高興了好一陣子。
![](http://static.javashuo.com/static/loading.gif)
說劍橋北站表皮圖案是Rule 30其實並不確切,它是黑白反轉的Rule 30。因此晚上內部亮燈時,或者如圖這樣從內向外看,才真正符合Rule 30。
反轉的Rule 30事實上就是沃爾夫勒姆的另外一個規則組Rule 135。他從Rule 30開始,發現了一系列有趣的圖形。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
初始狀態不一樣也會致使圖案變化不一樣
更多變化
康威生命遊戲的變種已經數不勝數。有些研究者嘗試改變基本規則,更有些研究者真的把它作成了遊戲。
![](http://static.javashuo.com/static/loading.gif)
規則改爲1個或2個都容許中間細胞存活,出現了不少直線。
![](http://static.javashuo.com/static/loading.gif)
4個細胞時維持原來的狀態,圖案好像從四周不斷向中間噴發。
![](http://static.javashuo.com/static/loading.gif)
5個細胞時維持原來的狀態,會出現由底部不斷往上升的圖案,像冒泡泡同樣。
![](http://static.javashuo.com/static/loading.gif)
中國研究者使用河圖五行進行演算,使人吃驚地獲得陰陽分隔的圖案。
在康威生命遊戲愛好者創辦的網站conwaylife.com上,咱們能夠看到五花八門的改編創做,一般都是本身制定的規則。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
根據康威生命遊戲開發的電腦遊戲,雖然都相對簡單,但同樣能夠產生有趣的圖案。
![](http://static.javashuo.com/static/loading.gif)
![](http://static.javashuo.com/static/loading.gif)
網上還有不少在線的康威生命遊戲,你們能夠本身上去體驗一下。下圖分別是https://people.kth.se/~gunnarj/LIFE/lifegame5w.html 、http://web.mit.edu/jb16/www/6170/gameoflife/gol.html 、https://bitstorm.org/gameoflife的界面。
![](http://static.javashuo.com/static/loading.gif)
康威生命遊戲從原版到後來的衆多變種,差異只在量變,而規則的本質沒有變。它模擬的是生物體數量與環境資源的關係,反映了宇宙基本規律。過於孤獨和過於擁擠,都不利於物種延續。
References:
- Stephen Wolfram. Oh My Gosh, It’s Covered in Rule 30s![DB/OL]. [2017-06-01]. http://blog.stephenwolfram.com/2017/06/oh-my-gosh-its-covered-in-rule-30s/
- Siobhan Roberts. John Horton Conway: the world’s most charismatic mathematician[DB/OL]. [2015-07-23]. https://www.theguardian.com/science/2015/jul/23/john-horton-conway-the-most-charismatic-mathematician-in-the-world
- Siobhan Roberts. A Life in Games: The Playful Genius of John Conway[DB/OL]. [2015-09-05]. https://www.wired.com/2015/09/life-games-playful-genius-john-conway/
- Ent. 【果殼網專訪】斯蒂芬·沃爾夫勒姆:宇宙的本質是計算[DB/OL]. [2015-01-07]. https://www.guokr.com/article/439770/
- 三符風雲涌. 生命遊戲細胞自動機中的陰陽規律啓示[DB/OL]. [2015-11-12]. http://blog.yinfupai.com/2577.html
- [英] 保羅·戴維斯. 上帝與新物理學[M]. 長沙:湖南科學技術出版社, 1996.
- https://en.wikipedia.org/John_Horton_Conway; ~Conway's_Game_of_Life; ~Rule_30; ~Rule_110