SlideShare a Scribd company logo
無限と計算可能性
と対角線論法
計算の難しさ
• ソートの難しさ (長さnの配列のソートを考える)
• 配列の最小値(最大値)を抜き出していく。 -> O(n2)
5 1 3 2
5 3 2
5 3
1
1 2
5
1 2 3
1 2 3 5
n
n
計算の難しさ
• ソートの難しさ (長さnの配列のソートを考える)
• 配列を分割してマージしながらソートする。 -> O(n log n)
5 1 3 2
5 1 3 2
5 31 2
1 5 2 3
1 2 3 5
n
log n
計算が難しい問題
• 素因数分解の難しさ (n bitの整数の素因数分解を考える)
• n bitの整数は2n ぐらいの大きさ
• 2から順に割っていく -> O(2n)
• 入力の長さに対して指数的に計算量が増える
• 速く解くアルゴリズムが見つかっていない。
計算の難しさ
O(2n
) O(n2
) O(n log n) O(n)
O(log n)
O(1)
n: 入力の長さ
必要な手順
計算ができない問題
• ポストの対応問題
a
ab
bb
b
a
a
計算ができない問題
• ポストの対応問題
a
ab
bb
b
a
a
a
ab
bb
b
a
a
= abba
= abba
計算ができない問題
• ポストの対応問題
b
bb
a
ba
ab
a
計算ができない問題
• ポストの対応問題
b
bb
a
ba
ab
a
ab
a
b
bb
ab
a
a
ba
= abbaba
= abbaba
計算ができない問題
• ポストの対応問題
a
bb
aa
b
a
b
計算ができない問題
• ポストの対応問題
• 解となる組合わせは存在しない
a
bb
aa
b
a
b
計算ができない問題
• ポストの対応問題
• 解となる組合わせは存在しない
• 任意の組が与えられた時に、解が存在すれば解を、存在しない時に
は存在しないと答えるプログラムは存在しない。
a
bb
aa
b
a
b
計算ができない問題
• 停止性問題
• プログラムPと入力Iが与えられた時 P(I)が停止するかどうかを決定
する
計算ができない問題
• 停止性問題
• プログラムPと入力Iが与えられた時 P(I)が停止するかどうかを決定
する
• 対角線論法を用いて証明できる
ウォームアップ
数えられる無限と数えられない無限
• 実数の集合は自然数の集合より無限の濃度が濃い
• 対角線論法を用いて証明できる
自然数の集合 実数の集合
自然数と有限小数
• 有限小数は自然数と1対1の対応を持つ(可算である)
1 0
2 1
3 0.1
4 1.0
5 10.0
6 11.0
自然数と有理数
• 有理数も可算である
1 2 3 4
1 1/1 1/2 1/3 1/4
2 2/1 2/2 2/3 2/4
3 3/1 3/2 3/3 3/4
4 4/1 4/2 4/3 4/4
自然数と実数
• 実数は自然数と1対1の対応を持たない(非可算である)
• [0, 1)の間(0以上1未満)の実数が自然数と1対1の対応を持たないこ
とを対角線論法で証明する。
実数が非加算であることの証明
• [0,1)の間の実数が可算であると仮定する
1 0.a11a12a13a14…
2 0.a21a22a23a24…
3 0.a31a32a33a34…
4 0.a41a42a43a44…
6 0.a11a12a13a14…
・
・
自然数と実数
• [0,1)の間の実数が可算であると仮定する
1 0.a11a12a13a14…
2 0.a21a22a23a24…
3 0.a31a32a33a34…
4 0.a41a42a43a44…
5 0.a51a52a53a54…
・
b 0.b1 b2 b3 b4 …
以下のような実数bを考える
b = b1 b2 b3 b4 … bi…
bi = 2 (aii = 1)
1 (aii ≠ 1)
自然数と実数
• [0,1)の間の実数が可算であると仮定する
1 0.a11a12a13a14…
2 0.a21a22a23a24…
3 0.a31a32a33a34…
4 0.a41a42a43a44…
5 0.a51a52a53a54…
・
b 0.b1 b2 b3 b4 …
以下のような実数bを考える
b = b1 b2 b3 b4 … bi…
bi = 2 (aii = 1)
1 (aii ≠ 1)
実数が可算であれば
b = an1 an2 an3 an4 … ani…
となるnが存在する。ani = bi
自然数と実数
• [0,1)の間の実数が可算であると仮定する
1 0.a11a12a13a14…
2 0.a21a22a23a24…
3 0.a31a32a33a34…
4 0.a41a42a43a44…
5 0.a51a52a53a54…
・
b 0.b1 b2 b3 b4 …
以下のような実数bを考える
b = b1 b2 b3 b4 … bi…
bi = 2 (aii = 1)
1 (aii ≠ 1)
実数が可算であれば
b = an1 an2 an3 an4 … ani…
となるnが存在する。ani = bi
ann = 1のとき
→ bの定義によりbn = 2となり矛盾
ann ≠ 1のとき
→ bの定義によりbn = 1となり矛盾
停止性問題が計算不可能であることの証明
• プログラムPと入力Iが与えられた時 P(I)が停止するかどうかを決定す
る
• プログラムPと入力dが与えられた時 P(d)が停止するかどうかを決
定するプログラムHalt(P, I)が存在すると仮定する。
停止性問題
• プログラムPと入力Iが与えられた時 P(I)が停止するかどうかを決定す
る
I1 I2 I3 I4
P1 Y N N Y
P2 Y Y Y Y
P3 N N N Y
P4 Y N Y N
Y - 停止する
N - 停止しない
次のようなプログラムを考える
Halt(Pi,Ii) = N ( Pi(Ii) = Y )
= Y ( Pi(li) = N )
停止性問題
• プログラムPと入力Iが与えられた時 P(I)が停止するかどうかを決定す
る
I1 I2 I3 I4
P1 Y N N Y
P2 Y Y Y Y
P3 N N N Y
P4 Y N Y N
Y - 停止する
N - 停止しない
次のようなプログラムを考える
Halt(Pi,Ii) = N ( Pi(Ii) = Y )
= Y ( Pi(li) = N )
Pn = Halt(Pi,Ii)となるnが存在する
Halt(Pi,Ii) = Yのとき
→ Haltの定義によりPn = Nとなり矛盾
Halt(Pi,Ii) = Nのとき
→ bの定義によりPn = Yとなり矛盾
まとめ
• コンピュータで解けない問題がある
• 停止性問題
• ポストの対応問題
• 無限にも濃度がある
• 自然数、有理数は加算無限
• 実数は非加算無限
• 対角線論法は便利
• ゲーデルの不完全性定理の証明にも使用される

More Related Content

Featured

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

無限と計算可能性と対角線論法