chapter

    Turing Machines, Decidability and Undecidability Pyqs for Gate Cs

    Solve 6+ Turing Machines, Decidability and Undecidability previous year 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
    2026 Slot Set2 PYQ
    Level 3: Exam Standard
    Which one of the following statements is equivalent to the following assertion?

    Question 2
    2025 Slot Set2 PYQ
    Level 3: Exam Standard
    Let , be Context Free Grammars (CFGs) and be a regular expression. For a grammar , let denote the language generated by .

    Which ONE among the following questions is decidable?
    Question 3
    2022 PYQ
    Level 3: Exam Standard

    Which of the following statements is/are TRUE?

    Question 4
    2022 PYQ
    Level 3: Exam Standard

    Which of the following is/are undecidable?

    Question 5
    2021 Slot Set1 PYQ
    Level 3: Exam Standard
    For a Turing machine , denotes an encoding of . Consider the following two languages.



    Which one of the following options is correct?
    Question 6
    2021 Slot Set1 PYQ
    Level 3: Exam Standard

    Let denote an encoding of an automaton . Suppose that . Which of the following languages is/are NOT recursive?

    Free preview ends here

    Login to view the complete previous-year 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 PYQs for GATE CS

    Solve 6+ Turing Machines, Decidability and Undecidability previous year 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 (6 Problems)

    Question 1 · Theory of Computation · 2026_Set2 MCQ
    Which one of the following statements is equivalent to the following assertion?

    1. A.

      Turing machine halts on all input strings in

    2. B.

      Turing machine accepts all input strings in

    3. C.

      Turing machine rejects all input strings in

    4. D.

      Turing machine accepts all input strings in and rejects all input strings in

    Correct Answer:

    D

    Step-by-Step Solution

    Insight: A TM decides a language if it acts as a total function for that language, meaning it halts on all inputs, accepting exactly those in the language and rejecting those not in it.

    Exam route: "Decides" implies both acceptance of and rejection of the complement, which guarantees halting on all inputs. Option D captures this exact definition.

    Learning route:

    • Option A: Halting on all inputs means it's a decider, but doesn't specify it decides (it could decide a different language).
    • Option B: Accepting doesn't mean it rejects the complement or halts on the complement (it might loop on strings not in ).
    • Option C: Rejecting the complement doesn't mean it accepts or halts on .
    • Option D: Accepting and rejecting the complement means it correctly classifies all strings and halts on all of them, which is the exact definition of deciding .
    Question 2 · Theory of Computation · 2025_Set2 MCQ
    Let , be Context Free Grammars (CFGs) and be a regular expression. For a grammar , let denote the language generated by .

    Which ONE among the following questions is decidable?
    1. A.

      Is ?

    2. B.

      Is ?

    3. C.

      Is ?

    4. D.

      Is ?

    Correct Answer:

    D

    Step-by-Step Solution

    Insight: Emptiness of a Context Free Grammar (CFG) is decidable, while equivalence, intersection emptiness, and equivalence to a regular expression are undecidable.

    Exam route: Eliminate options A, B, and C as they represent classic undecidable problems for CFGs. Option D is a standard decidable property.

    Learning route:

    • Option A: Checking if two CFGs generate the same language () is undecidable.
    • Option B: The intersection of two Context Free Languages (CFLs) is not necessarily a CFL, and checking if their intersection is empty () is undecidable.
    • Option C: Checking if a CFL equals a regular language () is undecidable.
    • Option D: Emptiness of a CFG () is decidable. We can systematically check if the start symbol can derive any string of terminals by removing non-terminals that cannot produce terminal strings and checking if the start symbol is eliminated.
    Question 3 · Theory of Computation · 2022 MSQ

    Which of the following statements is/are TRUE?

    1. A.

      Every subset of a recursively enumerable language is recursive.

    2. B.

      If a language and its complement are both recursively enumerable, then must be recursive.

    3. C.

      Complement of a context-free language must be recursive.

    4. D.

      If and are regular, then must be deterministic context-free.

    Correct Answer:

    ["B","C","D"]

    Step-by-Step Solution

    Insight: This is a multi-statement classification question testing the language hierarchy, closure properties, and the bidirectional theorem.

    Exam route: Evaluate each option using the hierarchy Regular DCFL CFL Recursive RE and known closure properties.

    Learning route:

    • Option A: The language is recursively enumerable (RE). Every RE language is a subset of . Since there are RE languages that are not recursive, not every subset of an RE language is recursive. This statement is FALSE.
    • Option B: This is the Bidirectional Theorem. If both and are RE, we can run their recognizers in parallel on the same input. Since every string is in or , one recognizer is guaranteed to halt and accept. This parallel execution creates a decider for , proving is recursive. This statement is TRUE.
    • Option C: Context-free languages (CFL) are a proper subset of Recursive languages. The class of Recursive languages is closed under complement. Therefore, the complement of any CFL is guaranteed to be Recursive. This statement is TRUE.
    • Option D: Regular languages are closed under intersection, so is Regular. Since every Regular language is also a Deterministic Context-Free Language (DCFL), the intersection must be DCFL. This statement is TRUE.
    Question 4 · Theory of Computation · 2022 MSQ

    Which of the following is/are undecidable?

    1. A.

      Given two Turing machines and , decide if .

    2. B.

      Given a Turing machine , decide if is regular.

    3. C.

      Given a Turing machine , decide if accepts all strings.

    4. D.

      Given a Turing machine , decide if takes more than 1073 steps on every string.

    Correct Answer:

    ["A","B","C"]

    Step-by-Step Solution

    Insight: Rice's theorem makes non-trivial language properties of TMs undecidable. Bounded step properties are decidable because the TM's behavior is confined to a finite prefix of the input.

    Exam route: Options A, B, and C are non-trivial language properties of TMs, hence undecidable by Rice's theorem. Option D is bounded by a constant (1073 steps), making it decidable via finite simulation.

    Learning route:

    • Option A: Equivalence of TM languages () is a non-trivial property, undecidable.
    • Option B: Regularity of a TM language ( is regular) is a non-trivial property, undecidable by Rice's theorem.
    • Option C: Accepting all strings () is a non-trivial property, undecidable.
    • Option D: Since 1073 is a constant, a TM can read at most 1073 symbols in 1073 steps. We can simulate the TM on all inputs of length up to 1073 for 1073 steps. This finite simulation decides whether it takes more than 1073 steps on every string.
    Question 5 · Theory of Computation · 2021_Set1 MCQ
    For a Turing machine , denotes an encoding of . Consider the following two languages.



    Which one of the following options is correct?
    1. A.

      Both and are decidable.

    2. B.

      is decidable and is undecidable.

    3. C.

      is undecidable and is decidable.

    4. D.

      Both and are undecidable.

    Correct Answer:

    A

    Step-by-Step Solution

    Insight: Bounded step properties (constant k) are decidable because the TM's behavior is confined to a finite prefix of the input.

    Exam route: For k=2021, simulate all inputs of length <= 2021 for 2021 steps. Both "all inputs" and "some input" become finite checks.

    Learning route:

    • In 2021 steps, a TM can only read the first 2021 symbols of the input tape.
    • For : We only need to check all inputs of length . If the TM takes > 2021 steps on all of them, it will do so on all inputs. This is a finite check.
    • For : We only need to check if there exists an input of length where the TM takes > 2021 steps. This is also a finite check.
    • Both and are decidable.
    Question 6 · Theory of Computation · 2021_Set1 MSQ

    Let denote an encoding of an automaton . Suppose that . Which of the following languages is/are NOT recursive?

    1. A.

    2. B.

    3. C.

    4. D.

    Correct Answer:

    ["D"]

    Step-by-Step Solution

    Insight: DFA properties are all decidable. PDA emptiness is decidable, but PDA universality (L(M) = Σ*) is undecidable.

    Exam route: Options A, B, and C are decidable (recursive). Option D is undecidable (not recursive).

    Learning route:

    • Option A: DFA emptiness is decidable by checking reachability of final states from the start state.
    • Option B: DFA universality is decidable by checking if all states are reachable and final, or by complement and emptiness.
    • Option C: PDA emptiness is decidable by checking if any final state is reachable in the underlying graph of the PDA.
    • Option D: PDA universality () is undecidable. If it were decidable, we could decide the acceptance problem for TMs, which is impossible.

    More previous year questions (pyqs) in this unit