The Wayback Machine - https://web.archive.org/web/20240727085406/https://www.geeksforgeeks.org/computable-and-non-computable-problems-in-toc/
Open In App

Computable and non-computable problems in TOC

Last Updated : 12 May, 2023
Comments
Improve
Suggest changes
Like Article
Like
Save
Share
Report

Computable Problems – You are familiar with many problems (or functions) that are computable (or decidable), meaning 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. Yet there are also problems and functions that are non-computable (or undecidable or uncomputable), meaning that there exists no algorithm that can compute an answer or output for all inputs in a finite number of simple steps. (Undecidable simply means non-computable in the context of a decision problem, whose answer (or output) is either “true” or “false”). 

Non-Computable Problems – A non-computable is a problem for which there is no algorithm that can be used to solve it. The most famous example of a non-computability (or undecidability) is the Halting Problem. Given a description of a Turing machine and its initial input, determine whether the program, when executed on this input, ever halts (completes). The alternative is that it runs forever without halting. The halting problem is about seeing if a machine will ever come to a halt when a certain input is given to it or if it will finish running. This input itself can be something that keeps calling itself forever, which means that it will cause the program to run forever. Another example of an uncomputable problem is: determining whether a computer program loops forever on some input. You can replace “computer program” with “Turing machine or algorithm” if you know about the Turing machine. 

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. 

Some Examples Of Computable Problems – These are four simple examples of the computable problem:

  1. Computing the greatest common divisor of a pair of integers.
  2. Computing the least common multiple of a pair of integers.
  3. Finding the shortest path between a pair of nodes in a finite graph.
  4. Determining whether a propositional formula is a tautology.

Some Examples Of Computable Problems – State Entry Problem. Consider the problem of determining if a string ‘w’ is given to some Turing machine ‘M’ will it enter some state ‘q'(where q belongs to a set of all states in Turing machine M and string w is not equal to an empty string). Is it computable or non-computable? 

Explanation – We show the State Entry Problem is non-computable by showing that it is as hard as  The Halting Problem, which we already know is non-computable. State Entry Problem is asking us on given string w if we start from initial state of Turing machine will it reach to a state q. Now this state entry problem can be converted to a halting problem. Halting problem is whether our Turing machine ever halts, and the state entry problem is asking the same thing whether this Turing machine halts at some state q if we give string w as input to the Turing machine M. So the state entry problem is non-computable as we converted it to the halting problem which we already know is non-computable problem. So in this way, we can prove non-computability.

 

Computable Problems:
 

Computable problems are those that can be solved by an algorithm, a step-by-step procedure that can be executed by a computer. These problems have well-defined inputs and outputs, and there exists a deterministic algorithm that can produce the correct output for any given input.

Advantages:
 

 Efficiency: Computable problems can be solved efficiently using algorithms. There exist efficient algorithms for many computable problems, allowing for practical solutions.
Predictability: Since computable problems have well-defined inputs and outputs, their behavior is predictable. This makes it easier to reason about their properties and analyze their performance.

Disadvantages:
 

Limitations: Not all problems are computable. There are certain problems, such as the Halting Problem, which cannot be solved by any algorithm. These problems have undecidable properties, meaning there is no algorithm that can always produce the correct output.
Complexity: Although computable problems can be solved, the efficiency of the algorithms can vary significantly. Some problems may have solutions that are computationally expensive, requiring a large amount of time or resources to compute the result.

Non-computable Problems:
 

Non-computable problems are those that cannot be solved by any algorithm. These problems often involve undecidable properties or require infinite computational resources.

Advantages:
 

Flexibility: Non-computable problems encompass a wide range of interesting and challenging questions that cannot be answered by algorithms. They can represent fundamental questions in mathematics and logic, stimulating research and exploration.
Theoretical Insights: Non-computable problems often lead to deep theoretical insights and help establish the boundaries of what can be computed. They push the limits of our understanding of computation and inspire the development of new computational models.

Disadvantages:

Lack of Practical Solutions: Since non-computable problems cannot be solved by algorithms, there is no general method to obtain their solutions. This limits their practical applicability in real-world scenarios.
 Intractability: Non-computable problems can be inherently complex and often involve infinite computations. This makes it difficult to reason about their properties or derive meaningful results.


Previous Article
Next Article

Similar Reads

Decidability, Semi-Decidability, and Undecidability in TOC
We know about Decidable, Semi-decidable, and Undecidable problems and in this article, we will briefly define these problems and provide the most commonly asked questions on these problems and classify them accordingly. Prerequisite - https://www.geeksforgeeks.org/decidable-and-undecidable-problems-in-theory-of-computation/ Introduction :Identifyin
3 min read
Undecidability and Reducibility in TOC
Decidable Problems A problem is decidable if we can construct a Turing machine which will halt in finite amount of time for every input and give answer as ‘yes’ or ‘no’. A decidable problem has an algorithm to determine the answer for a given input. Examples Equivalence of two regular languages: Given two regular languages, there is an algorithm an
5 min read
Mealy and Moore Machines in TOC
Moore and Mealy Machines are Transducers that help in producing outputs based on the input of the current state or previous state. In this article we are going to discuss Moore Machines and Mealy Machines, the difference between these two machines as well as Conversion from Moore to Mealy and Conversion from Mealy to Moore Machines. Moore Machines
2 min read
Kleene's Theorem in TOC | Part-1
A language is said to be regular if it can be represented by using Finite Automata or if a Regular Expression can be generated for it. This definition leads us to the general definition that; For every Regular Expression corresponding to the language, a Finite Automata can be generated. For certain expressions like:- (a+b), ab, (a+b)*; It's fairly
4 min read
Determining Countability in TOC
Countable Set is a set having cardinality same as that of some subset of N the set of natural numbers . A countable set is the one which is listable. Cardinality of a countable set can be a finite number. For example, B: {1, 5, 4}, |B| = 3, in this case its termed countably finite or the cardinality of countable set can be infinite. For example, A:
3 min read
Closure properties Table in TOC
The Below Table shows the Closure Properties of Formal Languages : REG = Regular LanguageDCFL = deterministic context-free languages, CFL = context-free languages,CSL = context-sensitive languages,RC = Recursive.RE = Recursive Enumerable Consider L and M are regular languages : The Kleene star - ∑*, is a unary operator on a set of symbols or string
3 min read
Basic Theorems in TOC (Myhill nerode theorem)
The Myhill Nerode theorem is a fundamental result coming down to the theory of languages. This theory was proven by John Myhill and Anil Nerode in 1958. It is used to prove whether or not a language L is regular and it is also used for minimization of states in DFA( Deterministic Finite Automata). To understand this theorem, first we need to unders
3 min read
Stop and Wait protocol, its problems and solutions
It is the simplest flow control method in which the sender will send the packet and then wait for the acknowledgement by the receiver that it has received the packet then it will send the next packet. Stop and wait protocol is very easy to implement. Total time taken to send is, Ttotal = Tt(data) + Tp + Tq + Tprocess + Tt(ack) + Tp ( since, Tq and
2 min read
Decidable and Undecidable problems in Theory of Computation
Prerequisite - Turing Machine A problem is said to be Decidable if we can always construct a corresponding algorithm that can answer the problem correctly. We can intuitively understand Decidable problems by considering a simple example. Suppose we are asked to compute all the prime numbers in the range of 1000 to 2000. To find the solution of this
4 min read
Practice Problems on Hashing
In this article, we will discuss the types of questions based on hashing. Before understanding this, you should have idea about hashing, hash function, open addressing and chaining techniques (see: Introduction, Separate chaining, Open addressing). These are some key points in hashing: The purpose of hashing is to achieve search, insert and delete
8 min read
Article Tags :
three90RightbarBannerImg