February 8, 2016CS21 Lecture 151 CS21 Decidability and Tractability Lecture 15 February 8, 2016.

Slides:



Advertisements
Similar presentations
Measuring Time Complexity
Advertisements

The diagonalization method The halting problem is undecidable Decidability.
January 5, 2015CS21 Lecture 11 CS21 Decidability and Tractability Lecture 1 January 5, 2015.
Complexity 11-1 Complexity Andrei Bulatov Space Complexity.
Measuring Time Complexity Sipser 7.1 (pages )
February 11, 2015CS21 Lecture 161 CS21 Decidability and Tractability Lecture 16 February 11, 2015.
Reducibility A reduction is a way of converting one problem into another problem in such a way that a solution to the second problem can be used to solve.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY Read sections 7.1 – 7.3 of the book for next time.
Computability and Complexity 10-1 Computability and Complexity Andrei Bulatov Gödel’s Incompleteness Theorem.
Theory of Computing Lecture 20 MAS 714 Hartmut Klauck.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
CS21 Decidability and Tractability
February 4, 2015CS21 Lecture 131 CS21 Decidability and Tractability Lecture 13 February 4, 2015.
CS 310 – Fall 2006 Pacific University CS310 Complexity Section 7.1 November 27, 2006.
February 18, 2015CS21 Lecture 181 CS21 Decidability and Tractability Lecture 18 February 18, 2015.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Great Theoretical Ideas in Computer Science.
 2005 SDU Lecture13 Reducibility — A methodology for proving un- decidability.
Fall 2013 CMU CS Computational Complexity Lecture 2 Diagonalization, 9/12/2013.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Donghyun (David) Kim Department of Mathematics and Computer Science North Carolina Central University 1 Chapter 5 Reducibility Some slides are in courtesy.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis (Winter 2016, these slides were also used for Day 33)
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
MA/CSSE 474 Theory of Computation Universal Turing Machine Church-Turing Thesis Delayed due dates for HWs See updated schedule page. No class meeting.
Chapters 11 and 12 Decision Problems and Undecidability.
February 1, 2016CS21 Lecture 121 CS21 Decidability and Tractability Lecture 12 February 1, 2016.
The Acceptance Problem for TMs
Gödel's Legacy: The Limits Of Logics
Discrete Mathematics for Computer Science
Time complexity Here we will consider elements of computational complexity theory – an investigation of the time (or other resources) required for solving.
Busch Complexity Lectures: Turing Machines
This statement is false.
CS21 Decidability and Tractability
(Universal Turing Machine)
CS154, Lecture 7: Turing Machines.
MCC 2093 Advanced Theoretical Computer Science
CSE 105 theory of computation
HIERARCHY THEOREMS Hu Rui Prof. Takahashi laboratory
Turing Machines Acceptors; Enumerators
Homework: Friday Read Section 4.1. In particular, you must understand the proofs of Theorems 4.1, 4.2, 4.3, and 4.4, so you can do this homework. Exercises.
Summary.
No Proof System for Number Theory Reduction to Halting Problem
Computability & Complexity I
Decidable Languages Costas Busch - LSU.
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS154, Lecture 12: Time Complexity
CSC 4170 Theory of Computation Time complexity Section 7.1.
CS21 Decidability and Tractability
CS21 Decidability and Tractability
CS21 Decidability and Tractability
Instructor: Aaron Roth
CSE 105 theory of computation
Instructor: Aaron Roth
Instructor: Aaron Roth
Theory of Computability
Decidability continued….
Instructor: Aaron Roth
CSC 4170 Theory of Computation Time complexity Section 7.1.
MA/CSSE 474 Theory of Computation
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

February 8, 2016CS21 Lecture 151 CS21 Decidability and Tractability Lecture 15 February 8, 2016

Administrivia Reminder: Midterm due Wednesday Clarification of collab policy for problem sets: Your solution should be based on your understanding February 8, 2016CS21 Lecture 152

February 8, 2016CS21 Lecture 153 Outline Gödel Incompleteness Theorem …On to Complexity The complexity class P Examples of problems in P

Gödel Incompleteness Theorem February 8, 2016CS21 Lecture 154

February 8, 2016CS21 Lecture 155 Number Theory A sentence is a formula with no un- quantified variables –every number has a successor:  x  y y = x + 1 –every number has a predecessor:  x  y x = y + 1 –not a sentence: x + y = 1 “number theory” = set of true sentences N –denoted Th(N) true false

February 8, 2016CS21 Lecture 156 Proof systems a proof is a sequence of formulas  1,  2,  3, …,  n such that each  i is either –an axiom, or –follows from formulas earlier in list from rules of inference A sentence is a theorem of the proof system if it has a proof

February 8, 2016CS21 Lecture 157 Proof systems A proof system is sound if all theorems in that proof system are true (better have this) Peano Arithmetic (PA) is sound. N true sentences = Th(N) N false sentences = co-Th(N) theorems of PA

February 8, 2016CS21 Lecture 158 Proof systems A proof system is complete if all true sentences are theorems in that proof system hope to have this (recall Hilbert’s program) N true sentences = Th(N) N false sentences = co-Th(N) theorems of a complete proof system

Proof systems Does there exist a proof system for number theory which is sound and complete? Technically, yes –Set of axioms = set of true sentences –No rules of inference –(This is not a useful proof system) February 8, 2016CS21 Lecture 159

February 8, 2016CS21 Lecture 1510 Incompleteness Theorem Theorem: Peano Arithmetic is not complete. (same holds for any reasonable proof system for number theory) Proof outline: –the set of theorems of PA is RE N –the set of true sentences (= Th(N)) is not RE

February 8, 2016CS21 Lecture 1511 Incompleteness Theorem Lemma: the set of theorems of PA is RE. Proof: –TM that recognizes the set of theorems of PA: –systematically try all possible ways of writing down sequences of formulas –accept if encounter a proof of input sentence (note: true for any reasonable proof system)

February 8, 2016CS21 Lecture 1512 Incompleteness Theorem NLemma: Th(N) is not RE Proof: N –reduce from co-HALT (show co-HALT ≤ m Th(N)) –recall co-HALT is not RE –what should f( ) produce? –construct  such that M loops on w   is true

February 8, 2016CS21 Lecture 1513 Incompleteness Theorem –we will define VALCOMP M,w (v)  … (details to come) so that it is true iff v is a (halting) computation history of M on input w –then define f( ) to be:     v VALCOMP M,w (v) –YES maps YES? N  co-HALT   is true    Th(N) –NO maps to NO? N  co-HALT   is false    Th(N)

February 8, 2016CS21 Lecture 1514 Expressing computation in the language of number theory Last time: basic building blocks –x < y   z x + z = y   (z = 0) –INTDIV(x, y, q, r)  x = qy + r  r < y –DIV(y, x)   q INTDIV(x,y,q,0) –PRIME(x)  x ≥ (1+1)   y (DIV(y, x)  (y = 1  y = x))

February 8, 2016CS21 Lecture 1515 Expressing computation in the language of number theory – we’ll write configurations over an alphabet of size p, where p is a prime that depends on M –d is a power of p: POWER p (d)   z (DIV(z, d)  PRIME(z))  z = p –d = p k and length of v as a p-ary string is k LENGTH(v, d)  POWER p (d)  v < d

February 8, 2016CS21 Lecture 1516 Expressing computation in the language of number theory –the p-ary digit of v at position y is b (assuming y is a power of p): DIGIT(v, y, b)   u  a (v = a + by + upy  a < y  b < p) –the three p-ary digits of v at position y are b,c, and d (assuming y is a power of p): 3DIGIT(v, y, b, c, d)   u  a (v = a + by + cpy + dppy + upppy  a < y  b < p  c < p  d < p)

February 8, 2016CS21 Lecture 1517 Expressing computation in the language of number theory –the three p-ary digits of v at position y “match” the three p-ary digits of v at position z according to M’s transition function (assuming y and z are powers of p): MATCH(v, y, z)   (a,b,c,d,e,f)  C 3DIGIT(v, y, a, b, c)  3DIGIT(v, z, d, e, f) where C = {(a,b,c,d,e,f) : abc in config. C i can legally change to def in config. C i+1 }

February 8, 2016CS21 Lecture 1518 Expressing computation in the language of number theory –all pairs of 3-digit sequences in v up to d that are exactly c apart “match” according to M’s transition function (assuming c, d powers of p) MOVE(v, c, d)   y ( POWER p (y)  yppc < d)  MATCH(v, y, yc)

February 8, 2016CS21 Lecture 1519 Expressing computation in the language of number theory –the string v starts with the start configuration of M on input w = w 1 …w n padded with blanks out to length c (assuming c is a power of p): START(v, c)   i = 0,1,2,…, n DIGIT(v, p i, k i )  p n < c   y (POWER p (y)  p n < y < c  DIGIT(v, y, k)) where k 0 k 1 k 2 k 3 …k n is the p-ary encoding of the start configuration, and k is the p-ary encoding of a blank symbol.

February 8, 2016CS21 Lecture 1520 Expressing computation in the language of number theory –string v has a halt state in it somewhere before position d (assuming d is power of p): HALT(v, d)   y (POWER p (y)  y < d   a  H DIGIT(v,y,a)) where H is the set of p-ary digits “containing” states q accept or q reject.

February 8, 2016CS21 Lecture 1521 Expressing computation in the language of number theory –string v is a valid (halting) computation history of machine M on string w: VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) –M does not halt on input w:  v VALCOMP M,w (v)

Gödel Incompleteness Theorem (an example) February 8, 2016CS21 Lecture 1522

February 8, 2016CS21 Lecture 1523 Incompleteness Theorem v = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d))

February 8, 2016CS21 Lecture 1524 Incompleteness Theorem v = d = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) d = p k and length of v as a p-ary string is k LENGTH(v, d)  POWER p (d)  v < d

February 8, 2016CS21 Lecture 1525 Incompleteness Theorem v = c = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) v starts with the start configuration of M on input w padded with blanks out to length c: START(v, c)   i = 0,…, n DIGIT(v, p i, k i )  p n < c   y (POWER p (y)  p n < y < c  DIGIT(v, y, k)) kk n …k 2 k 1 k 0 p n =1000

February 8, 2016CS21 Lecture 1526 Incompleteness Theorem v = yc = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) all pairs of 3-digit sequences in v up to d exactly c apart “match” according to M’s transition function MOVE(v, c, d)   y ( POWER p (y)  yppc < d)  MATCH(v, y, yc) y =1

February 8, 2016CS21 Lecture 1527 Incompleteness Theorem v = yc = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) all pairs of 3-digit sequences in v up to d exactly c apart “match” according to M’s transition function MOVE(v, c, d)   y ( POWER p (y)  yppc < d)  MATCH(v, y, yc) y =10

February 8, 2016CS21 Lecture 1528 Incompleteness Theorem v = yc = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) all pairs of 3-digit sequences in v up to d exactly c apart “match” according to M’s transition function MOVE(v, c, d)   y ( POWER p (y)  yppc < d)  MATCH(v, y, yc) y =100

February 8, 2016CS21 Lecture 1529 Incompleteness Theorem v = y = VALCOMP M,w (v)   c  d (POWER p (c)  c < d  LENGTH(v, d)  START(v, c)  MOVE(v, c, d)  HALT(v, d)) string v has a halt state in it before pos’n d: HALT(v, d)   y (POWER p (y)  y < d   a  H DIGIT(v,y,a)) halt state

February 8, 2016CS21 Lecture 1530 Incompleteness Theorem NLemma: Th(N) is not RE Proof: N –reduce from co-HALT (show co-HALT ≤ m Th(N)) –recall co-HALT is not RE –constructed  such that M loops on w   is true

February 8, 2016CS21 Lecture 1531 Summary full-fledged model of computation: TM many equivalent models Church-Turing Thesis encoding of inputs Universal TM

February 8, 2016CS21 Lecture 1532 Summary classes of problems: –decidable (“solvable by algorithms”) –recursively enumerable (RE) –co-RE counting: –not all problems are decidable –not all problems are RE

February 8, 2016CS21 Lecture 1533 Summary diagonalization: HALT is undecidable reductions: other problems undecidable –many examples –Rice’s Theorem natural problems that are not RE Recursion Theorem: non-obvious capability of TMs: printing out own description Incompleteness Theorem

Summary Enjoyed CS21 so far? Consider Ma/CS 117abc (“Computability Theory”) February 8, 2016CS21 Lecture 1534

Complexity Central question of CS21: Which problems can we solve through computation? February 8, 2016CS21 Lecture 1535

February 8, 2016CS21 Lecture 1536 Complexity So far we have classified problems by whether they have an algorithm at all. In real world, we have limited resources with which to run an algorithm: –one resource: time –another: storage space need to further classify decidable problems according to resources they require

February 8, 2016CS21 Lecture 1537 Complexity Complexity Theory = study of what is computationally feasible (or tractable) with limited resources: –running time –storage space –number of random bits –degree of parallelism –rounds of interaction –others… main focus not in this course

February 8, 2016CS21 Lecture 1538 Worst-case analysis Always measure resource (e.g. running time) in the following way: –as a function of the input length –value of the fn. is the maximum quantity of resource used over all inputs of given length –called “worst-case analysis” “input length” is the length of input string, which might encode another object with a separate notion of size

February 8, 2016CS21 Lecture 1539 Time complexity Definition: the running time (“time complexity”) of a TM M is a function NN f:N → N where f(n) is the maximum number of steps M uses on any input of length n. “M runs in time f(n),” “M is a f(n) time TM”

February 8, 2016CS21 Lecture 1540 Time complexity Example: TM M deciding L = {0 k 1 k : k ≥ 0}. On input x: scan tape left-to-right, reject if 0 to right of 1 repeat while 0’s, 1’s on tape: scan, crossing off one 0, one 1 if only 0’s or only 1’s remain, reject; if neither 0’s nor 1’s remain, accept # steps?

February 8, 2016CS21 Lecture 1541 Time complexity We do not care about fine distinctions –e.g. how many additional steps M takes to check that it is at the left of tape We care about the behavior on large inputs –general-purpose algorithm should be “scalable” –overhead for e.g. initialization shouldn’t matter in big picture

February 8, 2016CS21 Lecture 1542 Time complexity Measure time complexity using asymptotic notation (“big-oh notation”) –disregard lower-order terms in running time –disregard coefficient on highest order term example: f(n) = 6n 3 + 2n n –“f(n) is order n 3 ” –write f(n) = O(n 3 )

February 8, 2016CS21 Lecture 1543 Asymptotic notation NR + Definition: given functions f,g:N → R +, we say f(n) = O(g(n)) if there exist positive integers c, n 0 such that for all n ≥ n 0 f(n) ≤ cg(n). meaning: f(n) is (asymptotically) less than or equal to g(n) if g > 0 can assume n 0 = 0, by setting c’ = max 0≤n≤n 0 {c, f(n)/g(n)}

February 8, 2016CS21 Lecture 1544 Time complexity total = O(n) + n ¢ O(n) + O(n) = O(n 2 ) On input x: scan tape left-to-right, reject if 0 to right of 1 repeat while 0’s, 1’s on tape: scan, crossing off one 0, one 1 if only 0’s or only 1’s remain, reject; if neither 0’s nor 1’s remain, accept O(n) steps ≤ n repeats