Theory of Computation · Unit 7 · 5 hrs
Undecidability and Intractability
Exam-focused notes for Undecidability and Intractability (Theory of Computation, CSC262): what the TU syllabus asks and how it has actually been tested, with 10 solved past questions from this unit.
Undecidability and Intractability in short
This closing unit turns the Turing machine into a yardstick for measuring difficulty: first how much time and space a solvable problem needs (complexity theory), and then which problems have no algorithmic solution whatsoever, no matter how much time is allowed (computability theory and undecidability).
What this unit covers
- Computational Complexity
- Time and Space complexity of A Turing Machine
- Intractability
- Complexity Classes
- Problem and its types: Absract, Decision, Optimization
- Reducibility
- Turing Reducible
- Circuit Satisfiability
- Cook's Theorem
- Undecidability
- Undecidable Problems: Post's Correspondence Problem, Halting Problem and its proof, Undecidable Problem about Turing Machines
Undecidable Problems
2081 · 5 marks
What is undecidable problem? Discuss about Post Correspondence Problem. [5]
Complexity Classes
2081 · 5 marks
Differentiate between Class P and Class NP problem. Mention the transition function of DFA, NFA, and ε-NFA. [5]
2079 · 5 marks
Explain about the complexity classes p, NP and NP-Complete. [5]
Problem and its types
2080 · 5 marks
How abstract, decision and optimization problems are different from each other? [5]
Intractability
2079 · 5 marks
Write short notes (Any two): a) Big Oh, Big Omega and Big Theta b) Tractable and Intractable Problems c) Chomsky Hierarchy [5]
Show solved answerHide answer
Short Notes (Any Two)
a) Big Oh, Big Omega, and Big Theta
These are asymptotic notations used to describe the time or space complexity of algorithms as the input size n grows.
1. Big Oh Notation O(g(n)) -- Upper Bound
Definition: f(n) = O(g(n)) if there exist positive constants c and n₀ such that:
f(n) ≤ c · g(n) for all n ≥ n₀
- It gives the worst-case (upper bound) complexity.
- Example: If f(n) = 3n² + 2n, then f(n) = O(n²)
2. Big Omega Notation Ω(g(n)) -- Lower Bound
Definition: f(n) = Ω(g(n)) if there exist positive constants c and n₀ such that:
f(n) ≥ c · g(n) for all n ≥ n₀
- It gives the best-case (lower bound) complexity.
- Example: f(n) = 3n² + 2n, then f(n) = Ω(n²)
3. Big Theta Notation Θ(g(n)) -- Tight Bound
Definition: f(n) = Θ(g(n)) if there exist positive constants c₁, c₂, and n₀ such that:
c₁ · g(n) ≤ f(n) ≤ c₂ · g(n) for all n ≥ n₀
- It gives the average/exact (tight bound) complexity.
- f(n) = Θ(g(n)) if and only if f(n) = O(g(n)) and f(n) = Ω(g(n))
- Example: f(n) = 3n² + 2n, then f(n) = Θ(n²)
b) Tractable and Intractable Problems
Tractable Problems
- Problems that can be solved within reasonable time and space constraints are called tractable.
- An algorithm is said to be polynomially bounded if its complexity measure increases with n no more rapidly than a polynomial in n.
- Such problems belong to Class P -- solvable in polynomial time by a deterministic Turing Machine.
- Examples: Sorting, searching, shortest path (Dijkstra's algorithm)
Intractable Problems
- Problems that cannot be solved in polynomial time but require exponential time algorithms are called intractable or hard problems.
- An algorithm is exponentially bounded if its complexity grows exponentially with n.
- Formally, problems are intractable if the time required for any algorithm is at least f(n), where f is an exponential function of n.
- Intractability is the study of problems not solvable in polynomial time.
- Such problems are associated with Class NP -- solvable in polynomial time by a non-deterministic Turing Machine.
- Examples: Travelling Salesman Problem (TSP), 0/1 Knapsack, Hamiltonian Cycle
| Feature | Tractable | Intractable |
|---|---|---|
| Time complexity | Polynomial O(nᵏ) | Exponential O(2ⁿ) |
| Class | Class P | Class NP / NP-Hard |
| Solvability | Practically solvable | Not practically solvable |
c) Chomsky Hierarchy
The Chomsky Hierarchy (proposed by Noam Chomsky) classifies formal grammars and languages into four levels based on their generative power and the type of automaton required to recognize them.
| Type | Grammar | Language | Automaton |
|---|---|---|---|
| Type 0 | Unrestricted Grammar | Recursively Enumerable | Turing Machine |
| Type 1 | Context-Sensitive Grammar (CSG) | Context-Sensitive Language | Linear Bounded Automaton |
| Type 2 | Context-Free Grammar (CFG) | Context-Free Language | Pushdown Automaton |
| Type 3 | Regular Grammar | Regular Language | Finite Automaton |
Description of Each Level
Type 3 -- Regular Grammar:
- Productions of the form: A → aB or A → a
- Recognized by Finite Automata (FA)
- Least powerful; used in lexical analysis
Type 2 -- Context-Free Grammar (CFG):
- Productions of the form: A → α (where A is a single non-terminal)
- Recognized by Pushdown Automata (PDA)
- Used in programming language syntax (parsers)
Type 1 -- Context-Sensitive Grammar (CSG):
- Productions of the form: αAβ → αγβ (context matters)
- Recognized by Linear Bounded Automata (LBA)
- More powerful than CFG
Type 0 -- Unrestricted Grammar:
- No restrictions on productions
- Recognized by Turing Machines
- Most powerful; generates recursively enumerable languages
Hierarchy: Type 3 ⊂ Type 2 ⊂ Type 1 ⊂ Type 0
2078 · 5 marks
Explain the term Intractability. Is SAT problem is intractable? Justify [5]
2076 · 5 marks
What do you mean by tractable and Intractable problems? Explain with reference to TM. [5]
2080.1 · 5 marks
What is intractability? Define time and space complexity of turing machine. [5]
Show solved answerHide answer
Intractability and Time/Space Complexity of Turing Machine
Intractability
Intractability is a concept used to classify problems that cannot be solved in polynomial time but instead require exponential time algorithms.
- Problems that can be solved within reasonable time and space constraints are called tractable problems.
- Problems that cannot be solved in polynomial time but require exponential time algorithms are called intractable (or hard) problems.
An algorithm whose complexity measure increases with input size n no more rapidly than a polynomial in n is said to be polynomially bounded. An algorithm whose complexity grows exponentially is said to be exponentially bounded, and such problems fall under intractability.
Example: Problems like the Travelling Salesman Problem (decision version) are considered intractable as no known polynomial-time algorithm exists for them.
Time and Space Complexity of a Turing Machine
When a Turing Machine (TM) answers a specific instance of a decision problem:
- Time is measured as the number of moves made during computation.
- Space is measured as the number of tape squares used during computation.
The most natural measure of input size is the length of the input string. The worst case is considered, i.e., the maximum time or space required for any input string of that length.
Time Complexity
Let T be a Turing Machine. The time complexity of T is the function T_t defined on the natural numbers as:
For n ∈ N, T_t(n) is the maximum number of moves T can make on any input string of length n.
- If there exists an input string x such that |x| = n and T loops forever on input x, then T_t(n) is undefined.
Space Complexity
The space complexity of T is the function S_t defined as:
S_t(n) is the maximum number of tape squares used by T for any input string of length n.
- If T is a multi-tape TM, the number of tape squares means the maximum of the number of squares used across individual tapes.
- If for some input of length n, T loops forever, then S_t(n) is undefined.
Summary Table
| Measure | Definition |
|---|---|
| Time Complexity T_t(n) | Maximum number of moves on any input of length n |
| Space Complexity S_t(n) | Maximum number of tape squares used on any input of length n |
| Undefined when | T loops forever on some input of length n |
Note: In complexity theory, we are always more interested in the growth rate of these functions rather than their absolute values.
Time and Space complexity of A Turing Machine
2078 · 5 marks
What do you mean by computational Complexity? Explain about the time and space complexity of a Turing machine. [5]
2076 · 5 marks
Define complexity of a Turing machine. Explain about big Oh, big Omega and big Theta notation used for complexity measurement. [5]
Make Unit 7 stick
Practice CSC262 with flashcards & quizzes