7 Undecidability And Intractability

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).

Undecidability and Intractability: notes

Computational Complexity

Computational complexity studies how much of a resource, typically time or space, an abstract machine needs to solve a problem, and is only meaningful once a specific model of computation (here, the Turing machine) has been fixed as the yardstick. A problem is considered inherently difficult if every algorithm that solves it, regardless of how cleverly written, requires a large amount of some resource; complexity theory is not concerned with any one particular algorithm's performance but with the best possible algorithm for a problem. Other resource measures exist, such as the amount of inter-process communication, the number of logic gates in a circuit, or the number of parallel processors used, but time and space, measured on a Turing machine, remain the two standard measures used to classify problems.

Time and Space complexity of A Turing Machine

For a Turing machine $T$, the time complexity is the function $T_t(n)$, the maximum number of moves $T$ makes on any input of length $n$ (undefined for a length $n$ on which $T$ loops forever on some input); the space complexity is the function $T_s(n)$, the maximum number of tape cells $T$ visits on any input of length $n$ (for a multi-tape machine, the total across all tapes). Both are defined by their worst case: the resource usage is measured over every possible input of a given length, and the largest value is reported, since a problem's difficulty is judged by its hardest instances, not its easiest ones. An algorithm is polynomially bounded if its time (or space) complexity grows no faster than some polynomial in $n$, and exponentially bounded if it instead grows like $c^n$ for some constant $c>1$; this distinction is exactly what separates the tractable problems from the intractable ones, below.

Intractability

A problem is tractable if it can be solved by an algorithm whose time complexity is polynomially bounded, meaning it can be solved within reasonable time and space even as the input grows. A problem is intractable (or hard) if every known algorithm for it requires exponential time, that is, time growing at least like $c^n$ for some $c>1$; as $n$ grows, an exponential-time algorithm quickly becomes unusable even on modest inputs, while a polynomial-time algorithm remains practical. Intractability theory studies exactly this boundary, and its central open question, whether every problem solvable by guessing-and-checking in polynomial time can also be solved by direct search in polynomial time, is the famous "$P$ versus $NP$" question addressed by the classes defined next.

Complexity Classes

A complexity class collects every problem solvable within a stated resource bound on a stated model of computation, typically phrased as "problems solvable by machine model $M$ using $O(f(n))$ of resource $R$". The two foundational classes, both defined over decision problems, are:

  • Class $P$: the set of languages $L$ decided by some deterministic Turing machine whose time complexity $T(n)$ is a polynomial in $n$;
  • Class $NP$: the set of languages $L$ decided by some non-deterministic Turing machine whose time complexity is a polynomial in $n$, equivalently, the set of languages for which a proposed solution (a "certificate") can be verified in polynomial time by a deterministic machine, even if no polynomial-time method is known for finding that certificate from scratch.

Since a deterministic machine is a special case of a non-deterministic one, $P \subseteq NP$; whether this containment is strict ($P \neq NP$) is the most famous open problem in computer science. The class NP-complete sits at the hardest core of $NP$: a problem is NP-complete if it is itself in $NP$, and every other problem in $NP$ can be transformed into it by a polynomial-time reduction (defined below); consequently, if even one NP-complete problem were shown solvable in polynomial time, every problem in $NP$ would be, and $P$ would equal $NP$.

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]

--- A problem is undecidable if there is no Turing machine which will always halt in a finite amount of time to give an answer as 'yes' or 'no'. An undecidable problem has no algorithm to determine the answer for a given input. More formally, an undecidable problem is a decision problem for which...

Open this answer on its own page →

Complexity Classes

2081 · 5 marks

Differentiate between Class P and Class NP problem. Mention the transition function of DFA, NFA, and ε-NFA. [5]

--- Basis Class P Class NP --------- Full Form Polynomial Time Non-deterministic Polynomial Time Definition Set of decision problems solvable by a deterministic Turing machine in polynomial time O(n^k) Set of decision problems solvable by a non-deterministic Turing machine in polynomial time Trac...

Open this answer on its own page →

2079 · 5 marks

Explain about the complexity classes p, NP and NP-Complete. [5]

P (Polynomial Time) is the class of decision problems that can be solved by a deterministic Turing machine in polynomial time with respect to the input size n. - A problem belongs to P if there exists an algorithm that solves it in O(n^k) time for some constant k. - These are considered efficient...

Open this answer on its own page →

Problem and its types

2080 · 5 marks

How abstract, decision and optimization problems are different from each other? [5]

An abstract problem is a general, mathematical formulation of a computational problem. It defines a relationship between a set of problem instances (inputs) and a set of solutions (outputs), without restricting the form of the answer. - The solution can be any value, object, or structure (not jus...

Open this answer on its own page →

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 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
FeatureTractableIntractable
Time complexityPolynomial O(nᵏ)Exponential O(2ⁿ)
ClassClass PClass NP / NP-Hard
SolvabilityPractically solvableNot 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.

TypeGrammarLanguageAutomaton
Type 0Unrestricted GrammarRecursively EnumerableTuring Machine
Type 1Context-Sensitive Grammar (CSG)Context-Sensitive LanguageLinear Bounded Automaton
Type 2Context-Free Grammar (CFG)Context-Free LanguagePushdown Automaton
Type 3Regular GrammarRegular LanguageFinite 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

Open this answer on its own page →

2078 · 5 marks

Explain the term Intractability. Is SAT problem is intractable? Justify [5]

Definition: Intractability is a concept in computational complexity theory that classifies problems based on the time and space resources required to solve them. - Problems that can be solved within reasonable time and space constraints (i.e., in polynomial time) are called tractable problems. - ...

Open this answer on its own page →

2076 · 5 marks

What do you mean by tractable and Intractable problems? Explain with reference to TM. [5]

A problem is said to be tractable if it can be solved within reasonable time and space constraints. More formally, a problem is tractable if there exists an algorithm whose complexity (time and space) grows no more rapidly than a polynomial function of the input size n. - An algorithm satisfying ...

Open this answer on its own page →

2080.1 · 5 marks

What is intractability? Define time and space complexity of turing machine. [5]

Show solved 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

MeasureDefinition
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 whenT 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.

Open this answer on its own page →

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]

The complexity of computational problems is discussed by choosing a specific abstract machine as a model of computation and considering how much resource a machine of that type requires for the solution of a given problem. - A Complexity Measure is a means of measuring the resources used during a...

Open this answer on its own page →

2076 · 5 marks

Define complexity of a Turing machine. Explain about big Oh, big Omega and big Theta notation used for complexity measurement. [5]

The complexity of a Turing Machine refers to the measurement of resources (primarily time and space) used during a computation. When a Turing Machine answers a specific instance of a decision problem: - Time is measured as the number of moves made by the TM. - Space is measured as the number of t...

Open this answer on its own page →