Skip to Content
深入理解運算原理|從簡單的機器到無所不能的程式
book

深入理解運算原理|從簡單的機器到無所不能的程式

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
四處皆通用
|
257
這項技術可以用在任何標籤系統的模擬(包括本身模擬圖靈機的標籤系統),這意謂著
循環標籤系統也是通用。
康威的生命遊戲
1970 年,約翰 康威(John Conway)創造了名為
生命遊戲
Game of Life
)的通用系
統。這個『遊戲』是在無限大的二維格線進行,每個方格裡的方形細胞可以是
存活
死亡
。每個細胞的周圍有 8
鄰居
3 個細胞在它上面,鄰近的左、右有 2 個細胞,
而在它底下還有 3 個細胞。
生命遊戲以一系列的步驟進行,像是有限狀態機。每個步驟會根據細胞本身的目前狀態
和其鄰居的狀態所觸發的規則,使得每個細胞可能潛在的從活變成死,反之亦然。規則
很簡單:如果活細胞的活鄰居不到 2 個(不足)或超過 3 個(過剩)就會死亡,而如果
死細胞剛好只有 3 個活鄰居(繁殖),則會重生。
以下是生命遊戲規則如何在單一步驟影響細胞狀態的 6 個例子
11
,存活細胞會以黑色表
示,死亡細胞則以白色呈現:
不足 過剩 繁殖 穩定 穩定 穩定
像這樣的系統是由細胞陣列和每個步驟更新細胞狀態的規則集所組成,稱
細胞自動機
cellular automaton
)。
11 512 種可能的組合:其中有 9 個細胞,每個細胞可以是兩種狀態之一,因此共有 2×2×2×2×2×2×2
×2×2 = 512 種不同的可能。
258
|
7
就像我們在本章看到的其他系統,儘管生活遊戲的規則很簡單,但卻也表現出驚人的複
雜程度。有趣的行為可能來自特定的活細胞模式,其中最著名的是
滑行者
glider ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

JSON實務手冊

JSON實務手冊

Tom Marrs

Publisher Resources

ISBN: 9789864766000