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

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

by Tom Stuart
November 2017
Beginner to intermediate
344 pages
7h 2m
Chinese
GoTop Information, Inc.
Content preview from 深入理解運算原理|從簡單的機器到無所不能的程式
290
|
8
有時會出現錯誤的答案,例如即使
do_the_opposite.rb
停止,也預測它會永久循環
(反之亦然)。
有時會永遠循環,而且絕不會傳回任何答案,就像
#evaluate
rruby does_it_say_
no.rb < does_it_say_no.rb
裡所完成的。
所以完全正確執行
#halts?
也就永遠不可能存在:輸入必須造成不正確的預測或完全沒
有預測。
記住可決定性的定義:
如果有一種演算法保證能在有限的時間內解決任何可能的輸入,則決定性問題
就是可以決定的。
我們已經證明不可能編寫出可以完全解決停機問題的 Ruby 程式,且由於 Ruby 程式的
運算能力和圖靈機器相當,所以圖靈機也是不可能。邱奇 - 圖靈論題提及,每個演算法
都可以由圖靈機執行,所以如果沒有解決停機問題的圖靈機,也就沒有演算法;也就是
說,停機問題是無法決定的。
其他無法決定的問題
讓人氣餒的是,電腦無法確實解決容易定義的問題(『這個程式該停止嗎?』)。然而,
這是個相對抽象的具體問題,而我們用來描述它的
do_the_opposite.rb
程式既不切實
際、又做作不自然;我們似乎不可能一直想要真的實作
#halts?
,或者編寫像是
do_the_
opposite.rb
的程式,作為真實世界應用程式的一部分。也許我們可以忽視無法決定作為
學術上的好奇心,並且繼續過我們的日子。
不幸的是,這並非那麼簡單,因為停機問題不是無法決定唯一的問題。在我們建置軟體
的日常工作當中,可能實際想要解決其他諸多問題,而這些問題的無法決定性,對自動 ...
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