Course 9 NP Theory序論 An Introduction to the Theory of NP

Slides:



Advertisements
Similar presentations
Chapter 10 馬可夫鏈 緒言 如果讀者仔細觀察日常生活中所發生的 諸多事件,必然會發現有些事件的未來 發展或演變與該事件現階段的狀況全然 無關,這種事件稱為獨立試行過程 (process of independent trials) ;而另一些 事件則會受到該事件現階段的狀況影響。
Advertisements

布林代數的應用--- 全及項(最小項)和全或項(最大項)展開式
第七章 抽樣與抽樣分配 蒐集統計資料最常見的方式是抽查。這 牽涉到兩個問題: 抽出的樣本是否具有代表性?是否能反應出母體的特徵?
:Word Morphing ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10508:word morphing 解題者:楊家豪 解題日期: 2006 年 5 月 21 日 題意: 第一行給你兩個正整數, 第一個代表下面會出現幾個字串,
Advanced Chemical Engineering Thermodynamics
What is static?. Static? 靜態 ? class Test { static int staticX; int instanceX; public Test(int var1, int var2) { this.staticX = var1; this.instanceX =
倫理準則:機密性. Confidentiality By: Angela Lo. 倫理準則:機密性. Confidentiality 醫護人員有更多的機會接觸病患的隱私。 隱私包括兩方面︰一是病患的身體,另一 是有關病患的機密的訊息。 醫護人員有更多的機會接觸病患的隱私。 隱私包括兩方面︰一是病患的身體,另一.
1.1 線性方程式系統簡介 1.2 高斯消去法與高斯-喬登消去法 1.3 線性方程式系統的應用(-Skip-)
: Factstone Benchmark ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: : Factstone Benchmark 解題者:鐘緯駿 解題日期: 2006 年 06 月 06 日 題意: 假設 1960.
亂數產生器安全性評估 之統計測試 SEC HW7 姓名:翁玉芬 學號:
Review of Chapter 3 - 已學過的 rules( 回顧 )- 朝陽科技大學 資訊管理系 李麗華 教授.
: OPENING DOORS ? 題組: Problem Set Archive with Online Judge 題號: 10606: OPENING DOORS 解題者:侯沛彣 解題日期: 2006 年 6 月 11 日 題意: - 某間學校有 N 個學生,每個學生都有自己的衣物櫃.
Chapter 2 聯立線性方程式與矩陣 緒言 線性方程式組 (systems of linear equations) 出現 在多數線性模式 (linear model) 中。根據以往解 題的經驗,讀者們也許已發現方程式的解僅與 該方程式的係數有關,求解的過程也僅與係數 的運算有關,只要係數間的相關位置不改變,
Chapter 3 Growth of Functions Asymptotic notation Θ-notation: f(n) = Θ(g(n)) , g(n) is an asymptotically tight bound for f(n) 。 Θ(g(n)) = {f(n)|
STAT0_sampling Random Sampling  母體: Finite population & Infinity population  由一大小為 N 的有限母體中抽出一樣本數為 n 的樣 本,若每一樣本被抽出的機率是一樣的,這樣本稱 為隨機樣本 (random sample)
5.1 Rn上之長度與點積 5.2 內積空間 5.3 單範正交基底:Gram-Schmidt過程 5.4 數學模型與最小平方分析
第一章 信號與系統初論 信號的簡介與DSP的處理方式。 系統特性與穩定性的判定方法。 以MATLAB驗證系統的線性、非時變、因果等特性。
1. 假設以下的敘述為一未提供 “ 捷徑計算 ” 能力的程式段,試用程 式設計的技巧,使此敘述經此改 寫的動作後,具有與 “ 捷徑計算 ” 之 處理方法相同之處理模式。 if and then E1 else E2 endif.
CH22 可靠性加速測試方法 目的 基本假設 加速試驗模式 Inverse Power Model
Department of Air-conditioning and Refrigeration Engineering/ National Taipei University of Technology 模糊控制設計使用 MATLAB 李達生.
Monte Carlo Simulation Part.2 Metropolis Algorithm Dept. Phys. Tunghai Univ. Numerical Methods C. T. Shih.
第一章 演算法:效率、分析與量級 1.1演算法 1.2發展有效率演算法的重要性 1.3演算法的分析 1.4量級(Order)
2009fallStat_samplec.i.1 Chap10 Sampling distribution (review) 樣本必須是隨機樣本 (random sample) ,才能代表母體 Sample mean 是一隨機變數,隨著每一次抽出來的 樣本值不同,它的值也不同,但會有規律性 為了要知道估計的精確性,必需要知道樣本平均數.
1 第四章 多變數函數的微分學 § 4.1 偏導數定義 定義 極限值 ■. 2 定理 極限值的基本定理 (1) 極限值的唯一性 : 若 存在,則 其值必為唯一。 (2) 若 且 ( 與 為常數 ) , 則 且 為常數且.
組員 : 林士恆 許嘉宏 不可計算函數 不可計算函數 根據 12.2 的 Church-Turing 命題,當我們找到一個杜林不 可計算的函數時,一般就相信它是個不可計算的函數。 簡單來說,就是一個計算超出今日電腦能力的函數。
Chapter 13 塑模靜態觀點:物件圖 Static View : Object Diagram.
Introduction to Java Programming Lecture 17 Abstract Classes & Interfaces.
: The largest Clique ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11324: The largest Clique 解題者:李重儀 解題日期: 2008 年 11 月 24 日 題意: 簡單來說,給你一個 directed.
Matlab Assignment Due Assignment 兩個 matlab 程式 : Eigenface : Eigenvector 和 eigenvalue 的應用. Fractal : Affine transform( rotation, translation,
Chapter 20 塑模動態觀點:狀態圖 Statechart Diagram. 學習目標  說明狀態圖的目的  定義狀態圖的基本記號  展示狀態圖的建構  定義活動、內部事件及遞延事件的狀態 圖記號.
: Tight words ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: : Tight Words 解題者:鐘緯駿、林一帆 解題日期: 2006 年 03 月 14 日 題意: 給定數字 k 與 n (0 ≦ k.
: Happy Number ★ ? 題組: Problem Set Archive with Online Judge 題號: 10591: Happy Number 解題者:陳瀅文 解題日期: 2006 年 6 月 6 日 題意:判斷一個正整數 N 是否為 Happy Number.
: Fast and Easy Data Compressor ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10043: Fast and Easy Data Compressor 解題者:葉貫中 解題日期: 2007 年 3.
: Problem A : MiniMice ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11411: Problem A : MiniMice 解題者:李重儀 解題日期: 2008 年 9 月 3 日 題意:簡單的說,題目中每一隻老鼠有一個編號.
: Ahoy, Pirates! ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11402: Ahoy, Pirates! 解題者:李重儀 解題日期: 2008 年 8 月 26 日 題意:有一個海盜島有 N 個海盜,他們的編號 (id)
: Count DePrimes ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11408: Count DePrimes 解題者:李育賢 解題日期: 2008 年 9 月 2 日 題意: 題目會給你二個數字 a,b( 2 ≦ a ≦ 5,000,000,a.
: Multisets and Sequences ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11023: Multisets and Sequences 解題者:葉貫中 解題日期: 2007 年 4 月 24 日 題意:在這個題目中,我們要定義.
:Nuts for nuts..Nuts for nuts.. ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 10944:Nuts for nuts.. 解題者:楊家豪 解題日期: 2006 年 2 月 題意: 給定兩個正整數 x,y.
1 Introduction to Java Programming Lecture 2: Basics of Java Programming Spring 2008.
: Problem G e-Coins ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10306: Problem G e-Coins 解題者:陳瀅文 解題日期: 2006 年 5 月 2 日 題意:給定一個正整數 S (0
: A-Sequence ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10930: A-Sequence 解題者:陳盈村 解題日期: 2008 年 5 月 30 日 題意: A-Sequence 需符合以下的條件, 1 ≤ a.
: Beautiful Numbers ★★★★☆ 題組: Problem Set Archive with Online Judge 題號: 11472: Beautiful Numbers 解題者:邱經達 解題日期: 2011 年 5 月 5 日 題意: 若一個 N 進位的數用到該.
Section 4.2 Probability Models 機率模式. 由實驗看機率 實驗前先列出所有可能的實驗結果。 – 擲銅板:正面或反面。 – 擲骰子: 1~6 點。 – 擲骰子兩顆: (1,1),(1,2),(1,3),… 等 36 種。 決定每一個可能的實驗結果發生機率。 – 實驗後所有的實驗結果整理得到。
資料結構實習-二.
演算法 8-1 最大數及最小數找法 8-2 排序 8-3 二元搜尋法.
產出外界效果的權利. 外界效果  是社會成本和私人成本發生分歧的原因。 外界效果可以是成本,也可以是收益。
845: Gas Station Numbers ★★★ 題組: Problem Set Archive with Online Judge 題號: 845: Gas Station Numbers. 解題者:張維珊 解題日期: 2006 年 2 月 題意: 將輸入的數字,經過重新排列組合或旋轉數字,得到比原先的數字大,
Chapter 2. Recurrence Relations (遞迴關係)
Learning Method in Multilingual Speech Recognition Author : Hui Lin, Li Deng, Jasha Droppo Professor: 陳嘉平 Reporter: 許峰閤.
Chapter 10 m-way 搜尋樹與B-Tree
: Function Overloading ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11032:Function Overloading 解題者:許智祺 解題日期: 2007 年 5 月 8 日 題意:判對輸入之數字是否為.
演算法課程 (Algorithms) 國立聯合大學 資訊管理學系 陳士杰老師 Course 7 貪婪法則 Greedy Approach.
JAVA 程式設計與資料結構 第十六章 Hash Tables. Introduction Hash Tables 結構為一個 Array ,稱之為 Bucket array 。 如果想要新增一個物件,要根據這個物件的特性 將其加入 Hash Table 內。 Bucket Array 用 A 來代替,其.
: Help My Brother ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11033: Help My Brother 解題者: 呂明璁 解題日期: 2007 年 5 月 14 日.
2005/7 Linear system-1 The Linear Equation System and Eliminations.
SQL 進階查詢.
: Wine trading in Gergovia ★★☆☆☆ 題組: Contest Volumes with Online Judge 題號: 11054: Wine trading in Gergovia 解題者:劉洙愷 解題日期: 2008 年 2 月 29 日 題意:在 Gergovia.
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 壹 企業研究導論.
兩黨與多黨政黨體系 Lijphart (1984) Party Systems: Two-Party and Multiparty Patterns.
:Commandos ★★★☆☆ 題組: Contest Archive with Online Judge 題號: 11463: Commandos 解題者:李重儀 解題日期: 2008 年 8 月 11 日 題意: 題目會給你一個敵營區內總共的建築物數,以及建築物 之間可以互通的路有哪些,並給你起點的建築物和終點.
函式 Function 東海大學物理系‧資訊教育 施奇廷. 函式簡介 當程式越來越大、越複雜時,程式的維護、 除錯會變得更困難,此時必須引入函式來 簡化程式或將程式分段,將程式重複的部 分改寫為函式,將程式「模組化」 這種作法有下列優點:節省程式發展的時 間、邏輯容易瞭解、程式容易除錯、可分 工合作完成程式.
Course 7 貪婪法則 Greedy Approach
: SAM I AM ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11419: SAM I AM 解題者:李重儀 解題日期: 2008 年 9 月 11 日 題意: 簡單的說,就是一個長方形的廟裡面有敵人,然 後可以橫的方向開砲或縱向開砲,每次開砲可以.
:Count the Trees ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10007:Count the Trees 解題者:楊家豪 解題日期: 2006 年 3 月 題意: 給 n 個點, 每一個點有自己的 Label,
: Finding Paths in Grid ★★★★☆ 題組: Contest Archive with Online Judge 題號: 11486: Finding Paths in Grid 解題者:李重儀 解題日期: 2008 年 10 月 14 日 題意:給一個 7 個 column.
:Problem E.Stone Game ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 10165: Problem E.Stone Game 解題者:李濟宇 解題日期: 2006 年 3 月 26 日 題意: Jack 與 Jim.
:Rings and Glue ★★☆☆☆ 題組: Problem Set Archive with Online Judge 題號: 10301: Rings and Glue 解題者:施博修 解題日期: 2011 年 5 月 18 日 題意:小約翰有了個大麻煩,他不小心將 rings.
幼兒行為觀察與記錄 第八章 事件取樣法.
: How many 0's? ★★★☆☆ 題組: Problem Set Archive with Online Judge 題號: 11038: How many 0’s? 解題者:楊鵬宇 解題日期: 2007 年 5 月 15 日 題意:寫下題目給的 m 與 n(m
McGraw-Hill/Irwin © 2003 The McGraw-Hill Companies, Inc.,All Rights Reserved. 肆 資料分析與表達.
Presentation transcript:

Course 9 NP Theory序論 An Introduction to the Theory of NP

▓ Outlines 本章重點 Intractability Input Size General Problem Categories The Theory of NP

▓ Intractability (難解問題) 什麼是 “多項式時間 (Polynomial Time)”? Definition: A polynomial-time algorithm is one whose worst-case time complexity is bounded above by a polynomial function of its input size. That is, if n is the input size, there exists a polynomial p (n) such that Polynomial Time Exponential Time

In computer science, a problem is called intractable if it is impossible to solve it with a polynomial-time algorithm. For a problem to be intractable, there must be no polynomial-time algorithm that solves it. 如果一個問題,目前還找不到一個Polynomial-Time Algorithm解它,但是也無法保証未來就找不到Polynomial-Time Algorithm來解這個問題,則無法証明該問題是Intractable. For example: The brute-force algorithm (暴力演算法) for the Chained Matrix Multiplication problem is non-polynomial time. However, the dynamic programming algorithm (Algorithm 3.6) developed in that section is Θ(n3).

Polynomial-time computable 一函數 f(x) 為polynomial-time computable若且為若存在一演算法,使得對所有的x,皆可在Polynomial Time內求得 f。 There are three general categories of problems as far as intractability is concerned: Problems for which polynomial-time algorithms have been found Problems that have been proven to be intractable Problems that have not been proven to be intractable, but for which polynomial-time algorithms have never been found It is a surprising phenomenon that most problems in computer science seem to fall into either the first or third category.

▓ The Theory of NP 所謂 “NP” 是指Non-deterministic與Polynomial兩個單字的簡寫。 Deterministic v.s. Non-deterministic Deterministic Algorithm (決定性演算法) Definition: Permitting at most one next move at any step in a computation. 是指演算法中每一個步驟的運算都需要被唯一定義,因此產生的結果也是唯一的。 執行決定性演算法的機器,稱為決定性的機器 (Deterministic Machine)。電腦就是一種決定性的機器。 Non-deterministic Algorithm (非決定性演算法) Definition: Permitting more than one choice of next move at some step in a computation. 是指演算法中允許一些步驟可能有變動的執行選擇,因此該步驟的運算結果不是唯一的,但是需要限制在一組可能的結果之中。 執行非決定性演算法的機器,稱為非決定性的機器 (Non-deterministic Machine)。實際上並不存在此種機器。

在所有的問題當中,除了過去所討論過的各種最佳化問題 (Optimization Problem) 以外,尚有另外一種型態的問題: 決策問題 (Decision Problem) Decision Problem: 此類問題輸出的答案非常簡單,就是 “yes” 或 “no” 兩者之一。

The partition problem (分割問題): 給予一組正整數的集合S={a1, a2, … , an},問: 是否可以將其分割成兩個子集合S1與S2,而此兩個子集合的個別總和相等。 Ex: Let S = {13, 2, 17, 20, 8}. The answer to this problem instance is "yes" because we can partition S into S1 = {13, 17} and S2 = {2, 20, 8}. The Sum of Subset Problem (部份集合的和問題): 給予一組正整數的集合S={a1, a2, … , an}及一個常數c,問: 集合S中是否存在一組子集合S’,此子集合S’的數字總合為c。 Ex: Let S = {12, 9, 33, 42, 7, 10, 5} and c = 24. The answer of this problem instance is "yes" as there exists S’ = {9, 10, 5} and the sum of the elements in S’ is equal to 24. If c is 6, the answer will be "no".

The Satisfiability Problem (滿足問題): 給一個布林函數X,我們對存在於此函數X中的一些變數分別指派True或False,使這個函數為True。 Ex: Let X = (-x1  x2 - x3)(x1  -x2 ) (x2  x3). Then the following assignment will make X true and the answer will be “yes”. x1 F, x2 F, x3 T If X is -x1  x1 , there will be no assignment which can make X true and the answer will be “no”. The Minimal Spanning Tree Problem (最小擴張樹問題): Given a graph G, find a spanning tree T of G with the minimum length.

The Traveling Salesperson Problem (旅行推銷員問題): 給予一個圖G = (V,E) ,找出一個由該圖的某一點出發所構成的cycle,此cycle會經過該圖中的每個點一次而再回到出發點,同時其總長度為最短 Ex: Consider following graph. There are two cycles satisfying our condition. They are C1 = abedcfa and C2 = acbe dfa. C1 is shorter and is the solution of this problem instance.

(Optimization Problems) Some problems: The Partition Problem The Sum of Subset Problem The Satisfiability Problem The Minimal Spanning Tree Problem The Traveling Salesperson Problem In general, optimization problems are more difficult that decision problems. (Decision Problems) (Optimization Problems)

For example (MST Problem): An optimization problem always has a decision problem corresponding to it. For example (MST Problem): Given a graph G and a constant c. The total length of the spanning tree of the graph G is a: If a < c, then the answer is “yes”, otherwise, its answer is “no”. The decision version of this minimal spanning tree problem is called the minimal spanning tree decision problem. If the decision version of the optimization problem is difficult already, the optimization version must be difficult.

Polynomial-Time Reducible (多項式時間的轉化性) Def: 如果一個問題L1可多項式時間轉化成問題L2,則存在一函數f為polynomial-time computable,使得對所有x而言,xL1  f(x)L2。 可表示成 L1  L2 若L1可以reduce到L2,則隱含著L1較L2容易的意義。

P: 是一群Decision Problem的集合,在此集合之問題皆可利用Deterministic Algorithm於Worst Case的情況下,在Polynomial Time的複雜度內被解決。 NP: 這類的問題只要給個解答,可以在Polynomial Time的複雜度內很快地驗證 (Verify) 出這個解答是否正確。 因此P可視為NP的一個特例 NP-hard: 是一群Decision Problem的集合。當 L2  NP-hard 若且唯若所有屬於NP的Decision Problem L1 (L1NP) 皆可多項式時間轉化成L2 (L1L2)

一般而言,理論學家相信上述問題之集合圖示如下: NP-complete: 是一群Decision Problem的集合。 若某一個問題Q屬於NP-complete,則滿足以下兩個條件: Q屬於NP Q屬於NP-hard 一般而言,理論學家相信上述問題之集合圖示如下: NP NP-hard NP- complete P

Nearly all of the decision problems are NP problems. In NP problems, there are some problems which have polynomial algorithms. They are called P problems. Every P problem must be an NP problem. There are a large set of problems which, up to now, have no polynomial algorithms.

no polynomial algorithms NP-complete problem constitute a subset of NP problems. NP-complete problems P problems no polynomial algorithms NP problems

Some important properties of NP-complete problems: Up to now, no NP-complete problem has any worst case polynomial algorithm. If any NP-complete problem can be solved in polynomial time, NP = P. There are thousands of problems proved to be NP-complete problems. If the decision version of an optimization problem is NP-complete, this optimization problem is called NP-hard. We can conclude that all NP-complete and NP-hard problems must be difficult problems because They do not have polynomial algorithms at present. It is quite unlikely that they can have polynomial algorithms in the future.