Chomsky Hierarchy Languages 2. Turing Reducibility 3. The Class P
Chomsky Hierarchy Languages 2. Turing Reducibility 3. The Class P
MODULE V
The Hierarchy
(Turing-decidable)
Type 0 Unrestricted:
Rules are of the form: α → β, where α and β are arbitrary strings over a vocabulary V and
α≠ε
Type 1 Context-sensitive:
αAβ → αBβ
S→ε
where
Type 2 Context-free:
A→α
Where
A∈N
α ∈ (N ⋃ Σ)∗
Type 3 Regular:
A→ε
A→α
A → αB
where
A, B ∈ N and α ∈ Σ
If Tm’s are so damned powerful, can’t we build one that simulates the behavior of any
Tm on any tape that it is given?
We place an encoding of any Turing machine on the input tape of the Universal
Tm.
The tape consists entirely of zeros and ones (and, of course, blanks)
Any Tm is represented by zeros and ones, using unary notation for elements and
zeros as separators.
Every Tm instruction consists of four parts, each a represented as a series of 1's and
separated by 0's.
0 = 1,
1 = 11,
2 = 111,
3 = 1111,
We encode qn as n + 1 1's
1111011101111101110100101101101101100
Any Turing machine can be encoded as a unique long string of zeros and ones, beginning
with a 1.
• An oracle Turing machine with an oracle for EQTM can decide ETM
M1 has a transition from start state to reject state for every element of
• Applications
• If A T B and B is decidable, then A is decidable
• If A T B and A is undecidable, then B is undecidable
• If A T B and B is Turing-recognizable, then A is Turing-recognizable
• If A T B and A is non-Turing-recognizable, then B is non-Turing-recognizable
3. The class P
The class NP
o One way to imagine it: a parallel computer that can freely spawn an infinite
number of processes
NP-Complete Problems
• We will see that NP-Complete problems are the “hardest” problems in NP:
o If any one NP-Complete problem can be solved in polynomial time.
o Then every NP-Complete problem can be solved in polynomial time.
o And in fact every problem in NP can be solved in polynomial time (which would
show P = NP)
o Thus: solve hamiltonian-cycle in O(n100) time, you’ve proved that P = NP. Retire
rich & famous.
• The crux of NP-Completeness is reducibility
• An example:
• Another example:
• Given one NP-Complete problem, we can prove many interesting problems NP-Complete
o Hamiltonian cycle
o Hamiltonian path
o Knapsack problem
o Traveling salesman
NP Hard
Definition: Optimization problems whose decision versions are NP- complete are
called NP-hard.