The Wayback Machine - https://web.archive.org/web/20260119143559/https://www.geeksforgeeks.org/theory-of-computation/computable-and-non-computable-problems-in-toc/

Computable and non-computable problems in TOC

Last Updated : 14 Jan, 2026

Problems are classified as computable or non-computable based on whether they can be solved by an algorithm. Computable problems have a clear, step-by-step procedure that always lead to a correct solution while non-computable problems cannot be solved by any algorithm, no matter how much time or resources are given.

Computable Problems

A problem (or function) is computable (or decidable), it means there exists some algorithm that computes an answer (or output) to any instance of the problem (or for any input to the function) in a finite number of simple steps. A simple example is the integer increment operation:

f(x) = x + 1

It should be intuitive that given any integer x, we can compute x + 1 in a finite number of steps. Since x is finite, it may be represented by a finite string of digits. Using the addition method (or algorithm) we all learned in school, we can clearly compute another string of digits representing the integer equivalent to x + 1.

Examples of Computable Problems

These are four simple examples of the computable problem:

  • Computing the greatest common divisor of a pair of integers.
  • Computing the least common multiple of a pair of integers.
  • Finding the shortest path between a pair of nodes in a finite graph.
  • Determining whether a propositional formula is a tautology.
Advantages Disadvantages
Efficient algorithms exist for many computable problemsSome computable problems require very high computation time
Provide practical and reliable solutionsLarge memory or resources may be required
Well-defined inputs and outputs make behavior predictablePerformance degrades for very large inputs
Easy to analyze and verify correctnessNot all computable problems are practically feasible

Non-Computable Problems

A non-computable problem is one for which no algorithm can always give a correct solution. The most famous example is the Halting Problem, which asks whether a program (or Turing machine) will stop or run forever for a given input. Since some programs may loop infinitely, no general algorithm can solve this problem for all cases.

  • A non-computable problem cannot be solved by any algorithm.
  • The Halting Problem is the most famous example of a non-computable problem.
  • It determines whether a program halts or runs forever for a given input.
  • Programs that loop infinitely make this problem undecidable.
  • The term “computer program” can be replaced by “Turing machine” or “algorithm”.

Examples of Non-Computable Problems

Halting Problem
The problem of determining whether a program (or Turing machine) will halt or run forever for a given input is non-computable. No algorithm can solve this problem for all possible programs and inputs.

Advantages Disadvantages
Cover deep questions beyond algorithmic solutionsNo algorithm exists to solve them
Encourage research in math, logic, and computationCannot be applied directly to real-world tasks
Help define the limits of machine computationOften involve infinite or undefined computations
Lead to new theories and computational modelsDifficult to analyze or verify conclusively

Proving Computability or Non-Computability

We can show that a problem is computable by describing a procedure and proving that the procedure always terminates and always produces the correct answer. It is enough to provide a convincing argument that such a procedure exists. Finding the actual procedure is not necessary (but often helps to make the argument more convincing).

  • To show that a problem is not computable, we need to show that no algorithm exists that solves the problem.
  • Since there are an infinite number of possible procedures, we cannot just list all possible procedures and show why each one does not solve the problem.
  • Instead, we need to construct an argument showing that if there were such an algorithm, it would lead to a contradiction.
  • The core of our argument is based on knowing the Halting Problem is non-computable.
  • If a solution to some new problem P could be used to solve the Halting Problem, then we know that P is also non-computable.
  • That is, no algorithm exists that can solve P since if such an algorithm exists, it could be used to also solve the Halting Problem, which we already know is impossible.
  • The proof technique where we show that a solution for some problem P can be used to solve a different problem Q is known as a reduction.
  • A problem Q is reducible to a problem P if a solution to P could be used to solve Q.
  • This means that problem Q is no harder than problem P since a solution to problem Q leads to a solution to problem P. 


Comment

Explore