Skip to content

GATE CS Regular Expressions and Finite Automata questions

Practise Regular Expressions and Finite Automata questions for GATE CS. Explore official PYQs and original topic-wise quizzes, check answers and view available solutions. Free, no sign-in.

Subject, topic, year and type filter the full library. Match any choice within a filter, and all selected filter categories. Search, source and sort apply to this page.

20 on this page
Official PYQ2026Theory of ComputationRegular Expressions and Finite AutomataMSQ · 1 mark
Let MM be a nondeterministic finite automaton (NFA) with 66 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 MM ?
Official PYQ2026Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
Consider the following two finite automata D1D_{1} and D2D_{2}. Which of the following statements is/are true?
Official PYQ2025Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Consider the following deterministic finite automaton (DFA) defined over the alphabet, Σ={a,b}\Sigma=\{a, b\}. Identify which of the following language(s) is/are accepted by the given DFA.
Official PYQ2025Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Consider a finite state machine (FSM) with one input XX and one output ff, represented by the given state transition table. The minimum number of states required to realize this FSM is _______. (Answer in integer). …
Official PYQ2025Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Let Σ={1,2,3,4}\Sigma=\{1,2,3,4\}. For x∈Σ∗x \in \Sigma^{*}, let prod⁡(x)\operatorname{prod}(x) be the product of symbols in xx modulo 7. We take prod⁡(ϵ)=1\operatorname{prod}(\epsilon)=1, where ϵ\epsilon is the null string. For example, prod⁡(124)=(1×2×4) mod 7=1\operatorname{prod}(124)=(1 \times 2 \times 4) \bmod 7=1. Define …
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
​Consider the 55 -state DFA\text{DFA}. MM accepting the language L(M)⊂(0+1)∗L(M) \subset(0+1)^{*} shown below. For any string w∈(0+1)∗w \in(0+1)^* let n0(w)n_0(w) be the number of 0′s0^{\prime} s in ww and n1(w)n_1(w) be the number of 1 's in ww. Which of the following statements is/are FALSE?
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Consider the following two regular expressions over the alphabet {0,1}\{0,1\} : r=0∗+1∗r= 0^{*}+1^{*} s=01∗+10∗s = 01^{*} + 10^{*} The total number of strings of length less than or equal to 55, which are neither in rr nor in ss, is ________.
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
​​​​Which one of the following regular expressions is equivalent to the language accepted by the DFA\text{DFA} given below?
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
​​Let M\text{M} be the 55-state NFA\text{NFA} with ϵ\epsilon-transitions shown in the diagram below. Which one of the following regular expressions represents the language accepted by M\text{M}?
Official PYQ2024Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Let L1L_{1} be the language represented by the regular expression b∗ab∗(ab∗ab∗)∗b^{*} a b^{*}\left(a b^{*} a b^{*}\right)^{*} and L2={w∈(a+b)∗∣∣w∣≤4}L_{2}=\left\{w \in(a+b)^{*}|| w \mid \leq 4\right\}, where ∣w∣|w| denotes the length of string ww. The number of strings in L2L_{2} which are also in L1L_{1} is _________.
Official PYQ2023Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Consider the Deterministic Finite-state Automaton (DFA\text{DFA}) A\mathcal{A} shown below. The DFA\text{DFA} runs on the alphabet {0,1}\{0,1\}, and has the set of states {s,p,q,r}\{s, p, q, r\}, with ss being the start state and pp being the only final state. Which one of the following regular expressions correctly describes the language accepted by …
Official PYQ2023Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Consider the following definition of a lexical token id\textbf{id} for an identifier in a programming language, using extended regular expressions: …
Official PYQ2023Theory of ComputationRegular Expressions and Finite AutomataNAT · 2 marks
Consider the language LL over the alphabet {0,1}\{0,1\}, given below: L={w∈{0,1}∗∣w does not contain three or more consecutive 1 ’s }.L=\left\{w \in\{0,1\}^{*} \mid w \text{ does not contain three or more consecutive } 1 \text{ 's }\right\} . The minimum number of states in a Deterministic Finite-State Automaton (DFA)\text{(DFA)} for LL is ____________.
Official PYQ2022Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Consider the following language: L={w∈{0,1}∗∣w ends with the substring 011}L= \{ w \in \{0,1\}^* \mid w \text{ ends with the substring } 011 \} Which one of the following deterministic finite automata accepts L?L?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Let L⊆{0,1}∗L \subseteq \{0,1\}^* be an arbitrary regular language accepted by a minimal DFA\text{DFA} with kk states. Which one of the following languages must necessarily be accepted by a minimal DFA\text{DFA} with kk states?
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataNAT · 1 mark
Consider the following deterministic finite automaton (DFA)\text{(DFA)} The number of strings of length 88 accepted by the above automaton is ___________
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMCQ · 2 marks
Suppose we want to design a synchronous circuit that processes a string of 00’s and 11’s. Given a string, it produces another string by replacing the first 11 in any subsequence of consecutive 11’s by a 00. Consider the following example. …
Official PYQ2021Theory of ComputationRegular Expressions and Finite AutomataMSQ · 2 marks
Which of the following regular expressions represent(s) the set of all binary numbers that are divisible by three? Assume that the string ϵ\epsilon is divisible by three.
Official PYQ2020Theory of ComputationRegular Expressions and Finite AutomataMCQ · 1 mark
Which one of the following regular expressions represents the set of all binary strings with an odd number of 1’1’s?