Turing Machines and Decidability
This chapter rigorously introduces Turing Machines as the universal model of computation, laying the theoretical groundwork for understanding algorithmic limits. It systematically distinguishes between computable and noncomputable functions and establishes the fundamental concepts of decidability and undecidability. Mastery of these principles is critical for advanced examinations in theoretical computer science, forming a cornerstone of the M.Sc./Ph.D. curriculum.
---
Chapter Contents
|
| Topic |
|---|-------| | 1 | Computable and Noncomputable Functions | | 2 | Basics of Decidability |---
We begin with Computable and Noncomputable Functions.
Part 1: Computable and Noncomputable Functions
This unit explores the theoretical limits of computation, identifying problems that cannot be solved by any algorithm and classifying functions based on their computability. Understanding these boundaries is crucial for advanced computer science.
---
Core Concepts
1. Turing Machines and Computable Functions
A Turing Machine (TM) is a mathematical model of computation that defines an abstract machine manipulating symbols on a strip of tape according to a table of rules. A function is computable (or recursive) if there exists a Turing Machine that, for every input in the domain of , halts with on its tape.
A function is computable if there exists a Turing Machine such that for every in the domain of , halts on input with on its tape. If is not in the domain of , either halts with an error or does not halt.
Worked Example:
Consider the function for a non-negative integer , represented in unary. We demonstrate a conceptual Turing Machine that computes this function.
Step 1: Initial configuration
The input tape contains '1's, followed by a blank symbol, e.g., `_111_` for .
>
Step 2: Move to the rightmost '1'
The TM moves its head to the right, skipping all '1's, until it finds the first blank symbol.
>
Step 3: Overwrite the blank with '1'
The TM replaces the blank symbol with a '1'.
>
Step 4: Move left and halt
The TM moves its head one position to the left, then halts in an accepting state.
>
Answer: The TM successfully computes by adding an additional '1' to the unary representation of .
:::question type="MCQ" question="Which of the following best describes a computable function?" options=["A function whose output can be described by a finite set of rules.","A function for which there exists a Turing Machine that halts on all inputs with the correct output.","A function that can be computed by any physical computer.","A function that can be expressed using only basic arithmetic operations."] answer="A function for which there exists a Turing Machine that halts on all inputs with the correct output." hint="Recall the formal definition of a computable function in the context of Turing Machines." solution="A computable function is formally defined as one for which a Turing Machine exists that can compute its output for all inputs in its domain. The option 'halts on all inputs with the correct output' aligns with a total computable function, which is a common interpretation when not specified as partial. The other options are either too vague or incorrect in the formal sense of computability theory. For a partial computable function, the TM may not halt if the input is outside its domain."
:::
---
2. Church-Turing Thesis
The Church-Turing Thesis states that any function that can be computed by an algorithm can be computed by a Turing Machine. It asserts the equivalence of all "reasonable" models of computation with the Turing Machine model. This is a thesis, not a theorem, as it relates a formal concept (Turing Machine) to an informal one (algorithm).
Any function that can be computed by an effective procedure (an algorithm) can be computed by a Turing Machine. Conversely, any function computable by a Turing Machine is considered computable by an algorithm.
Worked Example:
Consider a problem of finding the shortest path in a graph using Dijkstra's algorithm.
Step 1: Algorithm definition
Dijkstra's algorithm is a well-defined sequence of steps to find the shortest path. It involves graph traversal, distance updates, and priority queue operations.
>
Step 2: Implication of Church-Turing Thesis
Since Dijkstra's algorithm is a precise, step-by-step procedure that can be executed mechanically, the Church-Turing Thesis implies that a Turing Machine exists that can simulate this algorithm.
>
Answer: The Church-Turing Thesis implies that if an algorithm exists for a problem, a Turing Machine can solve it. Therefore, a Turing Machine can compute the shortest path in a graph using Dijkstra's algorithm.
:::question type="MCQ" question="What is the primary implication of the Church-Turing Thesis?" options=["All functions can be computed by a Turing Machine.","Turing Machines are the most powerful computational model known.","Any problem solvable by an algorithm can be solved by a Turing Machine.","Computers will eventually be able to solve all mathematical problems."] answer="Any problem solvable by an algorithm can be solved by a Turing Machine." hint="The thesis connects the informal notion of an 'algorithm' to the formal model of a 'Turing Machine'." solution="The Church-Turing Thesis posits that the class of functions computable by any 'effective method' (i.e., algorithm) is exactly the class of functions computable by a Turing Machine. This means that if we can describe an algorithm for a problem, a Turing Machine can solve it. It does not claim that all functions are computable, nor does it make predictions about future computer capabilities."
:::
---
3. Universal Turing Machine
A Universal Turing Machine (UTM) is a special Turing Machine that can simulate the behavior of any other arbitrary Turing Machine on any arbitrary input. It takes as input a description of another Turing Machine and an input for , and then simulates 's behavior on .
A Turing Machine is universal if, given an encoding of any Turing Machine and an input , halts on input with the same output as would produce on .
Worked Example:
Consider a UTM operating on an input tape that contains the encoded description of a Turing Machine and its input .
Step 1: Input tape configuration
The tape is divided into sections: one for 's description, one for 's current tape content, and one for 's current state.
>
w \
q_i
Step 2: Simulation cycle
The UTM reads 's current state and the symbol under 's simulated head. It then consults 's encoded transition function .
>
Step 3: Update 's simulated configuration
Based on , updates 's simulated tape content, moves 's simulated head, and changes 's simulated state. This cycle repeats.
>
Answer: The UTM effectively simulates on by interpreting 's rules and applying them to 's simulated tape, demonstrating its role as a general-purpose computer.
:::question type="MCQ" question="What is the primary function of a Universal Turing Machine?" options=["To solve the Halting Problem for any Turing Machine.","To compile high-level programming languages into machine code.","To simulate any arbitrary Turing Machine on any given input.","To prove the undecidability of certain computational problems."] answer="To simulate any arbitrary Turing Machine on any given input." hint="The 'universal' aspect implies it can act like any other TM." solution="A Universal Turing Machine (UTM) is designed to take the description of any other Turing Machine and an input for , and then simulate 's computation on . This makes it a general-purpose computer, capable of performing any computation that any other TM can perform."
:::
---
4. Undecidability and Noncomputable Functions
A problem is undecidable if no algorithm (Turing Machine) exists that can solve it for all possible inputs. A function is noncomputable if no Turing Machine can compute it. These concepts define the limits of what computers can do.
A decision problem is undecidable if its language is not a recursive language. That is, no Turing Machine exists that halts on all inputs and correctly determines membership in the language.
Worked Example:
Consider the problem of determining if a given C++ program will ever output the string "Hello World!".
Step 1: Formulate as a decision problem
We want to know if for a given program , does output "Hello World!"? This is a yes/no question.
>
Step 2: Consider the nature of the problem
To solve this, a hypothetical algorithm would need to analyze the program's execution path, including loops, conditional statements, and function calls, for all possible inputs to . This involves predicting the program's behavior over potentially infinite execution paths.
>
Answer: This problem is undecidable. An algorithm cannot, in general, determine if an arbitrary program will ever print a specific string because it would require solving a variant of the Halting Problem or a related undecidable property (like a non-trivial semantic property of programs, as per Rice's Theorem).
:::question type="MCQ" question="Which of the following is an example of an undecidable problem?" options=["Determining if a given string is a palindrome.","Determining if a given context-free grammar is ambiguous.","Determining if a given regular expression generates an infinite language.","Determining if a given finite automaton accepts a particular string."] answer="Determining if a given context-free grammar is ambiguous." hint="Undecidable problems often involve infinite state spaces or properties that require simulating arbitrary computation." solution="Determining if a given context-free grammar is ambiguous is a known undecidable problem. The other options are decidable: palindromes can be checked by a simple algorithm, regularity of infinite languages is decidable, and FA acceptance is decidable (e.g., by simulating the FA or constructing a product automaton)."
:::
---
5. The Halting Problem
The Halting Problem asks whether, given a description of an arbitrary Turing Machine and an input , will halt (finish its computation) or run forever when started on . This problem is famously undecidable.
The language is undecidable.
Worked Example: Proof by contradiction for the Halting Problem.
Step 1: Assume is a decider for
Suppose there exists a Turing Machine that decides the Halting Problem. takes as input and halts, accepting if halts on , and rejecting if does not halt on .
>
Step 2: Construct a new TM,
Using , construct a new Turing Machine that takes an encoding of a TM as input. does the following:
>
Step 3: Run on its own description
Now, consider what happens when is run with its own description as input.
>
Step 4: Analyze the outcome
>
Answer: Both possible outcomes lead to a contradiction. Therefore, our initial assumption that exists must be false. The Halting Problem is undecidable.
:::question type="MCQ" question="The Halting Problem asks whether a given Turing Machine will halt on a given input . Why is this problem considered undecidable?" options=["Because it requires an infinite amount of memory.","Because no algorithm can exist that determines for all and if halts on .","Because the input can be arbitrarily long.","Because it is impossible to write a program that simulates another program."] answer="Because no algorithm can exist that determines for all and if halts on ." hint="Recall the proof by contradiction, which demonstrates the impossibility of such an algorithm." solution="The Halting Problem is undecidable because it has been proven, typically through a diagonalization argument (as shown in the worked example), that no Turing Machine (and by the Church-Turing Thesis, no algorithm) can exist that can correctly determine for all possible pairs of Turing Machine and input whether will halt or loop indefinitely on . The other options are incorrect; memory is not the core issue, input length is handled by TMs, and program simulation is possible (Universal TM)."
:::
---
6. Reducibility
Reducibility is a technique used to prove the undecidability of problems. If problem can be reduced to problem (denoted ), and is known to be undecidable, then must also be undecidable. This means an algorithm for could be used to solve , which is a contradiction.
Language is many-one reducible to language if there is a computable function such that for every string , if and only if .
Worked Example: Proving that is undecidable.
Step 1: Assume is decidable
Suppose there exists a decider TM for . This means halts on all inputs and accepts if does not halt on , and rejects otherwise.
>
Step 2: Construct a decider for using
We know is the complement of . If decides , we can construct a decider for as follows:
>
Step 3: Contradiction
The constructed TM is a decider for . However, we know from the Halting Problem that is undecidable. This is a contradiction.
>
>
Answer: Since our assumption leads to a contradiction, must be undecidable. This demonstrates a reduction from to 's complement, showing that if were decidable, would also be, which is false. (More formally, ).
:::question type="MCQ" question="Given that problem is undecidable and there is a computable function that transforms any instance of into an instance of problem such that . What can be concluded about problem ?" options=["Problem is decidable.","Problem is also undecidable.","Problem is finite.","Problem is always easier to solve than problem ."] answer="Problem is also undecidable." hint="If a solution for existed, it could be used to solve , contradicting 's undecidability." solution="If problem is undecidable and (meaning is many-one reducible to ), then must also be undecidable. If were decidable, we could use its decider to decide by first applying the reduction function and then feeding the result to 's decider. This would mean is decidable, which contradicts our premise that is undecidable. Therefore, must be undecidable."
:::
---
7. Rice's Theorem
Rice's Theorem is a powerful result in computability theory that states that any non-trivial property of the language recognized by a Turing Machine is undecidable. A property is non-trivial if it is true for some recursively enumerable languages but false for others. It is a property of the language, not of the TM's implementation.
Any non-trivial property of the language recognized by a Turing Machine is undecidable.
Worked Example: Proving that the property of a TM recognizing a regular language is undecidable.
Step 1: Define the property
Let be the property: "The language recognized by TM , , is a regular language."
>
Step 2: Check if is a property of the language
The property "being regular" depends only on the language , not on the specific Turing Machine that recognizes it. If two different TMs recognize the same language, they either both have this property or both don't.
>
Step 3: Check if is non-trivial
Consider . This is a regular language. So, is true for some TM .
>
>
Answer: Since is a non-trivial property of the language recognized by a Turing Machine, by Rice's Theorem, the problem of determining if is regular is undecidable.
:::question type="MCQ" question="According to Rice's Theorem, which of the following properties of a Turing Machine's language is undecidable?" options=["Is finite?","Does halt on the empty string?","Is empty?","Does have exactly 5 states?"] answer="Is empty?" hint="Rice's Theorem applies to properties of the language recognized by the TM, not properties of the TM itself. Also, the property must be non-trivial." solution="Rice's Theorem states that any non-trivial property of the language recognized by a Turing Machine is undecidable.
The question asks for an undecidable property according to Rice's Theorem. Both 'Is finite?' and 'Is empty?' fit this. Let's re-evaluate the options. Usually, Rice's theorem is used to show properties like emptiness, finiteness, regularity, context-freeness, etc., are undecidable.
Given the common examples, 'Is empty?' (also known as ) is a classic example of an undecidable problem proven by reduction from , and also directly falls under Rice's Theorem as a non-trivial property of the language. It is true for and false for any non-empty language.
So, 'Is empty?' is a correct answer according to Rice's Theorem. (Note: 'Is finite?' is also undecidable by Rice's Theorem, but often one typical example is expected.)"
:::
---
8. Post Correspondence Problem (PCP)
The Post Correspondence Problem (PCP) is an undecidable decision problem that asks whether a given list of pairs of non-empty strings has a "match." A match is a sequence of indices such that concatenating the strings from the first component of the pairs in that sequence results in the same string as concatenating the strings from the second component.
Given a list of pairs of non-empty strings , a match is a non-empty sequence of indices such that . The problem is to determine if such a match exists.
Worked Example: Determine if a match exists for the following instance of PCP.
Let .
Step 1: Try combinations of indices
We need to find a sequence of indices such that .
>
>
>
Step 2: Start with a single pair
* If we start with index 1: , . is longer. We need to add more strings to to catch up.
* If we start with index 2: , . is longer.
* If we start with index 3: , . is longer.
Step 3: Try a sequence of indices
Let's try sequence (1, 2):
No match.
Let's try sequence (3, 1):
No match.
Let's try sequence (1, 3):
No match.
Consider sequence (1, 2, 1):
No match.
Consider sequence (2, 1):
No match.
Consider sequence (3, 2):
No match.
Step 4: A systematic search (often required for actual solutions)
Let's try to build a match:
Start with (1): . Need to add to .
Next, choose a pair where starts with 'b' to match 's next char. Pair 2: .
Sequence (1, 2): , . Need to add to .
Next, choose a pair where starts with 'b'. Pair 2 again: .
Sequence (1, 2, 2): , . Need to add to .
This is getting longer for side.
Let's rethink. We want to balance lengths.
If is shorter than , we pick it to make longer.
If is longer than , we pick it to make longer.
Consider .
Try (1): . is longer.
Need to add to . The current string on is `abb`. The suffix `b` needs to be matched.
If we append (2):
Now is much longer.
Let's try sequence (2, 1):
No match.
Let's try sequence (1, 3):
No match.
The given example actually does not have a match. This is a common situation for undecidable problems: finding a match can be hard, and proving no match exists is even harder (and generally undecidable). For a worked example, it's better to show one with a match or clearly state it's undecidable.
Let's use a simpler example that does have a match.
Let .
Step 1: Try combinations
* (1): . is longer.
* (2): . is longer.
* (3): . is longer.
Step 2: Try to balance lengths
If we start with (1): . We need to make longer.
Current ends with '0'. Next needs to start with '0'.
Try (1, 3):
We found a match! The sequence is (1, 3).
Answer: A match exists for with the sequence of indices (1, 3).
:::question type="MCQ" question="Which of the following statements about the Post Correspondence Problem (PCP) is true?" options=["PCP is decidable for instances with only two pairs of strings.","PCP is undecidable in its general form.","PCP can always be solved by a finite automaton.","PCP is decidable if all strings are of equal length."] answer="PCP is undecidable in its general form." hint="PCP is a classic example of an undecidable problem, often used in reductions." solution="The Post Correspondence Problem (PCP) is famously undecidable in its general form. This means there is no algorithm that can determine for all possible instances of PCP whether a match exists or not. While specific restricted versions of PCP might be decidable, the general problem is not."
:::
---
9. Recursive and Recursively Enumerable Languages
Languages can be classified based on the capabilities of Turing Machines. A language is recursively enumerable (RE) if there exists a Turing Machine that accepts all strings in the language and either rejects or loops forever for strings not in the language. A language is recursive (or decidable) if there exists a Turing Machine that halts on all inputs, accepting strings in the language and rejecting strings not in the language.
A language is recursive if there exists a Turing Machine that decides . That is, for every , halts and accepts if , and halts and rejects if .
A language is recursively enumerable if there exists a Turing Machine that recognizes . That is, for every , halts and accepts if . If , either halts and rejects or loops forever.
Worked Example: Distinguishing between recursive and RE languages.
Consider the language and .
Step 1: Analyze
For any string , we can construct a TM that checks if is of the form .
This TM will always halt, either accepting or rejecting.
>
Step 2: Analyze
For , we know from the Halting Problem that no Turing Machine can decide it (i.e., halt on all inputs and give a correct yes/no answer). However, we can construct a TM that recognizes :
>
Answer: is a recursive language because a TM can always decide its membership. (HALT) is a recursively enumerable language because a TM can recognize it (accept if in , but loop if not in ), but it is not recursive because no TM can decide it.
:::question type="MCQ" question="Which of the following statements correctly characterizes the relationship between recursive and recursively enumerable languages?" options=["All recursively enumerable languages are also recursive.","All recursive languages are also recursively enumerable.","Recursive languages are a proper superset of recursively enumerable languages.","Recursively enumerable languages are always context-free."] answer="All recursive languages are also recursively enumerable." hint="Consider the definitions: a decider TM is also a recognizer TM." solution="By definition, a recursive language has a Turing Machine that halts on all inputs, accepting if the string is in the language and rejecting otherwise. Such a TM is also a recognizer (it accepts strings in the language). Therefore, all recursive languages are also recursively enumerable. However, not all recursively enumerable languages are recursive (e.g., the Halting Problem language is RE but not recursive)."
:::
---
10. Properties of Recursive and RE Languages
Recursive and Recursively Enumerable languages have specific closure properties under set operations like union, intersection, concatenation, Kleene star, and complementation. These properties are important for constructing new languages from existing ones and understanding their classification.
| Operation | Recursive Languages | Recursively Enumerable Languages |
| :--------------- | :------------------ | :------------------------------- |
| Union | Closed | Closed |
| Intersection | Closed | Closed |
| Concatenation | Closed | Closed |
| Kleene Star | Closed | Closed |
| Complementation | Closed | NOT Closed |
Worked Example: Proving that the union of two RE languages is also RE.
Step 1: Define two RE languages and their recognizers
Let and be two recursively enumerable languages. By definition, there exist Turing Machines that recognizes and that recognizes .
>
Step 2: Construct a TM for
We want to build a TM that recognizes . For an input :
>
>
>
>
Step 3: Analyze 's behavior
If , will eventually accept. Since is simulated in an interleaved fashion, will eventually detect 's acceptance and accept .
If , will eventually accept. will detect 's acceptance and accept .
If , then is in at least one of or , so will eventually accept.
If , then neither nor will accept . Both might loop or reject. In this case, will also loop or reject.
>
>
Answer: Since recognizes , the union of two RE languages is recursively enumerable.
:::question type="MCQ" question="Which of the following operations is NOT closed for recursively enumerable languages?" options=["Union","Intersection","Concatenation","Complementation"] answer="Complementation" hint="Consider the relationship between RE languages and recursive languages, especially regarding decidability." solution="Recursively enumerable (RE) languages are closed under union, intersection, and concatenation. However, they are NOT closed under complementation. The complement of an RE language is not necessarily RE. For example, is RE, but its complement (the set of where does not halt on ) is not RE. If both an RE language and its complement were RE, then the language would be recursive (decidable)."
:::
---
Advanced Applications
Worked Example: Using reduction and Rice's Theorem to prove undecidability.
Prove that the language is undecidable.
Step 1: Apply Rice's Theorem
We need to check if represents a non-trivial property of the language recognized by a Turing Machine.
* Is it true for some RE languages? Yes, for example, is a finite language. So .
Is it false for some RE languages? Yes, for example, is an infinite language. So .
>
Step 2: Conclusion from Rice's Theorem
Since represents a non-trivial property of RE languages, by Rice's Theorem, is undecidable.
Answer: The language is undecidable because it corresponds to a non-trivial property of recursively enumerable languages, making it directly subject to Rice's Theorem.
:::question type="NAT" question="Consider the language . If is undecidable, what is the minimum number of distinct, non-trivial properties of RE languages that are known to be undecidable, including itself, that can be directly derived from Rice's Theorem?" answer="1" hint="Rice's Theorem itself guarantees the undecidability of any non-trivial property. The question asks for the minimum number of distinct properties. If is one such property, that counts as one." solution="Rice's Theorem states that any non-trivial property of the language recognized by a Turing Machine is undecidable. is one such non-trivial property (it's true for the TM that accepts no strings, false for the TM that accepts at least one string). Therefore, at least one such property (namely, itself) is known to be undecidable. The question asks for the minimum number of distinct properties, and is one distinct property. The answer is 1."
:::
---
Problem-Solving Strategies
When asked to prove a problem is undecidable, the most common strategies are:
- Diagonalization: Directly construct a contradiction, similar to the Halting Problem proof. This is usually for foundational undecidable problems.
- Reduction: Reduce a known undecidable problem (like or ) to the problem in question. If you can show that if you could solve the new problem, you could also solve the known undecidable problem, then the new problem must also be undecidable.
- Rice's Theorem: If the problem asks about a property of the language recognized by a Turing Machine, check if that property is non-trivial. If it is, Rice's Theorem directly implies undecidability.
---
Common Mistakes
❌ Confusing recursively enumerable (RE) languages with recursive (decidable) languages.
✅ All recursive languages are RE, but not all RE languages are recursive. Recursive languages have decider TMs that always halt. RE languages have recognizer TMs that halt and accept for strings in the language but may loop forever for strings not in the language.
❌ Applying Rice's Theorem to properties of the Turing Machine itself (e.g., "Does have an even number of states?").
✅ Rice's Theorem applies ONLY to properties of the language recognized by the Turing Machine (e.g., "Is regular?", "Is empty?"). Properties of the TM's description are often decidable.
---
Practice Questions
:::question type="MCQ" question="Which of the following problems is decidable?" options=["Determining if contains at least 5 strings, for a given TM .","Determining if a given Turing Machine halts on all inputs.","Determining if a given regular expression generates a finite language.","Determining if for two TMs ."] answer="Determining if a given regular expression generates a finite language." hint="Decidable problems have algorithms that always halt and give a correct answer. Consider the properties of different language classes." solution="1. 'Determining if contains at least 5 strings' is a non-trivial property of the language, hence undecidable by Rice's Theorem.
:::
:::question type="NAT" question="Consider a language . Is decidable or undecidable? If undecidable, how many distinct, known undecidable problems (including itself, if applicable) can be cited as direct evidence, assuming it is proven via reduction from or ?" answer="1" hint="The problem asks about the acceptance of a specific string by a TM. This is a property of the TM's behavior, not just its language, but it can still be undecidable." solution="The language is undecidable. This is a specific instance of the acceptance problem for Turing Machines, , which is known to be undecidable. is a special case of where .
To prove (and thus ) is undecidable, we typically reduce the Halting Problem () to it. This means . The problem asks for the number of distinct, known undecidable problems that can be cited as direct evidence if proven via reduction from or . In this case, (or ) is the single direct known undecidable problem used for the reduction. So the answer is 1."
:::
:::question type="MSQ" question="Select ALL true statements regarding noncomputable functions." options=["A noncomputable function cannot be computed by any Turing Machine.","The domain of a noncomputable function is always infinite.","The Halting Problem is an example of a noncomputable function (when formulated as a decision problem).","Noncomputable functions are those that require infinite time to compute for any input."] answer="A noncomputable function cannot be computed by any Turing Machine.,The Halting Problem is an example of a noncomputable function (when formulated as a decision problem)." hint="Recall the definition of a noncomputable function and the nature of the Halting Problem." solution="1. A noncomputable function cannot be computed by any Turing Machine. This is the definition of a noncomputable function. (Correct)
:::
:::question type="MCQ" question="Given an instance of the Post Correspondence Problem (PCP) . Does a match exist?" options=["Yes, using sequence (1, 2)","Yes, using sequence (3, 1)","No, a match does not exist.","Yes, using sequence (1, 3)"] answer="Yes, using sequence (1, 3)" hint="Try concatenating sequences of and to find a match." solution="Let the pairs be:
Let's test the options:
- (1, 2):
No match.
- (3, 1):
- (1, 3):
Therefore, a match exists using sequence (1, 3)."
:::
:::question type="MCQ" question="Which of the following is an example of a partial computable function that is not total computable?" options=["The function for .","The function that returns the -th prime number.","The function that returns 1 if TM halts on , and is undefined otherwise.","The function for . "] answer="The function that returns 1 if TM halts on , and is undefined otherwise." hint="A partial computable function may not be defined for all inputs in its theoretical domain, meaning the TM may not halt for those inputs." solution="1. is a total computable function, defined for all natural numbers.
:::
---
Summary
|
| Formula/Concept | Expression |
|---|----------------|------------| | 1 | Computable Function | A function for which a Turing Machine halts with the correct output for all inputs in its domain. | | 2 | Church-Turing Thesis | Any algorithm can be simulated by a Turing Machine. | | 3 | Universal Turing Machine | A TM that can simulate any other TM on any input. | | 4 | Undecidable Problem | A problem for which no Turing Machine exists that halts on all inputs and correctly decides membership. | | 5 | Halting Problem | , which is undecidable. | | 6 | Many-one Reducibility | if for a computable . Used to prove undecidability. | | 7 | Rice's Theorem | Any non-trivial property of the language recognized by a TM is undecidable. | | 8 | Post Correspondence Problem | An undecidable problem concerning finding a match in a list of string pairs. | | 9 | Recursive Language | Decidable by a TM that always halts. | | 10 | Recursively Enumerable (RE) Language | Recognizable by a TM that halts and accepts if in language, may loop otherwise. | | 11 | Closure Properties | Recursive languages are closed under complementation; RE languages are not. Both are closed under union, intersection, concatenation, Kleene star. |---
What's Next?
This topic connects to:
- Complexity Theory: Computability defines what can be computed; complexity theory investigates what can be computed efficiently.
- Formal Languages: Understanding the hierarchy of languages (regular, context-free, recursive, RE) is built upon the concept of computability.
- Logic and Foundations of Mathematics: Computability theory has deep connections to Gödel's incompleteness theorems and the limits of formal systems.
---
Proceeding to Basics of Decidability.
---
Part 2: Basics of Decidability
This section covers fundamental concepts of decidability, undecidability, and reducibility, crucial for understanding the limits of computation in CMI exams.
---
Core Concepts
1. Decidable Languages
A language is decidable if some Turing machine (TM) decides it. A TM decides a language if it halts on all inputs and accepts all strings in the language while rejecting all strings not in the language.
A language is decidable if there exists a Turing Machine such that and halts on all inputs. Such a TM is called a decider.
Worked Example: Demonstrating is Decidable.
The language is decidable. We construct a TM that decides .
Step 1: Input validation
> receives input . It first checks if is a valid encoding of a DFA and is a valid string over the alphabet of . If not, rejects.
Step 2: Simulate the DFA
> simulates on input . keeps track of 's current state and current position in .
Step 3: Process transitions
> For each symbol in , updates 's current state according to 's transition function.
Step 4: Determine acceptance
> After processing all symbols in , if 's current state is an accept state, accepts. Otherwise, rejects.
Answer: always halts because a DFA processes each symbol in exactly once and has a finite number of states. Thus, is decidable.
:::question type="MCQ" question="Which of the following languages is decidable?" options=["","","",""] answer="" hint="Consider the properties of Turing machines that can simulate the given formalisms." solution="Step 1: Analyze and .
> These are known to be undecidable problems concerning the behavior of Turing machines.
Step 2: Analyze .
> is undecidable. There is no algorithm to check if a CFG generates all possible strings.
Step 3: Analyze .
> For , we can construct a TM that decides it. The TM takes as input. It converts into Chomsky Normal Form. Then, it uses the CYK algorithm (or a similar dynamic programming approach) to determine if can be derived from . The CYK algorithm takes time, where is the length of , and always halts.
Answer: is decidable. The other options represent known undecidable languages."
:::
---
2. Undecidable Languages
A language is undecidable if no Turing machine decides it. The concept of undecidability establishes fundamental limits on what problems can be solved algorithmically.
A language is undecidable if no Turing Machine exists such that and halts on all inputs.
The canonical example of an undecidable language is , which represents the Halting Problem.
Worked Example: Proof that is Undecidable (by Diagonalization).
We prove is undecidable by contradiction. Assume is decidable, and let be a decider for .
Step 1: Define the assumed decider .
>
Step 2: Construct a new TM, , using .
> takes an encoding of a TM, , as input.
> calls on input .
> does the opposite of what says:
>
>
Step 3: Run on its own encoding .
> Consider the behavior of when its input is :
>
>
Step 4: Analyze the contradiction.
> By the definition of , accepts if accepts , and rejects if does not accept .
>
> If accepts , then accepts. But by the definition of , if accepts, then rejects . This is a contradiction.
>
> If rejects , then rejects. But by the definition of , if rejects, then accepts . This is also a contradiction.
Answer: Both possibilities lead to a contradiction. Therefore, our initial assumption that is decidable must be false. is undecidable.
:::question type="MCQ" question="Which of the following problems is undecidable?" options=["Given a context-free grammar and a string , is ?","Given two DFAs and , is ?","Given a Turing machine , does halt on the empty string ?" ,"Given a regular expression and a string , does ?"] answer="Given a Turing machine , does halt on the empty string ?" hint="Recall the fundamental undecidable problems related to Turing machines." solution="Step 1: Evaluate the first option.
> The problem 'Given a context-free grammar and a string , is ?' is decidable, as shown by the CYK algorithm.
Step 2: Evaluate the second option.
> The problem 'Given two DFAs and , is ?' is decidable. We can construct a DFA for the symmetric difference and check if this DFA accepts the empty language.
Step 3: Evaluate the fourth option.
> The problem 'Given a regular expression and a string , does ?' is decidable. We can convert to an NFA, then to a DFA, and simulate the DFA on .
Step 4: Evaluate the third option.
> The problem 'Given a Turing machine , does halt on the empty string ?' is a variant of the Halting Problem, which is known to be undecidable. It can be reduced from .
Answer: Given a Turing machine , does halt on the empty string ?"
:::
---
3. Reducibility
Reducibility is a powerful tool to prove decidability or undecidability of languages. If problem can be "reduced" to problem , it means that a solution for can be used to solve .
A language is many-one reducible to language , denoted , if there exists a computable function such that for every , . The function is called a reduction*.
Implications of Many-One Reducibility:
Worked Example: Proving is undecidable using .
The language is undecidable. We prove this by showing .
Step 1: Assume is decidable.
> Let be a decider for .
Step 2: Construct a TM that decides using .
> :
>
> 1. Run on .
> 2. If rejects (meaning does not halt on ), then rejects. (Since doesn't halt, it definitely doesn't accept).
> 3. If accepts (meaning halts on ), then simulates on .
> 4. If accepts , then accepts.
> 5. If rejects , then rejects.
Step 3: Analyze 's behavior.
> Since is a decider, it always halts. If indicates halts, then simulates . Since is guaranteed to halt in this branch, the simulation will eventually finish, and will either accept or reject based on 's behavior. Thus, always halts.
>
> accepts if and only if halts on AND accepts . This is equivalent to accepts .
> Therefore, decides .
Step 4: Conclude the contradiction.
> We know is undecidable. But if were decidable, we could construct a decider for , which is a contradiction.
> Thus, must be undecidable.
Answer: The reduction (where is a modified TM) demonstrates , proving is undecidable. The construction above is a direct decider for given a decider for , which is a proof by contradiction using the implication of reducibility.
:::question type="MCQ" question="Let be an undecidable language and be a decidable language. If and , what can be inferred about ?" options=[" must be decidable."," must be undecidable."," could be decidable or undecidable."," is recursively enumerable but not decidable."] answer=" must be undecidable." hint="Apply the properties of many-one reducibility sequentially." solution="Step 1: Analyze the first reduction: .
> We are given that is undecidable. By the property of many-one reducibility, if and is undecidable, then must be undecidable.
> Therefore, from and being undecidable, we conclude that must be undecidable.
Step 2: Analyze the second reduction: .
> We are given that is decidable. If and is decidable, then is decidable.
> Here, and . So, if and is decidable, it implies should be decidable.
Step 3: Reconcile the inferences.
> From Step 1, must be undecidable.
> From Step 2, must be decidable.
> These are contradictory. This means the initial premise ( and where is undecidable and is decidable) cannot hold simultaneously.
> However, the question asks what can be inferred about given these conditions. The strong inference from is that is undecidable. If were decidable, then would also be decidable, which contradicts the given information. Thus, the only consistent inference is that must be undecidable. The second reduction implies that cannot be reduced to if is undecidable and is decidable. But the question states that such a reduction has been constructed. This implies that the entire premise is consistent only if is undecidable.
Answer: must be undecidable."
:::
---
4. Polynomial-Time Reducibility
Polynomial-time reducibility (-time reducibility) is a restricted form of many-one reducibility where the reduction function must be computable in polynomial time. This concept is central to complexity theory, especially in defining NP-completeness.
A language is polynomial-time reducible to language , denoted , if there exists a polynomial-time computable function such that for every , .
Implications of Polynomial-Time Reducibility:
Worked Example: Understanding implications of .
Suppose we have a polynomial-time reduction from problem (Boolean Satisfiability) to problem . This means .
Step 1: State the known complexity of .
> is NP-complete. It is widely believed that .
Step 2: Apply the implication of -time reducibility.
> Since and it is believed that , then by the second implication, .
Step 3: Consider the converse.
> If , then by the first implication, . This would imply , which is a major open problem in computer science.
Answer: The polynomial-time reduction implies that if is not in , then is also not in . Conversely, if were in , then would also be in .
:::question type="MSQ" question="We have constructed a polynomial time reduction from problem to problem (). Which of the following are valid inferences?" options=["If can be solved in polynomial time, then can also be solved in polynomial time.","If cannot be solved in polynomial time, then cannot be solved in polynomial time.","If can be solved in exponential time, then can also be solved in exponential time.","If cannot be solved in polynomial time, then cannot be solved in polynomial time."] answer="If can be solved in polynomial time, then can also be solved in polynomial time.,If cannot be solved in polynomial time, then cannot be solved in polynomial time." hint="Focus on the direct implications and contrapositives of -time reducibility for complexity classes." solution="Step 1: Analyze the definition of .
> This means there's a polynomial-time function that transforms instances of into instances of such that .
Step 2: Evaluate 'If can be solved in polynomial time, then can also be solved in polynomial time.'
> If , we can solve an instance of by first computing (which takes polynomial time) and then running the polynomial-time algorithm for on . The total time will be polynomial. This statement is correct.
Step 3: Evaluate 'If cannot be solved in polynomial time, then cannot be solved in polynomial time.'
> This is the contrapositive of the previous statement. If could be solved in polynomial time, then could also be solved in polynomial time (as per Step 2). Since we assume cannot be solved in polynomial time, must also not be solvable in polynomial time. This statement is correct.
Step 4: Evaluate 'If can be solved in exponential time, then can also be solved in exponential time.'
> This is not necessarily true. If can be solved in exponential time, it means . From and , we know . However, could be much harder than exponential time (e.g., doubly exponential, or not computable at all). The reduction only gives an upper bound for relative to , not a lower bound for relative to beyond . This statement is incorrect.
Step 5: Evaluate 'If cannot be solved in polynomial time, then cannot be solved in polynomial time.'
> This is incorrect. If , it only implies that might be in or might not be. For example, if is a trivially easy problem in (e.g., checking if a string is 'a') and is an NP-complete problem, we can still have . The fact that is hard doesn't make hard. This statement is incorrect.
Answer: If can be solved in polynomial time, then can also be solved in polynomial time.,If cannot be solved in polynomial time, then cannot be solved in polynomial time."
:::
---
Advanced Applications
This section explores more complex scenarios involving decidability and reducibility, often requiring multiple steps or a deeper understanding of TM behavior.
Worked Example: Proving is undecidable.
The language is undecidable. We prove this by showing , where is known to be undecidable.
Step 1: Assume is decidable.
> Let be a decider for .
Step 2: Construct a TM that decides using .
> :
>
> 1. Construct a TM that accepts no strings (i.e., ). A simple can immediately reject all inputs.
> 2. Run on input .
> 3. If accepts, then accepts. (This means ).
> 4. If rejects, then rejects. (This means , so ).
Step 3: Analyze 's behavior.
> Since is a decider, it always halts. The construction of is trivial and takes constant time. Thus, always halts.
> accepts if and only if .
> Therefore, decides .
Step 4: Conclude the contradiction.
> We know is undecidable. But if were decidable, we could construct a decider for , which is a contradiction.
> Thus, must be undecidable.
Answer: The reduction (where is a TM that accepts nothing) shows , proving is undecidable.
:::question type="NAT" question="Consider the problem . We want to prove is undecidable. We can reduce to . If is the reduction function, . How many strings does accept if ?" answer="1" hint="The reduction should map instances of to instances of . If , then , so must be in . This means must contain exactly one string." solution="Step 1: Understand the goal of the reduction.
> We want to show . This means we need a computable function such that .
> In other words, contains exactly one string.
Step 2: Define the construction of .
> Given , we construct as follows:
> takes an input string .
> 1. ignores its input .
> 2. simulates on some fixed string, say . (The choice of doesn't matter, as long as it's a specific string.)
> 3. If accepts , then accepts . (This means accepts all strings ).
> 4. If does not accept , then rejects . (This means accepts no strings).
> This construction is not quite right for . We need to have exactly one string if .
Step 3: Refine the construction of .
> Let's choose a specific string, say .
> takes an input string .
> 1. simulates on input . (This is a common pattern for reductions from or ).
> 2. If accepts , then accepts (if ) and rejects all other . This is getting complicated.
Step 4: A simpler and more common reduction for to 'single string' properties.
> Let be a fixed, arbitrary string (e.g., ).
> Construct from as follows:
> on input :
> 1. If , immediately rejects.
> 2. If , simulates on .
> 3. If accepts , accepts .
> 4. If rejects or loops on , rejects or loops on .
>
> This construction means can only contain .
>
> If : Then does not accept any . In particular, does not accept . So, on input will not accept . Thus, . This doesn't map to .
Step 5: Re-attempt reduction: .
> We need contains exactly one string.
> Let be a fixed string (e.g., 'dummy').
> Construct from as follows:
> on input :
> 1. If , rejects .
> 2. If :
> a. Simulate on .
> b. If accepts , then rejects .
> c. If does not accept (i.e., it rejects or loops), then accepts .
>
> Let's test this:
> Case 1: . This means does not accept .
> Then, when receives , step 2c is executed, and accepts .
> For any , rejects.
> So, if , then , which contains exactly one string. This works!
>
> Case 2: . This means accepts at least one string.
> If accepts : Then on input executes step 2b and rejects . So .
> If does not accept (but accepts some other string ): Then on input executes step 2c and accepts . So .
>
> This reduction doesn't work for both directions. If but , then , and , but .
Step 6: A correct reduction for .
> We need contains exactly one string.
> Let be a fixed string (e.g., 'a').
> Construct from as follows:
> on input :
> 1. Run on input .
> 2. If accepts , then accepts (and only ).
> 3. If rejects or loops on , then rejects everything. This is still problematic.
Step 7: A standard reduction trick for .
> Let be a fixed string, e.g., 'single'.
> Construct from as follows:
> on input :
> 1. If , immediately rejects.
> 2. If :
> a. Simulate on all possible strings in lexicographic order for a fixed number of steps (say, steps for each string). This is a trick to make accept only if accepts any string.
> b. This approach is more suited for or similar.
Step 8: Let's simplify. If , accepts one specific string. If , accepts zero or many strings.
> Construct from as follows:
> on input :
> 1. Simulate on input .
> 2. If accepts , accepts .
> 3. If rejects , loops. (This is for for some ).
Step 9: Focus on the question: "How many strings does accept if ?"
> The question implies a specific reduction is constructed.
> We are given . This means .
>
> If , then .
> For the reduction to be valid, must be in .
>
> By definition of , if , then must contain exactly one string.
Answer: 1"
:::
---
Problem-Solving Strategies
To prove language is undecidable, find a known undecidable language . Construct a reduction such that . This means:
- Design a TM (or algorithm) that takes an instance of (e.g., ) and transforms it into an instance of (e.g., ).
- The transformation must be computable.
- Crucially, ensure that the transformation preserves membership: .
- Assume is decidable by some decider .
- Show how to construct a decider for using and . This leads to a contradiction, proving is undecidable.
For :
- To show is in : Find a -time algorithm for .
- To show is not in : Find a problem that is known not to be in and reduce to in polynomial time. This is the primary method for proving NP-completeness (reducing a known NP-complete problem to ).
---
Common Mistakes
❌ Confusing with . If and is undecidable, is undecidable. This implies that if were decidable, would also be decidable. The reduction is from the harder problem to the easier (or unknown) problem.
✅ Always reduce the known undecidable (or harder) problem () to the problem you want to prove undecidable (or hard) (). .
❌ Using a non-polynomial time reduction to draw conclusions about complexity classes like . A reduction must be polynomial-time to infer properties about .
✅ For decidability/undecidability, any computable reduction is sufficient. For complexity class , the reduction must be polynomial-time computable.
---
Practice Questions
:::question type="MCQ" question="Which of the following statements about decidability and reducibility is FALSE?" options=["If and is undecidable, then is undecidable.","If and is decidable, then is decidable.","If and is undecidable, then is undecidable.","The language is undecidable."] answer="If and is undecidable, then is undecidable." hint="Carefully consider the implications of many-one reducibility." solution="Step 1: Analyze the first statement.
> 'If and is undecidable, then is undecidable.' This is a fundamental property of many-one reducibility and is TRUE. If were decidable, then would also be decidable, which contradicts the premise.
Step 2: Analyze the second statement.
> 'If and is decidable, then is decidable.' This is also a fundamental property of many-one reducibility and is TRUE. If we have a decider for and a reduction from to , we can construct a decider for .
Step 3: Analyze the fourth statement.
> 'The language is undecidable.' This is the definition of the Halting Problem, which is famously undecidable. This statement is TRUE.
Step 4: Analyze the third statement.
> 'If and is undecidable, then is undecidable.' This statement is FALSE. A reduction means is 'no harder than' . If is undecidable, could still be decidable. For example, let (the empty language, which is decidable) and (undecidable). We can construct a reduction from to : , where is a TM that immediately rejects all inputs. Then is vacuously true as and (since doesn't accept anything). Thus, holds, is undecidable, but is decidable.
Answer: If and is undecidable, then is undecidable."
:::
:::question type="NAT" question="Let be a language for which no Turing machine halts on all inputs. Let be a language for which there exists a Turing machine that halts on all inputs. If , what is the minimum number of steps (0 or 1) required to conclude that this reduction cannot exist?" answer="0" hint="Consider the definition of and in terms of decidability." solution="Step 1: Interpret the properties of and .
> 'No Turing machine halts on all inputs' for means is undecidable.
> 'There exists a Turing machine that halts on all inputs' for means is decidable.
Step 2: Apply the implications of -time reducibility ().
> If and is decidable, then must also be decidable.
Step 3: Identify the contradiction.
> We are given that is undecidable, but the reduction implies is decidable. This is a direct contradiction.
Step 4: Determine the number of steps to conclude non-existence.
> The contradiction is immediate from the definitions and the property of reduction. No additional steps or constructions are needed beyond stating the properties. Therefore, the reduction cannot exist under these conditions.
Answer: 0"
:::
:::question type="MSQ" question="Consider the language . Which of the following statements are true?" options=[" is undecidable."," is decidable.","."," is recursively enumerable."] answer=" is undecidable., is recursively enumerable." hint="Recall the relationship between and , and the definition of recursively enumerable languages." solution="Step 1: Analyze 's decidability.
> is the complement of . We know is undecidable.
> If were decidable, then its complement, , would also be decidable (by simply flipping the accept/reject states of the decider for ). This contradicts the fact that is undecidable.
> Therefore, is undecidable. (Option 1 is true, Option 2 is false).
Step 2: Analyze .
> To show , we need a computable function such that .
> This means accepts .
> Construct from as follows:
> on input :
> 1. Simulate on .
> 2. If accepts , then accepts .
> 3. If rejects or loops on , then loops on .
>
> If accepts : accepts all inputs . So .
> If does not accept (rejects or loops): loops on all inputs . So .
>
> Thus, .
> This reduction works. So, is true. (Option 3 is true).
Step 3: Analyze 's recursive enumerability.
> A language is recursively enumerable if there exists a TM that accepts it (but may not halt on all inputs).
> We can construct a TM that accepts :
> :
> 1. For (number of steps)
> 2. For (all possible input strings in lexicographic order)
> 3. Simulate on for steps.
> 4. If accepts within steps, then accepts and halts.
>
> If , then there exists some string that accepts in some finite number of steps . The TM will eventually reach the stage where it simulates on for steps, find that accepts, and then accepts .
> If , then never accepts any string. will continue to simulate forever without accepting.
> Therefore, accepts exactly . So is recursively enumerable. (Option 4 is true).
Answer: is undecidable.,., is recursively enumerable."
:::
:::question type="MCQ" question="Given that is undecidable, consider a new language . Which of the following is true?" options=[" is decidable."," is undecidable, and ."," is undecidable, and ."," is undecidable, but not recursively enumerable."] answer=" is undecidable, and ." hint="This is a classic application of Rice's Theorem. If you don't use Rice's Theorem, consider reducing or (complement) to or its complement." solution="Step 1: Analyze using Rice's Theorem.
> Rice's Theorem states that any non-trivial property of the language recognized by a Turing machine is undecidable. A property is trivial if it holds for all TMs or for no TMs. A property is non-trivial if it holds for some TMs and not for others.
> The property ' is a finite language' is non-trivial:
> - It holds for some TMs (e.g., a TM that accepts only 'a').
> - It does not hold for other TMs (e.g., a TM that accepts ).
> Therefore, by Rice's Theorem, is undecidable. This eliminates Option 1.
Step 2: Consider recursive enumerability.
> A language being undecidable does not automatically mean it's not recursively enumerable. Many undecidable languages (like ) are recursively enumerable. Option 4 (not recursively enumerable) is usually harder to prove and is often the case for complements of recursively enumerable but undecidable languages. is not recursively enumerable. We can sketch why: if were RE, we could enumerate TMs with finite languages. But this is impossible, as we can't tell if a TM will eventually accept an infinite number of strings or not. So Option 4 is likely true, but the prompt asks for a 'true' option among choices, and there's a more direct reduction.
Step 3: Attempt a reduction to prove is undecidable.
> We need to reduce a known undecidable language to or its complement. Let's try to reduce to .
> We need such that .
> This means: accepts is finite.
>
> Construct from as follows:
> on input :
> 1. Simulate on .
> 2. If accepts : accepts . (So , which is infinite).
> 3. If rejects or loops on : rejects . (So , which is finite).
>
> This reduction gives: accepts is infinite.
> This means .
> This proves . Since is undecidable, is undecidable. And if is undecidable, then is also undecidable.
>
> So, is undecidable. Now we need to check if is true.
> The reduction above shows .
>
> To show directly, we need accepts is finite.
> Construct from as follows:
> on input :
> 1. Simulate on .
> 2. If accepts : rejects . (So , which is finite).
> 3. If rejects or loops on : accepts . (So , which is infinite).
>
> This reduction gives: accepts is finite. This is the correct reduction for .
Step 4: Evaluate the options.
> Option 1: is decidable. False.
> Option 2: is undecidable, and . While is undecidable, it's generally easier to reduce or (or their complements) to properties of languages. is also undecidable, but is more fundamental.
> Option 3: is undecidable, and . This aligns with our findings.
> Option 4: is undecidable, but not recursively enumerable. This is true, but Option 3 provides a more direct proof of undecidability via reduction. The question asks for 'true' statements, and Option 3 is demonstrably true. In multiple choice, we pick the most direct and accurate option.
Answer: is undecidable, and ."
:::
---
Summary
| No. | Formula/Concept | Expression |
|---|----------------|------------|
| 1 | Decidable Language | A language is decidable if a TM decides it (halts on all inputs). |
| 2 | Undecidable Language | A language is undecidable if no TM decides it. |
| 3 | Acceptance Problem | (undecidable) |
| 4 | Halting Problem | (undecidable) |
| 5 | Many-One Reduction | |
| 6 | Reducibility for Decidability | If and is decidable, then is decidable. |
| 7 | Reducibility for Undecidability | If and is undecidable, then is undecidable. |
| 8 | Polynomial-Time Reduction | |
| 9 | P-Time Reduction Implication | If and , then . (Contrapositive: If , then ). |
---
What's Next?
This topic connects to:
- Complexity Theory: Understanding -time reductions is fundamental for classifying problems into complexity classes like , , -complete, and -hard.
- Rice's Theorem: A powerful generalization that states all non-trivial semantic properties of Turing machines are undecidable. This provides a shortcut for many undecidability proofs.
- Hierarchy Theorems: These theorems show that there are problems that can be solved with more resources (time/space) but not with less, building hierarchies of decidable languages.
Chapter Summary
Turing Machine (TM): A theoretical model of computation, consisting of a finite control, an infinite tape, and a read/write head. It is widely accepted as the most powerful general-purpose computational model.
Church-Turing Thesis: This fundamental thesis posits that any function computable by an effective procedure (an algorithm) can be computed by a Turing machine. It establishes the TM as the definitive model for algorithmic computation.
Computable/Recursive Functions: Functions for which a Turing machine exists that halts on all inputs in the function's domain. A language is decidable (recursive) if there is a TM that always halts and correctly accepts strings in the language and rejects strings not in it.
Recursively Enumerable (RE) Languages: Languages for which a Turing machine exists that accepts all strings belonging to the language, but may loop indefinitely on strings not in the language. Every decidable language is RE, but not vice-versa.
Undecidable Problems: Problems for which no Turing machine can be constructed that always halts and provides a correct 'yes' or 'no' answer for all possible inputs.
The Halting Problem (): The canonical example of an undecidable problem. It asks whether an arbitrary Turing machine will halt on a given input string . Its undecidability is proven using a diagonalization argument.
* Reducibility: A crucial technique for proving the undecidability of new problems. If a known undecidable problem can be reduced to a new problem (meaning a solution to would imply a solution to ), then must also be undecidable.
Chapter Review Questions
:::question type="MCQ" question="Which of the following statements regarding decidable and recursively enumerable languages is false?" options=["Every decidable language is recursively enumerable.","The complement of a decidable language is always decidable.","The set of all Turing machines is countable.","There exist recursively enumerable languages such that their complements are also recursively enumerable, but is undecidable."] answer="There exist recursively enumerable languages such that their complements are also recursively enumerable, but is undecidable." hint="Consider the fundamental relationship between recursive (decidable) languages and the class of recursively enumerable languages and their complements." solution="If a language and its complement are both recursively enumerable, then must be decidable (recursive). This is a foundational result in computability theory. Therefore, the statement claiming can still be undecidable under these conditions is false."
:::
:::question type="NAT" question="Consider the following statements about a language :
If is a decidable language, how many of these statements must be true?" answer="4" hint="Recall the precise definitions of decidable, recursive, and recursively enumerable languages, and their properties concerning complements." solution="If is a decidable language, it implies the following:
Therefore, all 4 statements must be true."
:::
:::question type="MCQ" question="Which of the following problems is undecidable?" options=["Given a Turing machine and a string , does halt on ?","Given a finite automaton and a string , does accept ?","Given a context-free grammar , is empty?","Given a regular expression , is infinite?"] answer="Given a Turing machine and a string , does halt on ?" hint="Distinguish between problems concerning Turing machines and those concerning less powerful models of computation like finite automata, context-free grammars, and regular expressions." solution="The problem 'Given a Turing machine and a string , does halt on ?' is the classic Halting Problem, which is proven to be undecidable. The other options represent problems for simpler computational models (Finite Automata, Context-Free Grammars, Regular Expressions) which are all known to be decidable."
:::
:::question type="MCQ" question="What is the primary implication of the Church-Turing Thesis?" options=["All problems are decidable by a Turing machine.","Any algorithm can be implemented by a Turing machine.","Turing machines are the most efficient model of computation.","The Halting Problem is undecidable."] answer="Any algorithm can be implemented by a Turing machine." hint="The Church-Turing Thesis connects the intuitive notion of 'algorithm' with a formal computational model." solution="The Church-Turing Thesis posits that the class of functions computable by a Turing machine is exactly the class of functions that can be computed by any effective method (i.e., an algorithm). It establishes Turing machines as a universal model for computation, meaning any algorithm can be formalized and executed by a TM. It does not imply that all problems are decidable, nor does it make claims about computational efficiency."
:::
What's Next?
With a solid understanding of Turing machines, the limits of computability, and the distinction between decidable and undecidable problems, your CMI preparation is perfectly poised to delve into Computational Complexity Theory. This subsequent area of study builds directly upon computability by investigating the resources (primarily time and space) required to solve computable problems. You will explore fundamental questions about efficiency, classify problems into complexity classes like P and NP, and confront the famous P vs. NP problem, deepening your appreciation for the practical implications of theoretical computation.