GATE CSE Theory of Computation (TOC) PYQs
The topic of Regular Expressions and Finite Automata is one of the highest-weight core areas in GATE CS Theory of Computation. Across GATE CS, 'Turing machines… Read the guide
- Topics
- 4
- Questions
- 118
- Marks / paper
- 6.9
- Asked
- since 2011
These are the 118 GATE CSE Theory of Computation PYQs (since 2011), grouped topic-wise with solutions. See all GATE CSE PYQs or GATE CSE question papers by year.
Topics
Open a topic to browse its questions, or practice it as a timed test.
By year
Jump to the first question from each year’s paper.
What GATE tests in Theory of Computation
Concepts, patterns, formulas and traps distilled from past papers.
The topic of Regular Expressions and Finite Automata is one of the highest-weight core areas in GATE CS Theory of Computation. Across GATE CS, 'Turing machines and undecidability' is consistently tested through theoretical properties of computability and complexity classes. Context-Free Grammars (CFG) and Pushdown Automata (PDA) form a cornerstone of the GATE CS Theory of Computation syllabus.
Core concepts
- Deterministic and Non-Deterministic Finite Automata (DFA, NFA, -NFA)
- Myhill-Nerode theorem and state distinguishability
- DFA state minimization (table-filling algorithm and dead state merging)
- Extended transition function and -closure computation
- Conversion between regular expressions and finite automata (Arden's theorem / state elimination)
- Complementation, intersection, and product automata constructions
- Finite state tracking for modular arithmetic and group actions
- Language generated by regular expressions (+, ·, *, and )
- Length-wise string enumeration
- Intersection and disjointness of regular languages
- Complement language cardinality over finite length bounds
- Rice's Theorem (semantic/non-trivial properties of RE languages vs syntactic/step-bounded properties)
How questions show up
Minimal DFA State Counting for Modulo / Arithmetic / Group Constraints
CommonNAT2 marks2025, 2020, 2011Given a language condition based on symbol counts modulo , divisibility by multiple numbers (LCM), or algebraic properties (e.g., product modulo 7), find the exact number of states in the minimal DFA.
Minimal DFA State Counting for Suffix / Substring / Exact Position Constraints
Commonmixed1 marks2023, 2021, 2017, 2016Determining the minimal number of states for accepting strings containing, ending in, or avoiding specific substrings (e.g., -th symbol from right, avoiding , exact length plus symbol conditions).
Automaton to Regular Expression Equivalence / Loop Identification
CommonMCQ2 marks2024, 2023, 2022, 2021Given a transition diagram of a DFA, NFA, or -NFA, identify the equivalent regular expression by decomposing cycles, state elimination, or tracking paths to multiple accept states.
NFA to DFA Conversion and Powerset State Bounds
CommonMSQ1 marks2026, 2025, 2018, 2016Testing theoretical bounds on state counts when converting an -state NFA to a DFA (), minimal equivalent DFAs, and behavior of all-accepting NFAs.
State Distinguishability, Equivalence, and Minimization
Occasionalmixed2 marks2024, 2017, 2014, 2011Given an automaton transition table or diagram, compute reachable state sets, -closures, identify equivalent/trap states, or find distinguishable state pairs.
String Membership, Decomposition, and Finite Length Counting
Occasionalmixed2 marks2024, 2021, 2014, 2012Checking whether given candidate strings belong to , finding the shortest string not generated by a regex, or counting accepted strings up to a fixed length.
High-yield formulas
Subset Construction Maximum State Bound
Determining maximum possible states in an equivalent DFA converted from an NFA.
k-th Symbol from Right State Requirement
Finding minimal DFA states for languages tracking the -th symbol from the end of a binary string.
DFA Complementation Invariance
Determining state count of complement DFA by inverting final and non-final states.
Divisibility Modulo Intersection / LCM Rule
Tracking independent modular conditions on symbol counts (e.g. divisible by but not by ).
Regular Expression Star Identity
Simplifying and matching equivalent regular expressions from state transition cycles.
Total Strings of Length up to $n$ over Alphabet $\Sigma$
Used to find the size of the universal set of strings of length before subtracting strings accepted by given regular expressions.
Principle of Inclusion-Exclusion for String Counts
Used when determining the union of languages defined by multiple regular expressions without double-counting shared strings.
Post's Theorem
Used when analyzing the decidability of given the enumerability of and .
Examiner traps in Theory of Computation
- Forgetting the trap/dead state when counting minimal DFA states for prefix/pattern-avoidance constraints.
- Assuming empty string is always in L(M) when start state is non-accepting (e.g., k>0 vs k ≥ 0).
- Confusing 'contains substring w' (requires trap on success) with 'ends with substring w' (resets based on longest suffix overlap).
- Assuming all-accepting states in an NFA implies accepting * (ignoring missing transitions / dead branches).
- Believing minimal DFA for an n-state NFA must have ≥ n states (it can be 1 state if L = *).
- Incorrectly applying complementation to an incomplete DFA without first adding explicit transitions to a dead state.
- Forgetting the empty string (length 0) when calculating total strings Σk=0n | |k or evaluating 0* + 1*.
- Double-counting overlap strings between expressions (e.g., length-1 strings '0' and '1' generated by both 0*+1* and 01*+10*).
Paper trends
Introduction of MSQ format has shifted subset construction and state-equivalence questions into multi-correct evaluations testing extreme cases (e.g., minimal DFA bounds , state distinguishability pairs).
2026, 2025, 2024, 2021
Transition from purely visual DFA/regex matching to algebraic modulo operations, multiplicative group residue tracking, and finite string counting via combinatorics.
2025, 2024, 2021, 2020
Persistent use of NAT for state counting problems where students must avoid off-by-one errors regarding start states and dead/trap states.
2025, 2024, 2023, 2021, 2020, 2017, 2016, 2015, 2014
Recent questions test regex understanding via numerical answer type (NAT) combinatorial string counting rather than traditional DFA equivalence or property matching.
2024