CP405 Theory of Computation

Size: px
Start display at page:

Download "CP405 Theory of Computation"

Transcription

1 CP405 Theory of Computation

2 BB(3) q 0 q 1 q 2 0 q 1 1R q 2 0R q 2 1L 1 H1R q 1 1R q 0 1L

3 Growing Fast BB(3) = 6 BB(4) = 13 BB(5) = 4098 BB(6) = x (known) (known) (possible) (possible)

4 Language: a set of strings Computation as a test if a string is in a language DFA: limited memory automaton Regular Language: a language accepted by a DFA Regular Operations (closed): A B, AB, A *, A, A B NFA: non-deterministic finite automaton DFA == NFA == regex (computational power) GNFA: NFA with regex transitions Prove lang. is non-regular with pumping lemma POSIX extended regexes are not formally regular (no corr. DFA) CFG: context-free grammar generates CFL Some languages are CF and not regular CFL are used for programming languages All regular languages are CF Every CFL can be converted to Chomsky Normal Form (CNF) - Rules are two vars, one terminal, or start->epsilon CNF string expansions require 2n-1 steps L-Systems: formal grammars for modeling morphogenesis PDA == CFG (computational power) Non-deterministic PDA > Deterministic PDA (comp. power) Context-sensitive grammar > Context-free grammar (comp power) Prove lang. is not context-free with pumping lemma TM > PDA (comp. power) TM can accept, reject, or loop forever TM match intuitive definition of algorithm Java, Python, etc. are == TM (comp power) Linear Bounded Automata (LBA) == TM with finite tape LBA == context-sensitive grammars (comp power) Post Tag System chops and concatenates strings (== TM) Queue Machine like PDA with queue in place of stack (== TM) PDA with two stacks == TM Counter Machines (pebbles in holes) with two registers (== TM) Random Access Machines provide indirect addressing (== TM) TMs that always halt correctly are called deciders. If TM M is a decider, then L(M) is a decidable language A DFA, A NFA, A CFG, A LBA are decidable A TM is undecidable (the acceptance problem) HALT is undecidable (the halting problem) Rice's Theorem: any non-trivial lang. property is undecidable TMs that accept correctly (may loop) are called recognizers Enumerators == recognizers that print If a TM M is a recognizer, then L(M) is an enumerable lang A TM, HALT are enumerable A TM, HALT are not enumerable EQ TM, EQ TM, are both not enumerable countable number of enumerable languages uncountable number of langs that are not enumerable Post Correspondence Problem (dominos) is undecidable Never play dominos with Matthew A Quine is a program that print out itself TMs can obtain their own descriptions Busy beaver function grows faster than any computable func.

5 Computability Theory Automata Theory Complexity Theory

6 Complexity Theory Algorithmic Complexity Reductions P and NP NP-Completeness

7 Algorithmic Complexity Time Complexity: How long does the algorithm take to run? Space Complexity: How much memory does the algorithm require?

8 What happens when the input size gets big?

9 Big-O Notation (Algorithm Order) When input sizes get big, the largest term dominates the expression

10 Big-O Notation (Algorithm Order) When input sizes get big, the largest term dominates the expression We can describe the order of the growth function by O(largest term) 2n 2 + 3n + 7 O(n 2 )

11 Big-O Notation (Algorithm Order) When input sizes get big, the largest term dominates the expression We can describe the order of the growth function by O(largest term) 2n 2 + 3n + 7 O(n 2 ) 77n + 1 O(n)

12 Big-O Notation (Algorithm Order) When input sizes get big, the largest term dominates the expression We can describe the order of the growth function by O(largest term) 2n 2 + 3n + 7 O(n 2 ) 77n + 1 O(n) 122 O(1)

13 Big-O Notation (Algorithm Order) When input sizes get big, the largest term dominates the expression We can describe the order of the growth function by O(largest term) 2n 2 + 3n + 7 O(n 2 ) 77n + 1 O(n) 122 O(1) 3 log n + 60 O(log n)

14 Big-O Notation Formal Definition The function f(n) is a member of the set O(g(n)) if there exist positive constants c and and n 0, such that: 0 f(n) c g(n) for all n n 0

15 c g(n) f(n) n n 0

16 Is 17n n + 2 O(n 2 )?

17 Is 17n n + 2 O(n 2 )? Is 17n n + 2 O(n 157 )? Is 17n n + 2 O(2 n)?

18 Big-O Notation (Algorithm Order) O(n) is an upper bound on the growth of the function

19 Big-O Notation (Algorithm Order) O(n) is an upper bound on the growth of the function Two algorithms with the same order are considered roughly equivalent Is this always a good idea?

20 Ω-Notation Formal Definition The function f(n) is a member of the set Ω(g(n)) if there exist positive constants c and and n 0, such that: 0 c g(n) f(n) for all n n 0

21 f(n) c g(n) n n 0

22 ϴ-Notation Formal Definition The function f(n) is a member of the set ϴ(g(n)) if there exist positive constants c 1, c 2, and n 0, such that: 0 c 1 g(n) f(n) c 2 g(n) for all n n 0

23 c 2 g(n) f(n) c 1 g(n) n n 0

24 Algorithm Running Times Linear search? Binary search? Selection sort? Quicksort? Generating chess future positions? Database select query?

25 TM Running Times Input length: n Time complexity: f(n) Where f is the maximum number of steps taken by the TM for an input of size n

26 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

27 TM Example TM, M, with L(M) = {0 k 1 k } n steps M's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

28 TM Example Also, move R/W head back to TM, M, with L(M) = {0 k 1 k } beginning: n steps M's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

29 TM Example TM, M, with L(M) = {0 k 1 k } Total: 2n O(n) M's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

30 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: Crossing off one pair: O(n) 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

31 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: There are at most n/2 pairs 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

32 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: (n/2)o(n) = O(n 2 ) 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

33 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: 1. Scan across tape and reject if a 0 is found to A single the scan to check right of a 1 for extras: 2. Repeat: O(n) Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept.

34 TM Example TM, M, with L(M) = {0 k 1 k } M's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Repeat: Cross off a single 0 and a single 1 3. If extra 0's or 1's remain, then reject. Otherwise, accept. Whole algorithm: O(n) + O(n 2 ) + O(n) = O(n 2 )

35 TM with 2 Tapes Example TM, M 2, with L(M) = {0 k 1 k } M 2 's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Scan across 0's on tape 1 and copy each 0 to tape 2 3. Scan across 1's on tape 1 and cross out each 0 on tape 2 4. If we run out of 0's on tape 2 or we have extra 0's then reject. Otherwise, accept.

36 TM with 2 Tapes Example TM, M 2, with L(M) = {0 k 1 k } Time complexity? M 2 's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Scan across 0's on tape 1 and copy each 0 to tape 2 3. Scan across 1's on tape 1 and cross out each 0 on tape 2 4. If we run out of 0's on tape 2 or we have extra 0's then reject. Otherwise, accept.

37 TM with 2 Tapes Example TM, M 2, with L(M) = {0 k 1 k } Time complexity? O(n) M 2 's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Scan across 0's on tape 1 and copy each 0 to tape 2 3. Scan across 1's on tape 1 and cross out each 0 on tape 2 4. If we run out of 0's on tape 2 or we have extra 0's then reject. Otherwise, accept.

38 TM with 2 Tapes Example Time complexity depends on the computational TM, M 2, with L(M) = {0 k 1 k } model selected. M 2 's algorithm: 1. Scan across tape and reject if a 0 is found to the right of a 1 2. Scan across 0's on tape 1 and copy each 0 to tape 2 3. Scan across 1's on tape 1 and cross out each 0 on tape 2 4. If we run out of 0's on tape 2 or we have extra 0's then reject. Otherwise, accept.

39 TM with k Tapes vs. TM with 1 Tape Tape 1 Tape 2 Tape 3 a b b b a b a b a b a a a a b How long does a single tape simulation of a k-tape machine take? Single Tape a b b b a # b a b a b # a a a a b

40 TM with k Tapes vs. TM with 1 Tape Tape 1 Tape 2 Tape 3 Each single transition in the k-tape machine takes two full scans in the single-tape machine: a b b b a b a b a b a a a a b 1. Get the current location of the R/W head for each tape. 2. Actually make the required changes. Single Tape a b b b a # b a b a b # a a a a b

41 TM with k Tapes vs. TM with 1 Tape Tape 1 Tape 2 Tape 3 a b b b a b a b a b a a a a b Simulated tapes can get bigger. If the k-tape machine takes t(n) time, then the increase in used tape length is O(t(n)) Single Tape a b b b a # b a b a b # a a a a b

42 TM with k Tapes vs. TM with 1 Tape Tape 1 a b b b a Tape 2 Tape 3 b a b a b (# steps in k-tape) (cost per step in 1-tape machine) t(n) O(t(n)) = O(t 2 (n)) a a a a b Single Tape a b b b a # b a b a b # a a a a b

43 Nondeterministic TM Decider

44 Nondeterministic TM Decider To be a decider, every branch must halt.

45 Nondeterministic We can simulate a TM Decider nondeterministic TM with a deterministic TM: Build a branching tree of TM configurations in a breadth-first fashion.

46 Nondeterministic TM Decider If a ND TM has time complexity t(n), then there is a corresponding D TM with time complexity 2 O(t(n))

47 Class P P = {A: where the language A is decidable in polynomial time on a deterministic, single-tape TM} An algorithm, M, decides a language in polynomial time if: there exists an integer k 1, such that O(M) = O(n k )

48 Example 1: Find a Graph Path PATH = { G, s, e : G is a directed graph, s is the start node, e is the end node} A start B C D E end

49 Example 1: Find a Graph Path Breadth-first search PATH = { G, s, e : G is a directed from graph, start to end: s is the start node, e is the end node} O( G ) A start PATH P B C D E end

50 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that evenly divides both)} Ex: 10 and 21 are relatively prime

51 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that evenly divides both)} Ex: 10 and 21 are relatively prime Algorithm: Input x and y Try all possible divisors up to min(x,y)

52 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that evenly divides both)} Ex: 10 and 21 are relatively prime Algorithm: Input x and y Try all possible divisors up to min(x,y) Problem: 10,21 = 5, divisorstotest = 9 101,56 = 6, divisorstotest = 55

53 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that evenly divides both)} Ex: 10 and 21 are relatively prime Brute force test is Algorithm: exponential. Input x and y Try all possible divisors up to min(x,y) Problem: 10,21 = 5, divisorstotest = 9 101,56 = 6, divisorstotest = 55

54 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that evenly divides both)} A new encoding? ,1111 = 11, divisorstotest = , = 16, divisorstotest = 6

55 Example 2: Relatively Prime Doesn't look too RELPRIME = { x,y : x and y are relatively bad... prime (1 is the largest integer that even divides both)} A new encoding? ,1111 = 11, divisorstotest = , = 16, divisorstotest = 6

56 Example 2: Relatively Prime Unary encoding is RELPRIME = { x,y : x and y are relatively cheating. prime (1 is the largest integer that even divides both)} A new encoding? ,1111 = 11, divisorstotest = , = 16, divisorstotest = 6

57 Example 2: Relatively Prime RELPRIME = { x,y : x and y are relatively prime (1 is the largest integer that even divides both)} RELPRIME P Euclid's GCD Algorithm: while y!= 0: x = x % y swap(x, y) return x

58 An interesting problem E = (x 1 x x ) 2 3

59 An interesting problem Is there a combination of x's so that E is TRUE? E = (x 1 x x ) 2 3

60 An interesting problem E = (x 1 x ~x ) (x ~x x )

61 Is this solution correct? An interesting problem x = TRUE 1 x 2 = FALSE x 3 = TRUE x 4 = TRUE E = (x 1 x ~x ) (x ~x x )

62 Is this solution correct? x = TRUE 1 An interesting problem x 2 = FALSE x 3 = TRUE x 4 = TRUE E = (T F F) (F F T) E = (T) E = T (T)

63 An interesting problem It reduces to TRUE. How hard was it to E = (T F F) (F F T) test? E = (T) E = T (T)

64 An interesting problem How can we produce a set of variable values that satisfies the formula? E = (x 1 x ~x ) (x ~x x )

65 An interesting problem How can we produce a set of variable values that satisfies the formula? If n is the number of variables, we can enumerate possible solutions: = 2 n

66 Satisfiability Problem Checking whether an answer is correct isn't too bad

67 Satisfiability Problem Checking whether an answer is correct isn't too bad Finding a correct solution seems harder

68 Class NP NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B}

69 Class NP Every problem, w, in A... NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B}

70 Class NP...has a solution... NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B}

71 Class NP...that's within polynomial length of w... NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B}

72 Class NP...and the solution can be checked quickly. NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B}

73 Class NP NP = {A: if there exists a polynomial, p, and verification language B P, s.t. for all strings w: w A iff s: s p( w ) and w,s B} NP = Can be decided by a nondeterministic TM in polynomial time.

74 P NP How do we know this?

75 Does P = NP? This is the most famous unsolved problem in theoretical computer science

76 P = NP? If P = NP... Everyone who could appreciate a symphony would be Mozart; everyone who could follow a step-by-step argument would be Gauss. Scott Aaronson

77 Which one is correct?

78 Polynomial Time Reduction Given two languages, A and B, A is polynomial time reducible to B if a polynomial time function, f, exists: A P B: w A iff f(w) B

79 Polynomial Time Reduction If A P B and B P, then...

80 Polynomial Time Reduction If A P B and B P, then A P.

81 Satisfiability: a special problem Every other problem in NP can be transformed to SAT in polynomial time SAT is in the class called NP-Complete

82 NP-Complete Class Imagine you just figured out a polynomial time solution to SAT.

83 NP-Complete Class Imagine you just figured out a polynomial time solution to SAT. You can now solve any NP problem in polynomial time!

84 NP-Complete Class Imagine you just figured out a polynomial time solution to SAT. You can now solve any NP problem in polynomial time! Then: P = NP

85 Use an Oracle Think of your solution to SAT as an oracle that runs in polynomial time

86 Use an Oracle Think of your solution to SAT as an oracle that runs in polynomial time Other NP problems can simply ask your oracle for help (think function call)

87 Use an Oracle Think of your solution to SAT as an oracle that runs in polynomial time Other NP problems can simply ask your oracle for help (think function call) Since every other NP problem can be reduced to SAT in polynomial time, all can be solved in polynomial time

88 Subset Sum Problem Given a set of integers, determine if there is a non-empty subset that sums to 0. Set = {17, 2, -15, -9, 1, 22, -5}

89 Subset Sum Problem Given a set of integers, determine if there is a non-empty subset that sums to 0. Set = {17, 2, -15, -9, 1, 22, -5} Subset = {1, 2, 17, -15, -5}

90 Subset Sum Problem Given a set of integers, determine if there is a non-empty subset that sums to 0. Set = {17, 2, -15, -9, 1, 22, -5} Subset = {1, 2, 17, -15, -5} NP-Complete

91 Knapsack Problem Given a set of items each with a weight and a value, determine the maximum value while staying under a set weight limit Items = {(3 lbs, $4), (6 lbs, $2), (2 lbs, $1)}

92 Knapsack Problem 0-1 Knapsack Problem: For each item, you either take it or leave it

93 Knapsack Problem 0-1 Knapsack Problem: For each item, you either take it or leave it Unbounded Knapsack Problem: For each item, you may take as many copies of it as you like

94 Knapsack Problem 0-1 Knapsack Problem: For each item, you either take it or leave it Unbounded Knapsack Problem: For each item, you may take as many copies of it as you like Both are NP-Complete

95 L Finite Languages Regular Languages Context-Free Languages P NP Decidable Languages Enumerable Languages

96

97 P = NP A possible proof? Theorem: P = NP Proof: Set N = 1 Clearly, P = NP

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2017 http://cseweb.ucsd.edu/classes/sp17/cse105-ab/ Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION

FORMAL LANGUAGES, AUTOMATA AND COMPUTATION FORMAL LANGUAGES, AUTOMATA AND COMPUTATION DECIDABILITY ( LECTURE 15) SLIDES FOR 15-453 SPRING 2011 1 / 34 TURING MACHINES-SYNOPSIS The most general model of computation Computations of a TM are described

More information

V Honors Theory of Computation

V Honors Theory of Computation V22.0453-001 Honors Theory of Computation Problem Set 3 Solutions Problem 1 Solution: The class of languages recognized by these machines is the exactly the class of regular languages, thus this TM variant

More information

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class

CSE 105 THEORY OF COMPUTATION. Spring 2018 review class CSE 105 THEORY OF COMPUTATION Spring 2018 review class Today's learning goals Summarize key concepts, ideas, themes from CSE 105. Approach your final exam studying with confidence. Identify areas to focus

More information

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1)

Time Complexity (1) CSCI Spring Original Slides were written by Dr. Frederick W Maier. CSCI 2670 Time Complexity (1) Time Complexity (1) CSCI 2670 Original Slides were written by Dr. Frederick W Maier Spring 2014 Time Complexity So far we ve dealt with determining whether or not a problem is decidable. But even if it

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 10 More examples of problems in P Closure properties of the class P The class NP given by Jiri Srba Lecture 10 Computability and Complexity 1/12 Example: Relatively

More information

UNIT-VIII COMPUTABILITY THEORY

UNIT-VIII COMPUTABILITY THEORY CONTEXT SENSITIVE LANGUAGE UNIT-VIII COMPUTABILITY THEORY A Context Sensitive Grammar is a 4-tuple, G = (N, Σ P, S) where: N Set of non terminal symbols Σ Set of terminal symbols S Start symbol of the

More information

Part I: Definitions and Properties

Part I: Definitions and Properties Turing Machines Part I: Definitions and Properties Finite State Automata Deterministic Automata (DFSA) M = {Q, Σ, δ, q 0, F} -- Σ = Symbols -- Q = States -- q 0 = Initial State -- F = Accepting States

More information

Final exam study sheet for CS3719 Turing machines and decidability.

Final exam study sheet for CS3719 Turing machines and decidability. Final exam study sheet for CS3719 Turing machines and decidability. A Turing machine is a finite automaton with an infinite memory (tape). Formally, a Turing machine is a 6-tuple M = (Q, Σ, Γ, δ, q 0,

More information

Theory of Computation

Theory of Computation Theory of Computation Lecture #10 Sarmad Abbasi Virtual University Sarmad Abbasi (Virtual University) Theory of Computation 1 / 43 Lecture 10: Overview Linear Bounded Automata Acceptance Problem for LBAs

More information

Undecidable Problems and Reducibility

Undecidable Problems and Reducibility University of Georgia Fall 2014 Reducibility We show a problem decidable/undecidable by reducing it to another problem. One type of reduction: mapping reduction. Definition Let A, B be languages over Σ.

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Lecture 5 Reductions Undecidable problems from language theory Linear bounded automata given by Jiri Srba Lecture 5 Computability and Complexity 1/14 Reduction Informal Definition

More information

CSE 105 Theory of Computation

CSE 105 Theory of Computation CSE 105 Theory of Computation http://www.jflap.org/jflaptmp/ Professor Jeanne Ferrante 1 Today s Agenda P and NP (7.2, 7.3) Next class: Review Reminders and announcements: CAPE & TA evals are open: Please

More information

ACS2: Decidability Decidability

ACS2: Decidability Decidability Decidability Bernhard Nebel and Christian Becker-Asano 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem

More information

CISC 4090 Theory of Computation

CISC 4090 Theory of Computation CISC 4090 Theory of Computation Complexity Professor Daniel Leeds dleeds@fordham.edu JMH 332 Computability Are we guaranteed to get an answer? Complexity How long do we have to wait for an answer? (Ch7)

More information

Introduction to Languages and Computation

Introduction to Languages and Computation Introduction to Languages and Computation George Voutsadakis 1 1 Mathematics and Computer Science Lake Superior State University LSSU Math 400 George Voutsadakis (LSSU) Languages and Computation July 2014

More information

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018 CS 301 Lecture 18 Decidable languages Stephen Checkoway April 2, 2018 1 / 26 Decidable language Recall, a language A is decidable if there is some TM M that 1 recognizes A (i.e., L(M) = A), and 2 halts

More information

CPSC 421: Tutorial #1

CPSC 421: Tutorial #1 CPSC 421: Tutorial #1 October 14, 2016 Set Theory. 1. Let A be an arbitrary set, and let B = {x A : x / x}. That is, B contains all sets in A that do not contain themselves: For all y, ( ) y B if and only

More information

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG)

CS5371 Theory of Computation. Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) CS5371 Theory of Computation Lecture 12: Computability III (Decidable Languages relating to DFA, NFA, and CFG) Objectives Recall that decidable languages are languages that can be decided by TM (that means,

More information

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES

SYLLABUS. Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 3 : REGULAR EXPRESSIONS AND LANGUAGES Contents i SYLLABUS UNIT - I CHAPTER - 1 : AUT UTOMA OMATA Introduction to Finite Automata, Central Concepts of Automata Theory. CHAPTER - 2 : FINITE AUT UTOMA OMATA An Informal Picture of Finite Automata,

More information

Theory of Computation (IX) Yijia Chen Fudan University

Theory of Computation (IX) Yijia Chen Fudan University Theory of Computation (IX) Yijia Chen Fudan University Review The Definition of Algorithm Polynomials and their roots A polynomial is a sum of terms, where each term is a product of certain variables and

More information

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable?

What languages are Turing-decidable? What languages are not Turing-decidable? Is there a language that isn t even Turingrecognizable? } We ll now take a look at Turing Machines at a high level and consider what types of problems can be solved algorithmically and what types can t: What languages are Turing-decidable? What languages are

More information

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK

Undecidability COMS Ashley Montanaro 4 April Department of Computer Science, University of Bristol Bristol, UK COMS11700 Undecidability Department of Computer Science, University of Bristol Bristol, UK 4 April 2014 COMS11700: Undecidability Slide 1/29 Decidability We are particularly interested in Turing machines

More information

Friday Four Square! Today at 4:15PM, Outside Gates

Friday Four Square! Today at 4:15PM, Outside Gates P and NP Friday Four Square! Today at 4:15PM, Outside Gates Recap from Last Time Regular Languages DCFLs CFLs Efficiently Decidable Languages R Undecidable Languages Time Complexity A step of a Turing

More information

Decidability (What, stuff is unsolvable?)

Decidability (What, stuff is unsolvable?) University of Georgia Fall 2014 Outline Decidability Decidable Problems for Regular Languages Decidable Problems for Context Free Languages The Halting Problem Countable and Uncountable Sets Diagonalization

More information

Chap. 4,5 Review. Algorithms created in proofs from prior chapters

Chap. 4,5 Review. Algorithms created in proofs from prior chapters Chap. 4,5 Review Algorithms created in proofs from prior chapters (p. 55) Theorem 1.39: NFA to DFA (p. 67) Lemma 1.55: Regex to NFA (p. 69) Lemma 1.60: DFA to regex (through GNFA) (p. 112) Lemma 2.21:

More information

Theory of Computation

Theory of Computation Theory of Computation Dr. Sarmad Abbasi Dr. Sarmad Abbasi () Theory of Computation 1 / 38 Lecture 21: Overview Big-Oh notation. Little-o notation. Time Complexity Classes Non-deterministic TMs The Class

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Fall 2016 http://cseweb.ucsd.edu/classes/fa16/cse105-abc/ Logistics HW7 due tonight Thursday's class: REVIEW Final exam on Thursday Dec 8, 8am-11am, LEDDN AUD Note card allowed

More information

Chapter 7: Time Complexity

Chapter 7: Time Complexity Chapter 7: Time Complexity 1 Time complexity Let M be a deterministic Turing machine that halts on all inputs. The running time or time complexity of M is the function f: N N, where f(n) is the maximum

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY THURSDAY APRIL 3 REVIEW for Midterm TUESDAY April 8 Definition: A Turing Machine is a 7-tuple T = (Q, Σ, Γ, δ, q, q accept, q reject ), where: Q is a

More information

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY 15-453 FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY REVIEW for MIDTERM 1 THURSDAY Feb 6 Midterm 1 will cover everything we have seen so far The PROBLEMS will be from Sipser, Chapters 1, 2, 3 It will be

More information

Decidability (intro.)

Decidability (intro.) CHAPTER 4 Decidability Contents Decidable Languages decidable problems concerning regular languages decidable problems concerning context-free languages The Halting Problem The diagonalization method The

More information

CSCE 551: Chin-Tser Huang. University of South Carolina

CSCE 551: Chin-Tser Huang. University of South Carolina CSCE 551: Theory of Computation Chin-Tser Huang huangct@cse.sc.edu University of South Carolina Church-Turing Thesis The definition of the algorithm came in the 1936 papers of Alonzo Church h and Alan

More information

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved!

Announcements. Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! N P NP Announcements Problem Set 7 graded; will be returned at end of lecture. Unclaimed problem sets and midterms moved! Now in cabinets in the Gates open area near the drop-off box. The Complexity Class

More information

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) October,

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever.   ETH Zürich (D-ITET) October, Automata & languages A primer on the Theory of Computation Laurent Vanbever www.vanbever.eu ETH Zürich (D-ITET) October, 19 2017 Part 5 out of 5 Last week was all about Context-Free Languages Context-Free

More information

Complexity Theory Part I

Complexity Theory Part I Complexity Theory Part I Problem Problem Set Set 77 due due right right now now using using a late late period period The Limits of Computability EQ TM EQ TM co-re R RE L D ADD L D HALT A TM HALT A TM

More information

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction)

CS5371 Theory of Computation. Lecture 14: Computability V (Prove by Reduction) CS5371 Theory of Computation Lecture 14: Computability V (Prove by Reduction) Objectives This lecture shows more undecidable languages Our proof is not based on diagonalization Instead, we reduce the problem

More information

CS5371 Theory of Computation. Lecture 18: Complexity III (Two Classes: P and NP)

CS5371 Theory of Computation. Lecture 18: Complexity III (Two Classes: P and NP) CS5371 Theory of Computation Lecture 18: Complexity III (Two Classes: P and NP) Objectives Define what is the class P Examples of languages in P Define what is the class NP Examples of languages in NP

More information

P and NP. Or, how to make $1,000,000.

P and NP. Or, how to make $1,000,000. P and NP Or, how to make $1,000,000. http://www.claymath.org/millennium-problems/p-vs-np-problem Review: Polynomial time difference between single-tape and multi-tape TMs Exponential time difference between

More information

DM17. Beregnelighed. Jacob Aae Mikkelsen

DM17. Beregnelighed. Jacob Aae Mikkelsen DM17 Beregnelighed Jacob Aae Mikkelsen January 12, 2007 CONTENTS Contents 1 Introduction 2 1.1 Operations with languages...................... 2 2 Finite Automata 3 2.1 Regular expressions/languages....................

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 7 Distinguish between computability and complexity Articulate motivation questions

More information

CS154, Lecture 17: conp, Oracles again, Space Complexity

CS154, Lecture 17: conp, Oracles again, Space Complexity CS154, Lecture 17: conp, Oracles again, Space Complexity Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string

More information

Non-emptiness Testing for TMs

Non-emptiness Testing for TMs 180 5. Reducibility The proof of unsolvability of the halting problem is an example of a reduction: a way of converting problem A to problem B in such a way that a solution to problem B can be used to

More information

Computational Models Lecture 11, Spring 2009

Computational Models Lecture 11, Spring 2009 Slides modified by Benny Chor, based on original slides by Maurice Herlihy, Brown University. p. 1 Computational Models Lecture 11, Spring 2009 Deterministic Time Classes NonDeterministic Time Classes

More information

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages

COMP/MATH 300 Topics for Spring 2017 June 5, Review and Regular Languages COMP/MATH 300 Topics for Spring 2017 June 5, 2017 Review and Regular Languages Exam I I. Introductory and review information from Chapter 0 II. Problems and Languages A. Computable problems can be expressed

More information

Computer Sciences Department

Computer Sciences Department Computer Sciences Department 1 Reference Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Computer Sciences Department 3 ADVANCED TOPICS IN C O M P U T A B I L I T Y

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 7.2, 7.3 Distinguish between polynomial and exponential DTIME Define nondeterministic

More information

Homework 8. a b b a b a b. two-way, read/write

Homework 8. a b b a b a b. two-way, read/write Homework 8 309 Homework 8 1. Describe a TM that accepts the set {a n n is a power of 2}. Your description should be at the level of the descriptions in Lecture 29 of the TM that accepts {ww w Σ } and the

More information

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes

Complexity. Complexity Theory Lecture 3. Decidability and Complexity. Complexity Classes Complexity Theory 1 Complexity Theory 2 Complexity Theory Lecture 3 Complexity For any function f : IN IN, we say that a language L is in TIME(f(n)) if there is a machine M = (Q, Σ, s, δ), such that: L

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Nachum Dershowitz & Yishay Mansour. Tel Aviv University. May 17 22, 2017 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Space Complexity. The space complexity of a program is how much memory it uses.

Space Complexity. The space complexity of a program is how much memory it uses. Space Complexity The space complexity of a program is how much memory it uses. Measuring Space When we compute the space used by a TM, we do not count the input (think of input as readonly). We say that

More information

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET

THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET THEORY OF COMPUTATION (AUBER) EXAM CRIB SHEET Regular Languages and FA A language is a set of strings over a finite alphabet Σ. All languages are finite or countably infinite. The set of all languages

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. May 11/13, 2015 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

CS154, Lecture 10: Rice s Theorem, Oracle Machines

CS154, Lecture 10: Rice s Theorem, Oracle Machines CS154, Lecture 10: Rice s Theorem, Oracle Machines Moral: Analyzing Programs is Really, Really Hard But can we more easily tell when some program analysis problem is undecidable? Problem 1 Undecidable

More information

NP-Completeness and Boolean Satisfiability

NP-Completeness and Boolean Satisfiability NP-Completeness and Boolean Satisfiability Mridul Aanjaneya Stanford University August 14, 2012 Mridul Aanjaneya Automata Theory 1/ 49 Time-Bounded Turing Machines A Turing Machine that, given an input

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION Spring 2016 http://cseweb.ucsd.edu/classes/sp16/cse105-ab/ Today's learning goals Sipser Ch 3.3, 4.1 State and use the Church-Turing thesis. Give examples of decidable problems.

More information

CS6901: review of Theory of Computation and Algorithms

CS6901: review of Theory of Computation and Algorithms CS6901: review of Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational

More information

4.2 The Halting Problem

4.2 The Halting Problem 172 4.2 The Halting Problem The technique of diagonalization was discovered in 1873 by Georg Cantor who was concerned with the problem of measuring the sizes of infinite sets For finite sets we can simply

More information

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity

Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity CSE 531: Computational Complexity I Winter 2016 Lecture 6: Oracle TMs, Diagonalization Limits, Space Complexity January 22, 2016 Lecturer: Paul Beame Scribe: Paul Beame Diagonalization enabled us to separate

More information

Finish K-Complexity, Start Time Complexity

Finish K-Complexity, Start Time Complexity 6.045 Finish K-Complexity, Start Time Complexity 1 Kolmogorov Complexity Definition: The shortest description of x, denoted as d(x), is the lexicographically shortest string such that M(w) halts

More information

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions

Intractable Problems. Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions Intractable Problems Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions 1 Time-Bounded TM s A Turing machine that, given an input of length n, always halts within T(n) moves is said

More information

CSCE 551 Final Exam, Spring 2004 Answer Key

CSCE 551 Final Exam, Spring 2004 Answer Key CSCE 551 Final Exam, Spring 2004 Answer Key 1. (10 points) Using any method you like (including intuition), give the unique minimal DFA equivalent to the following NFA: 0 1 2 0 5 1 3 4 If your answer is

More information

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10

acs-07: Decidability Decidability Andreas Karwath und Malte Helmert Informatik Theorie II (A) WS2009/10 Decidability Andreas Karwath und Malte Helmert 1 Overview An investigation into the solvable/decidable Decidable languages The halting problem (undecidable) 2 Decidable problems? Acceptance problem : decide

More information

Complexity Theory Part II

Complexity Theory Part II Complexity Theory Part II Time Complexity The time complexity of a TM M is a function denoting the worst-case number of steps M takes on any input of length n. By convention, n denotes the length of the

More information

Time Complexity. CS60001: Foundations of Computing Science

Time Complexity. CS60001: Foundations of Computing Science Time Complexity CS60001: Foundations of Computing Science Professor, Dept. of Computer Sc. & Engg., Measuring Complexity Definition Let M be a deterministic Turing machine that halts on all inputs. The

More information

CSE 105 THEORY OF COMPUTATION

CSE 105 THEORY OF COMPUTATION CSE 105 THEORY OF COMPUTATION "Winter" 2018 http://cseweb.ucsd.edu/classes/wi18/cse105-ab/ Today's learning goals Sipser Ch 4.2 Trace high-level descriptions of algorithms for computational problems. Use

More information

Exam Computability and Complexity

Exam Computability and Complexity Total number of points:... Number of extra sheets of paper:... Exam Computability and Complexity by Jiri Srba, January 2009 Student s full name CPR number Study number Before you start, fill in the three

More information

conp, Oracles, Space Complexity

conp, Oracles, Space Complexity conp, Oracles, Space Complexity 1 What s next? A few possibilities CS161 Design and Analysis of Algorithms CS254 Complexity Theory (next year) CS354 Topics in Circuit Complexity For your favorite course

More information

Computation Histories

Computation Histories 208 Computation Histories The computation history for a Turing machine on an input is simply the sequence of configurations that the machine goes through as it processes the input. An accepting computation

More information

CS3719 Theory of Computation and Algorithms

CS3719 Theory of Computation and Algorithms CS3719 Theory of Computation and Algorithms Any mechanically (automatically) discretely computation of problem solving contains at least three components: - problem description - computational tool - analysis

More information

Reducability. Sipser, pages

Reducability. Sipser, pages Reducability Sipser, pages 187-214 Reduction Reduction encodes (transforms) one problem as a second problem. A solution to the second, can be transformed into a solution to the first. We expect both transformations

More information

P, NP, NP-Complete, and NPhard

P, NP, NP-Complete, and NPhard P, NP, NP-Complete, and NPhard Problems Zhenjiang Li 21/09/2011 Outline Algorithm time complicity P and NP problems NP-Complete and NP-Hard problems Algorithm time complicity Outline What is this course

More information

Computational Models Lecture 8 1

Computational Models Lecture 8 1 Computational Models Lecture 8 1 Handout Mode Ronitt Rubinfeld and Iftach Haitner. Tel Aviv University. April 18/ May 2, 2016 1 Based on frames by Benny Chor, Tel Aviv University, modifying frames by Maurice

More information

Testing Emptiness of a CFL. Testing Finiteness of a CFL. Testing Membership in a CFL. CYK Algorithm

Testing Emptiness of a CFL. Testing Finiteness of a CFL. Testing Membership in a CFL. CYK Algorithm Testing Emptiness of a CFL As for regular languages, we really take a representation of some language and ask whether it represents φ Can use either CFG or PDA Our choice, since there are algorithms to

More information

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar

Q = Set of states, IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar IE661: Scheduling Theory (Fall 2003) Primer to Complexity Theory Satyaki Ghosh Dastidar Turing Machine A Turing machine is an abstract representation of a computing device. It consists of a read/write

More information

CpSc 421 Final Exam December 6, 2008

CpSc 421 Final Exam December 6, 2008 CpSc 421 Final Exam December 6, 2008 Do any five of problems 1-10. If you attempt more than five of problems 1-10, please indicate which ones you want graded otherwise, I ll make an arbitrary choice. Graded

More information

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY

NODIA AND COMPANY. GATE SOLVED PAPER Computer Science Engineering Theory of Computation. Copyright By NODIA & COMPANY No part of this publication may be reproduced or distributed in any form or any means, electronic, mechanical, photocopying, or otherwise without the prior permission of the author. GATE SOLVED PAPER Computer

More information

Decidability and Undecidability

Decidability and Undecidability Decidability and Undecidability Major Ideas from Last Time Every TM can be converted into a string representation of itself. The encoding of M is denoted M. The universal Turing machine U TM accepts an

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Church s thesis The computable functions are the same as the partial recursive

More information

Computability Theory

Computability Theory CS:4330 Theory of Computation Spring 2018 Computability Theory Decidable Problems of CFLs and beyond Haniel Barbosa Readings for this lecture Chapter 4 of [Sipser 1996], 3rd edition. Section 4.1. Decidable

More information

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009

Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 CS 373: Theory of Computation Sariel Har-Peled and Madhusudan Parthasarathy Lecture 23: Rice Theorem and Turing machine behavior properties 21 April 2009 This lecture covers Rice s theorem, as well as

More information

Computability and Complexity

Computability and Complexity Computability and Complexity Decidability, Undecidability and Reducibility; Codes, Algorithms and Languages CAS 705 Ryszard Janicki Department of Computing and Software McMaster University Hamilton, Ontario,

More information

SCHEME FOR INTERNAL ASSESSMENT TEST 3

SCHEME FOR INTERNAL ASSESSMENT TEST 3 SCHEME FOR INTERNAL ASSESSMENT TEST 3 Max Marks: 40 Subject& Code: Automata Theory & Computability (15CS54) Sem: V ISE (A & B) Note: Answer any FIVE full questions, choosing one full question from each

More information

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013

AC68 FINITE AUTOMATA & FORMULA LANGUAGES DEC 2013 Q.2 a. Prove by mathematical induction n 4 4n 2 is divisible by 3 for n 0. Basic step: For n = 0, n 3 n = 0 which is divisible by 3. Induction hypothesis: Let p(n) = n 3 n is divisible by 3. Induction

More information

CS20a: Turing Machines (Oct 29, 2002)

CS20a: Turing Machines (Oct 29, 2002) CS20a: Turing Machines (Oct 29, 2002) So far: DFA = regular languages PDA = context-free languages Today: Computability 1 Handicapped machines DFA limitations Tape head moves only one direction 2-way DFA

More information

Intractable Problems [HMU06,Chp.10a]

Intractable Problems [HMU06,Chp.10a] Intractable Problems [HMU06,Chp.10a] Time-Bounded Turing Machines Classes P and NP Polynomial-Time Reductions A 10 Minute Motivation https://www.youtube.com/watch?v=yx40hbahx3s 1 Time-Bounded TM s A Turing

More information

MA/CSSE 474 Theory of Computation

MA/CSSE 474 Theory of Computation MA/CSSE 474 Theory of Computation CFL Hierarchy CFL Decision Problems Your Questions? Previous class days' material Reading Assignments HW 12 or 13 problems Anything else I have included some slides online

More information

CS481F01 Solutions 8

CS481F01 Solutions 8 CS481F01 Solutions 8 A. Demers 7 Dec 2001 1. Prob. 111 from p. 344 of the text. One of the following sets is r.e. and the other is not. Which is which? (a) { i L(M i ) contains at least 481 elements }

More information

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12

Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Student#: CISC-462 Exam, December XY, 2017 Page 1 of 12 Queen s University, Faculty of Arts and Science, School of Computing CISC-462 Final Exam, December XY, 2017 (Instructor: Kai Salomaa) INSTRUCTIONS

More information

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement:

Mapping Reducibility. Human-aware Robotics. 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: Mapping Reducibility 2017/11/16 Chapter 5.3 in Sipser Ø Announcement: q Slides for this lecture are here: http://www.public.asu.edu/~yzhan442/teaching/cse355/lectures/mapping.pdf 1 Last time Reducibility

More information

Turing Machines Part III

Turing Machines Part III Turing Machines Part III Announcements Problem Set 6 due now. Problem Set 7 out, due Monday, March 4. Play around with Turing machines, their powers, and their limits. Some problems require Wednesday's

More information

Definition: conp = { L L NP } What does a conp computation look like?

Definition: conp = { L L NP } What does a conp computation look like? Space Complexity 28 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode: Guess string y of x k length and the machine accepts

More information

Functions on languages:

Functions on languages: MA/CSSE 474 Final Exam Notation and Formulas page Name (turn this in with your exam) Unless specified otherwise, r,s,t,u,v,w,x,y,z are strings over alphabet Σ; while a, b, c, d are individual alphabet

More information

1 Showing Recognizability

1 Showing Recognizability CSCC63 Worksheet Recognizability and Decidability 1 1 Showing Recognizability 1.1 An Example - take 1 Let Σ be an alphabet. L = { M M is a T M and L(M) }, i.e., that M accepts some string from Σ. Prove

More information

6.840 Language Membership

6.840 Language Membership 6.840 Language Membership Michael Bernstein 1 Undecidable INP Practice final Use for A T M. Build a machine that asks EQ REX and then runs M on w. Query INP. If it s in P, accept. Note that the language

More information

Data Structures in Java

Data Structures in Java Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways

More information

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM

An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Turing Machines Review An example of a decidable language that is not a CFL Implementation-level description of a TM State diagram of TM Varieties of TMs Multi-Tape TMs Nondeterministic TMs String Enumerators

More information

Lecture 20: conp and Friends, Oracles in Complexity Theory

Lecture 20: conp and Friends, Oracles in Complexity Theory 6.045 Lecture 20: conp and Friends, Oracles in Complexity Theory 1 Definition: conp = { L L NP } What does a conp computation look like? In NP algorithms, we can use a guess instruction in pseudocode:

More information

Theory Bridge Exam Example Questions

Theory Bridge Exam Example Questions Theory Bridge Exam Example Questions Annotated version with some (sometimes rather sketchy) answers and notes. This is a collection of sample theory bridge exam questions. This is just to get some idea

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information