chapter

    Theory of Computation Practice Questions for Gate Cs

    GATE CS Theory of Computation: 1 units and 4 chapters, weightage from 47 previous year questions across 10 papers, a study order by exam weight and 1270 pract

    A question from this chapter

    Question 1
    Level 1: Warm-up

    Assertion (A): The regular expression for binary strings divisible by $3$ is $(0 + 1(01^0)^1)^*$.

    Reason (R): In the DFA for this language, the start state $q_0$ has a self-loop on input $0$.

    Which of the following is correct?

    Question 2
    Level 1: Warm-up

    Consider a grammar where the only rules are and . What is the minimum number of applications of the recursive rule required to generate a string of length 4?

    Question 3
    Level 1: Warm-up

    Consider the language over the alphabet . Which of the following statements about and its subsets is TRUE?

    Question 4
    Level 1: Warm-up

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

    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.

    Theory of Computation Practice Questions for GATE CS

    GATE CS Theory of Computation: 1 units and 4 chapters, weightage from 47 previous year questions across 10 papers, a study order by exam weight and 1270 practice questions.

    About Theory of Computation Practice Questions

    1270 practice questions for Theory of Computation in GATE CS, sorted chapter by chapter and graded from basic to exam level, each with a full solution.

    GATE CS Theory of Computation Unit-wise Weightage from Past Papers

    We counted every GATE CS Theory of Computation previous year question in our bank (47 questions from 10 papers) and grouped them by unit.

    UnitChaptersPYQsShare of sectionAvg per paper
    Theory of Computation447100%4.7

    Suggested Theory of Computation Study Order for GATE CS

    1. Theory of Computation: 100% of past Theory of Computation questions, about 4.7 per paper.

    Start where the marks are. Units at the top of this list have appeared most often in past GATE CS papers.

    Units in GATE CS Theory of Computation

    All Theory of Computation chapters

    One Solved Question from Each Theory of Computation Chapter

    Question 1 · Finite Automata and Regular Expressions MCQ

    Assertion (A): The regular expression for binary strings divisible by $3$ is $(0 + 1(01^0)^1)^*$.

    Reason (R): In the DFA for this language, the start state $q_0$ has a self-loop on input $0$.

    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:

    B

    Step-by-Step Solution

    Key idea: This tests understanding of the regex derivation process and whether the reason fully explains the assertion.

    Step 1: Verify Assertion (A):

    • From the card, the canonical regex for binary strings divisible by 3 is indeed .
    • Assertion A is true.

    Step 2: Verify Reason (R):

    • In the DFA, from state (remainder 0), reading input 0 gives , so we stay in .
    • This means has a self-loop on input 0.
    • Reason R is true.

    Step 3: Check if R explains A:

    • R only explains the "$0$" part of the regex (the self-loop on ).
    • The full regex comes from state elimination, which involves eliminating and , not just the self-loop on .
    • R is true but does NOT fully explain A.

    Answer: B

    Question 2 · Context-Free Grammars and Pushdown Automata MCQ

    Consider a grammar where the only rules are and . What is the minimum number of applications of the recursive rule required to generate a string of length 4?

    1. A.

      1

    2. B.

      2

    3. C.

      3

    4. D.

      4

    Correct Answer:

    B

    Step-by-Step Solution

    Key idea: This is a minimum calculation question based on the length contribution of recursive rules.

    Step 1: Analyze the base rule . It adds 0 to the length of the string.

    Step 2: Analyze the recursive rule . Each application adds exactly 2 terminals ( and ) to the string.

    Step 3: We want a final string of length 4.

    Step 4: Since the base rule adds 0, the entire length of 4 must come from the recursive rule.

    Step 5: Divide the target length by the length added per recursive step: .

    Step 6: The minimum number of applications of the recursive rule is 2.

    Answer: 2.

    Question 3 · Closure Properties and Language Classification MCQ

    Consider the language over the alphabet . Which of the following statements about and its subsets is TRUE?

    1. A.

      Every subset of is regular because itself is regular.

    2. B.

      contains only countably many subsets, all of which are decidable.

    3. C.

      contains uncountably many subsets, most of which are undecidable.

    4. D.

      No subset of can be undecidable since itself is decidable.

    Correct Answer:

    C

    Step-by-Step Solution

    Key idea: This is a bounding question about the infinite subset trap. An infinite regular language has uncountably many subsets.

    Step 1: is an infinite regular language.

    Step 2: Any infinite set has uncountably many subsets ().

    Step 3: There are only countably many Turing machines, so only countably many decidable languages.

    Step 4: Therefore, most subsets of are undecidable.

    Answer: contains uncountably many subsets, most of which are undecidable.

    Question 4 · Turing Machines, Decidability and Undecidability 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.