chapter

    Turing Machines, Decidability and Undecidability Practice Questions for Gate Cs

    Solve 180+ Turing Machines, Decidability and Undecidability practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    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 and its complement are both recursively enumerable. What is the minimum number of Turing machines required to decide ?

    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 and its complement are both recursively enumerable, then 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 :

    1. has exactly 5 states.
    2. is a regular language.
    3. transitions to state on reading the symbol 'a'.
    4. 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 be a property of recursively enumerable (RE) languages. If 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 is undecidable?

    Question 6
    Level 1: Warm-up

    Consider the following two statements:

    Assertion (A): The problem of deciding if the language 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 :

    1. has exactly 5 states.
    2. is a regular language.
    3. transitions to state on reading 'a'.
    4. contains the string '01'.
    5. 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 in a randomized search with replacement:

    Assertion (A): If the target element appears in every cell of an array of size , the expected number of trials is 1.

    Reason (R): The expected number of trials is given by , and when the target appears in every cell, .

    Which of the following is correct?

    Question 9
    Level 1: Warm-up

    Consider the following statements about a Turing machine :

    (I) If has exactly 10 states, then is decidable.

    (II) If halts on all inputs within 100 steps, then the language is decidable.

    (III) The problem of determining whether 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 : (I) is empty (II) has exactly 5 states (III) is a regular language (IV) halts on the empty string within 100 steps (V) How many of the above properties are decidable?
    Free preview ends here

    Login to view the complete practice questions and solutions

    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.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    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 Practice Questions for GATE CS

    Solve 180+ Turing Machines, Decidability and Undecidability practice questions for GATE CS with answers and detailed solutions. Free sample questions below.

    Perfect Shuffle and Sequence Permutations

    Algorithmic Thinking • String & Sequence Manipulation

    Perfect Shuffle & Sequence Permutations

    The mathematical backbone of interleaving data — essential for understanding deterministic permutations in programming.

    Core Concept Exam Pattern

    What you will learn here

    • The exact definition and mechanics of a perfect shuffle
    • How to map any element's old index to its new index using a formula
    • Tracing multiple consecutive shuffles without brute force
    • Critical edge cases and common off-by-one traps

    Intuition: The Two-Half Interleave

    The Physical Analogy

    Think of a standard deck of cards. A perfect shuffle (also called a Faro shuffle) is not a random mix. It is a strictly deterministic operation.

    Step 1: Split

    Divide the sequence of elements into two equal halves of size .

    Step 2: Interleave

    Alternate picking elements, starting with the first half.

    If our sequence is :

    • First half:
    • Second half:

    Interleaving step-by-step:

    1. Take 1 (from first half)
    2. Take 6 (from second half)
    3. Take 2 (from first half)
    4. Take 7 (from second half) ...and so on.

    Result:

    Notice that the very first element and the very last element never change their positions in this specific type of shuffle.

    Turing Machines, Decidability and Undecidability: Solved Questions with Step-by-Step Explanations (10 Problems)

    Question 1 · Theory of Computation MCQ

    A language and its complement are both recursively enumerable. What is the minimum number of Turing machines required to decide ?

    1. A.

      2

    2. B.

      3

    3. C.

      1

    4. D.

      0

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a direct application of the bidirectional theorem — if both and are RE, then is recursive, meaning a single decider exists.

    Step 1: The bidirectional theorem states: is recursive if and only if both and are recursively enumerable.

    Step 2: Since the problem states both and are RE, the theorem immediately tells us 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 and the recognizer for 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 Computation MCQ

    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?

    1. A.

      Whether the language accepted by the TM is finite

    2. B.

      Whether the condition is about the machine's physical structure or the language itself

    3. C.

      Whether the Turing Machine halts on all possible inputs

    4. 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 Computation MCQ
    Assertion (A): If a language and its complement are both recursively enumerable, then 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?
    1. A.

      Both A and R are true and R is the correct explanation of A

    2. B.

      Both A and R are true but R is NOT the correct explanation of A

    3. C.

      A is true but R is false

    4. D.

      A is false but R is true

    Correct Answer:

    A

    Step-by-Step Solution

    Key idea: The bidirectional theorem states is recursive both and are RE. Step 1: Analyze Assertion (A): This is exactly the reverse direction of the bidirectional theorem. If both and are RE, then 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 Computation MCQ

    Consider the following properties of a Turing Machine :

    1. has exactly 5 states.
    2. is a regular language.
    3. transitions to state on reading the symbol 'a'.
    4. contains the string '01'.

    How many of these properties are language properties, to which Rice's Theorem could potentially apply?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. 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 Computation MCQ

    Let be a property of recursively enumerable (RE) languages. If 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 is undecidable?

    1. A.

      0

    2. B.

      1

    3. C.

      2

    4. 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 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 Computation MCQ

    Consider the following two statements:

    Assertion (A): The problem of deciding if the language 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?

    1. A.

      Both A and R are true, and R is the correct explanation of A.

    2. B.

      Both A and R are true, but R is not the correct explanation of A.

    3. C.

      A is true, but R is false.

    4. 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 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 Computation MCQ

    Consider the following properties of a Turing Machine :

    1. has exactly 5 states.
    2. is a regular language.
    3. transitions to state on reading 'a'.
    4. contains the string '01'.
    5. halts on the empty string within 100 steps.

    How many of these are language properties to which Rice's Theorem could potentially apply?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. 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 ( is regular) is about the set of accepted strings. (Language property)

    Step 3: Property 3 (transitions to ) is about the transition function. (Machine property)

    Step 4: Property 4 ( 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 Computation MCQ

    Consider the following statements regarding the expected number of trials in a randomized search with replacement:

    Assertion (A): If the target element appears in every cell of an array of size , the expected number of trials is 1.

    Reason (R): The expected number of trials is given by , and when the target appears in every cell, .

    Which of the following is correct?

    1. A.

      Both A and R are true, but R is not the correct explanation of A.

    2. B.

      A is true, but R is false.

    3. C.

      A is false, but R is true.

    4. 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, . The expected number of trials is . Assertion A is true.

    Step 2: Evaluate Reason (R). The formula for expected trials is indeed , and the condition "appears in every cell" means . Reason R is true.

    Step 3: Determine the link. Does R explain A? Yes. The formula directly yields 1 when , 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 Computation MCQ

    Consider the following statements about a Turing machine :

    (I) If has exactly 10 states, then is decidable.

    (II) If halts on all inputs within 100 steps, then the language is decidable.

    (III) The problem of determining whether is finite is undecidable.

    Which of the above statements is/are TRUE?

    1. A.

      I only

    2. B.

      II only

    3. C.

      II and III only

    4. 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): " has 10 states" is a machine property, but it doesn't determine if 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 for 100 steps on all inputs of length ≤ 100. This is decidable. TRUE. Step 3: Analyze (III): " 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 Computation MCQ
    Consider the following properties of a Turing machine : (I) is empty (II) has exactly 5 states (III) is a regular language (IV) halts on the empty string within 100 steps (V) How many of the above properties are decidable?
    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. 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) " is empty" — non-trivial language property → UNDECIDABLE Step 2: (II) " has 5 states" — machine property, just count states → DECIDABLE Step 3: (III) " is regular" — non-trivial language property → UNDECIDABLE Step 4: (IV) "halts within 100 steps" — bounded by constant, simulate 100 steps → DECIDABLE Step 5: (V) "" — non-trivial language property → UNDECIDABLE Step 6: Count decidable: (II) and (IV) → 2 Answer: B

    More practice questions in this unit