Turing Machines, Decidability and Undecidability Short Notes for Gate Cs
Turing Machines, Decidability and Undecidability short notes for GATE CS: 12 study cards covering concepts, formulas, shortcuts and exam traps, plus solved pr
Turing Machines Decidability and Undecidability short notes
Last-Minute Revision: Perfect Shuffle
Essential Cheat Sheet
Keep these rules locked in for the exam.
1. Core Mechanics
Array length must be even (2n).
Splits into two halves of size n.
Interleaves starting with the first half (Out-Shuffle).
First element (index 0) and last element (index 2n−1) are fixed.
2. Position Formulas (0-based indexing)
Single shuffle: f(i)=2i(mod2n−1) (for 0<i<2n−1)
Piecewise alternative:
First half (i<n): moves to 2i
Second half (i≥n): moves to 2(i−n)+1
3. Multiple Shuffles (k times)
Position after k shuffles: ik=(i0×2k)(mod2n−1)
4. Restoration (Cycle Length)
Minimum shuffles to restore original order: Smallest k where 2k≡1(mod2n−1).
5. Critical Traps to Avoid
Applying 0-based formulas to 1-based problems.
Assuming the formula works for odd-length arrays.
Confusing Out-Shuffle (starts with first half) with In-Shuffle (starts with second half).
Formula Matrix: Class Rules and Closure
L recursive
⟺ L and L both RE
Recursive closed
∪,∩,x,⋅,∗
RE closed
∪,∩,⋅,∗
RE NOT closed
x,∖
Subset of recursive
⇒ recursive
Superset of RE
⇒ RE
Triggers: If You See This, Do This
Stem Signal
First Move
L and L are RE
L is recursive
L is RE, L not RE
L is RE, not recursive
"Every subset of L..."
Check Σ∗ counterexample
TM halts on all inputs
Language is recursive
TM loops on non-members
Language is RE, not recursive
Complement of CFL
Recursive (CFL ⊂ Recursive)
Intersection of regular
Regular ⟹ DCFL ⟹ Recursive
9 more cards in this chapter
Try a question
Answer it here to see how it works. Nothing is recorded until you sign in.
Question 1
Level 1: Warm-up
A language L and its complement L are both recursively enumerable. What is the minimum number of Turing machines required to decide L?
Question 2
Level 1: Warm-up
When using the 3-step checklist to determine if a problem is undecidable, what is the very first constraint you must verify before checking for triviality?
Question 3
Level 1: Warm-up
Assertion (A): If a language L and its complement L are both recursively enumerable, then L is recursive.
Reason (R): A language is recursive if and only if both the language and its complement are recursively enumerable.
Which of the following is correct?
Question 4
Level 1: Warm-up
Consider the following properties of a Turing Machine M:
M has exactly 5 states.
L(M) is a regular language.
M transitions to state q2 on reading the symbol 'a'.
L(M) contains the string '01'.
How many of these properties are language properties, to which Rice's Theorem could potentially apply?
Question 5
Level 1: Warm-up
Let P be a property of recursively enumerable (RE) languages. If P is true for ALL RE languages, it is a trivial property. What is the maximum number of times Rice's Theorem can be correctly applied to prove that such a property P is undecidable?
Question 6
Level 1: Warm-up
Consider the following two statements:
Assertion (A): The problem of deciding if the language L(M) accepted by a Turing Machine is finite is undecidable.
Reason (R): Finiteness is a non-trivial property of the language recognized by a Turing Machine.
Which of the following is correct?
Question 7
Level 1: Warm-up
Consider the following properties of a Turing Machine M:
M has exactly 5 states.
L(M) is a regular language.
M transitions to state q2 on reading 'a'.
L(M) contains the string '01'.
M halts on the empty string within 100 steps.
How many of these are language properties to which Rice's Theorem could potentially apply?
Question 8
Level 1: Warm-up
Consider the following statements regarding the expected number of trials E[T] in a randomized search with replacement:
Assertion (A): If the target element appears in every cell of an array of size n, the expected number of trials is 1.
Reason (R): The expected number of trials is given by E[T]=n/k, and when the target appears in every cell, k=n.
Which of the following is correct?
Question 9
Level 1: Warm-up
Consider the following statements about a Turing machine M:
(I) If M has exactly 10 states, then L(M) is decidable.
(II) If M halts on all inputs within 100 steps, then the language {⟨M⟩∣M satisfies this condition} is decidable.
(III) The problem of determining whether L(M) is finite is undecidable.
Which of the above statements is/are TRUE?
Question 10
Level 1: Warm-up
Consider the following properties of a Turing machine M:
(I) L(M) is empty
(II) M has exactly 5 states
(III) L(M) is a regular language
(IV) M halts on the empty string ε within 100 steps
(V) L(M)=Σ∗
How many of the above properties are decidable?
Free preview ends here
Login to view the complete short notes
Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.
Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.
Built around you, not around a syllabus PDF
Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.
Revision that hits your weak spots
We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.
Questions calibrated to the real exam
Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.
Notes written for recall, not for volume
Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.
One place for everything
Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.
Honest progress
No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.
Unlock the whole course
Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.
Turing Machines, Decidability and Undecidability Short Notes for GATE CS
Turing Machines, Decidability and Undecidability short notes for GATE CS: 12 study cards covering concepts, formulas, shortcuts and exam traps, plus solved practice questions.
Last-Minute Revision: Perfect Shuffle
Essential Cheat Sheet
Keep these rules locked in for the exam.
1. Core Mechanics
Array length must be even (2n).
Splits into two halves of size n.
Interleaves starting with the first half (Out-Shuffle).
First element (index 0) and last element (index 2n−1) are fixed.
2. Position Formulas (0-based indexing)
Single shuffle: f(i)=2i(mod2n−1) (for 0<i<2n−1)
Piecewise alternative:
First half (i<n): moves to 2i
Second half (i≥n): moves to 2(i−n)+1
3. Multiple Shuffles (k times)
Position after k shuffles: ik=(i0×2k)(mod2n−1)
4. Restoration (Cycle Length)
Minimum shuffles to restore original order: Smallest k where 2k≡1(mod2n−1).
5. Critical Traps to Avoid
Applying 0-based formulas to 1-based problems.
Assuming the formula works for odd-length arrays.
Confusing Out-Shuffle (starts with first half) with In-Shuffle (starts with second half).
Formula Matrix: Class Rules and Closure
L recursive
⟺ L and L both RE
Recursive closed
∪,∩,x,⋅,∗
RE closed
∪,∩,⋅,∗
RE NOT closed
x,∖
Subset of recursive
⇒ recursive
Superset of RE
⇒ RE
Triggers: If You See This, Do This
Stem Signal
First Move
L and L are RE
L is recursive
L is RE, L not RE
L is RE, not recursive
"Every subset of L..."
Check Σ∗ counterexample
TM halts on all inputs
Language is recursive
TM loops on non-members
Language is RE, not recursive
Complement of CFL
Recursive (CFL ⊂ Recursive)
Intersection of regular
Regular ⟹ DCFL ⟹ Recursive
Traps and Invariants
RE closed under complement (flipping accept/reject)
Check: Flipped recognizer loops on non-members.
Subsets inherit parent class (e.g., subset of recursive is recursive)
Check: Σ∗ is recursive but contains non-RE subsets.
RE implies recursive (conflating recognizer with decider)
Check: Bidirectional gate fails if complement is not RE.
Turing Machines, Decidability and Undecidability: Solved Questions with Step-by-Step Explanations (10 Problems)
Question 1 · Theory of ComputationMCQ
A language L and its complement L are both recursively enumerable. What is the minimum number of Turing machines required to decide L?
A.
2
B.
3
C.
1
D.
0
Correct Answer:
C
Step-by-Step Solution
Key idea: This is a direct application of the bidirectional theorem — if both L and L are RE, then L is recursive, meaning a single decider exists.
Step 1: The bidirectional theorem states: L is recursive if and only if both L and L are recursively enumerable.
Step 2: Since the problem states both L and L are RE, the theorem immediately tells us L is recursive.
Step 3: A recursive language has a decider — a single Turing machine that halts on all inputs and correctly accepts or rejects. Therefore, exactly 1 TM is needed.
Step 4: The construction works by running the recognizer for L and the recognizer for L in parallel. One of them must halt, giving a definitive answer. This parallel simulation is itself a single TM.
Answer: 1.
Question 2 · Theory of ComputationMCQ
When using the 3-step checklist to determine if a problem is undecidable, what is the very first constraint you must verify before checking for triviality?
A.
Whether the language accepted by the TM is finite
B.
Whether the condition is about the machine's physical structure or the language itself
C.
Whether the Turing Machine halts on all possible inputs
D.
Whether the property is recursively enumerable
Correct Answer:
B
Step-by-Step Solution
Key idea: This is a statement truth question testing the exact sequence of the 3-step checklist for applying Rice's Theorem.
Step 1: Recall the 3-step checklist from the method card.
Step 2: Step 1 is "Check the subject. Is the condition about the machine M (states, transitions, steps) or the language L(M)?"
Step 3: Step 2 is checking for triviality. Step 3 is applying the theorem.
Step 4: Therefore, the very first constraint to verify is whether the condition is about the machine's physical structure or the language itself.
Answer: Whether the condition is about the machine's physical structure or the language itself.
Question 3 · Theory of ComputationMCQ
Assertion (A): If a language L and its complement L are both recursively enumerable, then L is recursive.
Reason (R): A language is recursive if and only if both the language and its complement are recursively enumerable.
Which of the following is correct?
A.
Both A and R are true and R is the correct explanation of A
B.
Both A and R are true but R is NOT the correct explanation of A
C.
A is true but R is false
D.
A is false but R is true
Correct Answer:
A
Step-by-Step Solution
Key idea: The bidirectional theorem states L is recursive ⟺ both L and L are RE.
Step 1: Analyze Assertion (A): This is exactly the reverse direction of the bidirectional theorem. If both L and L are RE, then L is recursive. TRUE.
Step 2: Analyze Reason (R): This is the statement of the bidirectional theorem itself. TRUE.
Step 3: Check relationship: R directly states the theorem that makes A true. R is the correct explanation of A.
Answer: A
Question 4 · Theory of ComputationMCQ
Consider the following properties of a Turing Machine M:
M has exactly 5 states.
L(M) is a regular language.
M transitions to state q2 on reading the symbol 'a'.
L(M) contains the string '01'.
How many of these properties are language properties, to which Rice's Theorem could potentially apply?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
B
Step-by-Step Solution
Key idea: This is a casework question testing the distinction between machine properties and language properties.
Step 1: Evaluate property 1. "M has exactly 5 states" is about the physical structure of the machine. (Machine property)
Step 2: Evaluate property 2. "L(M) is a regular language" is about the set of strings accepted. (Language property)
Step 3: Evaluate property 3. "M transitions to state q_2" is about the transition function. (Machine property)
Step 4: Evaluate property 4. "L(M) contains the string '01'" is about the accepted strings. (Language property)
Step 5: Count the language properties. There are exactly 2 (properties 2 and 4).
Answer: 2.
Question 5 · Theory of ComputationMCQ
Let P be a property of recursively enumerable (RE) languages. If P is true for ALL RE languages, it is a trivial property. What is the maximum number of times Rice's Theorem can be correctly applied to prove that such a property P is undecidable?
A.
0
B.
1
C.
2
D.
Infinite
Correct Answer:
A
Step-by-Step Solution
Key idea: This is an observation question testing the boundary condition of Rice's Theorem regarding trivial properties.
Step 1: Recall the statement of Rice's Theorem: "Any NON-TRIVIAL property of the language recognized by a TM is undecidable."
Step 2: The question specifies that P is true for ALL RE languages, which by definition makes it a TRIVIAL property.
Step 3: Since Rice's Theorem only applies to non-trivial properties, it cannot be applied to a trivial property to prove it is undecidable.
Step 4: Therefore, the maximum number of times it can be applied is 0.
Answer: 0.
Question 6 · Theory of ComputationMCQ
Consider the following two statements:
Assertion (A): The problem of deciding if the language L(M) accepted by a Turing Machine is finite is undecidable.
Reason (R): Finiteness is a non-trivial property of the language recognized by a Turing Machine.
Which of the following is correct?
A.
Both A and R are true, and R is the correct explanation of A.
B.
Both A and R are true, but R is not the correct explanation of A.
C.
A is true, but R is false.
D.
A is false, but R is true.
Correct Answer:
A
Step-by-Step Solution
Key idea: This is an assertion-reason question testing the classic undecidable properties and the theoretical justification for them.
Step 1: Evaluate Assertion (A). Is deciding if L(M) is finite undecidable? Yes, this is one of the classic undecidable language properties listed in the card.
Step 2: Evaluate Reason (R). Is finiteness a non-trivial property of the language? Yes, some TMs accept finite languages, and some accept infinite languages. It varies, so it is non-trivial.
Step 3: Determine the link. Does R explain A? Yes. According to Rice's Theorem, it is precisely because finiteness is a non-trivial property of the language that it is undecidable.
Answer: Both A and R are true, and R is the correct explanation of A.
Question 7 · Theory of ComputationMCQ
Consider the following properties of a Turing Machine M:
M has exactly 5 states.
L(M) is a regular language.
M transitions to state q2 on reading 'a'.
L(M) contains the string '01'.
M halts on the empty string within 100 steps.
How many of these are language properties to which Rice's Theorem could potentially apply?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
B
Step-by-Step Solution
Insight: This is a casework question testing the strict boundary between machine properties and language properties.
Exam route: Evaluate each property to see if it describes the physical machine or the infinite language.
Learning route:
Step 1: Property 1 (5 states) is about the machine's physical structure. (Machine property)
Step 2: Property 2 (L(M) is regular) is about the set of accepted strings. (Language property)
Step 3: Property 3 (transitions to q2) is about the transition function. (Machine property)
Step 4: Property 4 (L(M) contains '01') is about the accepted strings. (Language property)
Step 5: Property 5 (halts within 100 steps) is bounded by a fixed number of steps. (Machine behavior property)
Step 6: Count the language properties. Only properties 2 and 4 qualify.
Answer: 2.
Question 8 · Theory of ComputationMCQ
Consider the following statements regarding the expected number of trials E[T] in a randomized search with replacement:
Assertion (A): If the target element appears in every cell of an array of size n, the expected number of trials is 1.
Reason (R): The expected number of trials is given by E[T]=n/k, and when the target appears in every cell, k=n.
Which of the following is correct?
A.
Both A and R are true, but R is not the correct explanation of A.
B.
A is true, but R is false.
C.
A is false, but R is true.
D.
Both A and R are true, and R is the correct explanation of A.
Correct Answer:
D
Step-by-Step Solution
Insight: This is a construction question testing the application of the expected value formula to a boundary case.
Exam route: Evaluate A and R independently, then check if R explains A.
Learning route:
Step 1: Evaluate Assertion (A). If the target appears in every cell, k=n. The expected number of trials is E[T]=n/k=n/n=1. Assertion A is true.
Step 2: Evaluate Reason (R). The formula for expected trials is indeed E[T]=n/k, and the condition "appears in every cell" means k=n. Reason R is true.
Step 3: Determine the link. Does R explain A? Yes. The formula E[T]=n/k directly yields 1 when k=n, which is the exact scenario described in A.
Answer: Both A and R are true, and R is the correct explanation of A.
Question 9 · Theory of ComputationMCQ
Consider the following statements about a Turing machine M:
(I) If M has exactly 10 states, then L(M) is decidable.
(II) If M halts on all inputs within 100 steps, then the language {⟨M⟩∣M satisfies this condition} is decidable.
(III) The problem of determining whether L(M) is finite is undecidable.
Which of the above statements is/are TRUE?
A.
I only
B.
II only
C.
II and III only
D.
I, II, and III
Correct Answer:
C
Step-by-Step Solution
Key idea: Distinguish machine properties (decidable) from language properties (often undecidable by Rice's Theorem).
Step 1: Analyze (I): "M has 10 states" is a machine property, but it doesn't determine if L(M) is decidable. A TM with 10 states can accept undecidable languages. FALSE.
Step 2: Analyze (II): "halts within 100 steps" is bounded by a constant. We can simulate M for 100 steps on all inputs of length ≤ 100. This is decidable. TRUE.
Step 3: Analyze (III): "L(M) is finite" is a non-trivial language property. By Rice's Theorem, it is undecidable. TRUE.
Answer: C (II and III only)
Question 10 · Theory of ComputationMCQ
Consider the following properties of a Turing machine M:
(I) L(M) is empty
(II) M has exactly 5 states
(III) L(M) is a regular language
(IV) M halts on the empty string ε within 100 steps
(V) L(M)=Σ∗
How many of the above properties are decidable?
A.
1
B.
2
C.
3
D.
4
Correct Answer:
B
Step-by-Step Solution
Key idea: Machine properties and bounded-step properties are decidable. Non-trivial language properties are undecidable by Rice's Theorem.
Step 1: (I) "L(M) is empty" — non-trivial language property → UNDECIDABLE
Step 2: (II) "M has 5 states" — machine property, just count states → DECIDABLE
Step 3: (III) "L(M) is regular" — non-trivial language property → UNDECIDABLE
Step 4: (IV) "halts within 100 steps" — bounded by constant, simulate 100 steps → DECIDABLE
Step 5: (V) "L(M)=Σ∗" — non-trivial language property → UNDECIDABLE
Step 6: Count decidable: (II) and (IV) → 2
Answer: B