GATE CSE Regular Expressions and Finite Automata PYQs
The topic of Regular Expressions and Finite Automata is one of the highest-weight core areas in GATE CS Theory of Computation. Questions test minimal DFA state… Read the guide
- Questions
- 41
- Asked
- since 2011
- Total marks
- 61
- Marks / paper
- 2.3
41 GATE CSE Regular Expressions and Finite Automata PYQs with solutions, from Theory of Computation. Browse all GATE CSE PYQs.
Questions
Every official paper that asked this topic, newest first.
- GATE CSE 2026 Set 1 · Q26Let be a nondeterministic finite automaton (NFA) with 6 states over a finite alphabet. Which of the following options CANNOT be the number of states in the minimal deterministic finite automaton (DFA) that is equivalent to ?MSQ1 markEasySolve
- GATE CSE 2026 Set 2 · Q47Consider the following two finite automata and . Which of the following statements is/are true?MSQ2 marksHardDiagramSolve
- GATE CSE 2025 Set 1 · Q28A regular language is accepted by a non-deterministic finite automaton (NFA) with states. Which of the following statement(s) is/are FALSE?MSQ1 markEasySolve
- GATE CSE 2025 Set 1 · Q50Consider the following deterministic finite automaton (DFA) defined over the alphabet, . Identify which of the following language(s) is/are accepted by the given DFA.MSQ2 marksMediumDiagramSolve
- GATE CSE 2025 Set 2 · Q60Let . For , let be the product of symbols in modulo 7. We take , where is the null string. For example, . Define . The number of…NAT2 marksMediumSolve
- GATE CSE 2024 Set 1 · Q50Consider the 5-state DFA accepting the language shown below. For any string let be the number of 0's in and be the number of 1's in . Which of the following statements is/are FALSE?MSQ2 marksMediumDiagramSolve
- GATE CSE 2024 Set 1 · Q61Consider the following two regular expressions over the alphabet : The total number of strings of length less than or equal to 5, which are neither in nor in , is ________NAT2 marksMediumSolve
- GATE CSE 2024 Set 2 · Q22Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?MCQ1 markEasyDiagramSolve
- GATE CSE 2024 Set 2 · Q41Let be the 5-state NFA with -transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by ?MCQ2 marksMediumDiagramSolve
- GATE CSE 2024 Set 2 · Q62Let be the language represented by the regular expression and , where denotes the length of string . The number of strings in which are also in is _________NAT2 marksMediumSolve
- GATE CSE 2023 · Q14Consider the Deterministic Finite-state Automaton (DFA) shown below. The DFA runs on the alphabet , and has the set of states , with being the start state and being the only final state. Which one of the following regular expressions correctly describes the…MCQ1 markEasyDiagramSolve
- GATE CSE 2023 · Q63Consider the language over the alphabet , given below: The minimum number of states in a Deterministic Finite-State Automaton (DFA) for is __________.NAT2 marksEasySolve
- GATE CSE 2022 · Q12Which one of the following regular expressions correctly represents the language of the finite automaton given below?MCQ1 markEasyDiagramSolve
- GATE CSE 2021 Set 1 · Q38Consider the following language. Which one of the following deterministic finite automata accepts ?MCQ2 marksEasySolve
- GATE CSE 2021 Set 2 · Q9Let be an arbitrary regular language accepted by a minimal DFA with states. Which one of the following languages must necessarily be accepted by a minimal DFA with states?MCQ1 markMediumSolve
- GATE CSE 2021 Set 2 · Q17Consider the following deterministic finite automaton (DFA). The number of strings of length 8 accepted by the above automaton is ________.NAT1 markEasyDiagramSolve
- GATE CSE 2021 Set 2 · Q47Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string is divisible by three.MSQ2 marksMediumSolve
- GATE CSE 2020 · Q7Which one of the following regular expressions represents the set of all binary strings with an odd number of 1's?MCQ1 markMediumSolve
- GATE CSE 2020 · Q51Consider the following language. The minimum number of states in a DFA that accepts is _______.NAT2 marksMediumSolve
- GATE CSE 2018 · Q6Let be an NFA with states. Let be the number of states of a minimal DFA which is equivalent to . Which one of the following is necessarily true?MCQ1 markEasySolve
- GATE CSE 2017 Set 1 · Q22Consider the language given by the regular expression over the alphabet . The smallest number of states needed in a deterministic finite-state automaton (DFA) accepting is _________.NAT1 markEasySolve
- GATE CSE 2017 Set 2 · Q25The minimum possible number of states of a deterministic finite automaton that accepts the regular language is ________.NAT1 markMediumSolve
- GATE CSE 2017 Set 2 · Q39Let denote the transition function and denote the extended transition function of the -NFA whose transition table is given below: Then isMCQ2 marksMediumDiagramSolve
- GATE CSE 2016 Set 1 · Q18Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?MCQ1 markEasySolve
- GATE CSE 2016 Set 2 · Q16The number of states in the minimum sized DFA that accepts the language defined by the regular expression is ___________ .NAT1 markEasySolve
- GATE CSE 2016 Set 2 · Q42Consider the following two statements: I. If all states of an NFA are accepting states then the language accepted by the NFA is . II. There exists a regular language such that for all languages , is regular. Which one of the following is CORRECT?MCQ2 marksMediumSolve
- GATE CSE 2015 Set 1 · Q52Consider the DFAs M and N given above. The number of states in a minimal DFA that accepts the language is ____________NAT2 marksMediumDiagramSolve
- GATE CSE 2015 Set 3 · Q18Let L be the language represented by the regular expression where . What is the minimum number of states in a DFA that recognizes (complement of L)?MCQ1 markMediumSolve
- GATE CSE 2014 Set 1 · Q15Which one of the following is TRUE?MCQ1 markEasySolve
- GATE CSE 2014 Set 1 · Q16Consider the finite automaton in the following figure. What is the set of reachable states for the input string 0011?MCQ1 markEasyDiagramSolve
- GATE CSE 2014 Set 1 · Q36Which of the regular expressions given below represent the following DFA? I) II) III) MCQ2 marksMediumDiagramSolve
- GATE CSE 2014 Set 2 · Q15If and , consider (I) is a regular language (II) Which one of the following is CORRECT?MCQ1 markEasySolve
- GATE CSE 2014 Set 2 · Q36Let . Let . Which one of the following is TRUE?MCQ2 marksHardSolve
- GATE CSE 2014 Set 3 · Q15The length of the shortest string NOT in the language (over ) of the following regular expression is _______. NAT1 markMediumSolve
- GATE CSE 2013 · Q8Consider the languages and . Which one of the following represents ?MCQ1 markEasySolve
- GATE CSE 2013 · Q33Consider the DFA A given below. Which of the following are FALSE? 1. Complement of is context-free. 2. 3. For the language accepted by , is the minimal DFA. 4. accepts all strings over of length at least 2.MCQ2 marksMediumDiagramSolve
- GATE CSE 2012 · Q12What is the complement of the language accepted by the NFA shown below? Assume and is the empty string.MCQ1 markMediumDiagramSolve
- GATE CSE 2012 · Q25Given the language , which of the following strings are in ? 1) 2) 3) 4) MCQ1 markMediumSolve
- GATE CSE 2012 · Q46Consider the set of strings on in which, *every substring of 3 symbols* has at most *two* zeros. For example, 001110 and 011001 are in the language, but 100010 is not. All strings of length less than 3 are also in the language. A partially completed DFA that accepts this language is shown below. The…MCQ2 marksMediumDiagramSolve
- GATE CSE 2011 · Q42Definition of a language with alphabet is given as following. What is the minimum number of states needed in a DFA to recognize ?MCQ2 marksMediumSolve
- GATE CSE 2011 · Q45A deterministic finite automaton (DFA) with alphabet is given below. Which of the following finite state machines is a valid minimal DFA which accepts the same language as ?MCQ2 marksMediumDiagramSolve
What GATE tests in Regular Expressions and Finite Automata
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. Questions test minimal DFA state counting under modulo/substring constraints, state equivalence and minimization, regular expression derivation from transition graphs (and vice versa), NFA-to-DFA powerset bounds (), and language membership/closure properties. The distribution balances 1-mark foundational conceptual checks with 2-mark state-tracing and counting problems.
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
Recurring question patterns
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.
Language Regularity and Language Operations (Complementation / Intersection)
OccasionalMCQ2 marks2026, 2021, 2015, 2014Evaluating whether languages with count differences, alternating sub-blocks, or intersections are regular, or finding the minimal DFA size after complementation/intersection.
Bounded-Length Complement/Union String Counting
CommonNAT2 marks2024Given two or more regular expressions over an alphabet , compute the total number of strings of length up to a bound that belong to neither expression (or belong to their intersection/union).
Formulas GATE uses
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.
Examiner traps in Regular Expressions and Finite Automata
- 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*).
- Confusing 'length less than or equal to n' with 'length exactly equal to n'.
How questions are asked
- Compute minimal number of DFA states for a given language description (NAT)
- Match a given state transition graph to the correct regular expression (MCQ)
- Multi-statement verification on state distinguishability and regex identities (MSQ)
- Compute extended transition function (q, w) on an -NFA (MCQ)
- Count the number of accepted strings of a fixed length k (NAT)
- Identify which strings belong to the Kleene star closure L* of a finite language (MCQ)
- bounded-length string enumeration and counting under regex constraints
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
Difficulty notes
Easy items test standard definitions (e.g., powerset bound , single loop regexes, direct path tracing on small NFAs). Medium items involve finding minimal DFA state counts under multi-step modulo or substring constraints, computing state distinguishability pairs, and identifying algebraic regex identities via MSQ. Hard items involve proving regularity of subtle unbounded-difference vs bounded-difference counting languages (e.g., alternating subpatterns) or analyzing interlocking cycles in multi-automata intersections.