Menu
Theory of Computation GATE Question Answers with Explanation.
Q1 – Consider the Deterministic Finite-state Automaton (DFA) A shown below. The DFA runs on the alphabet {0, 1}, and has the set of states {s, p, q, r}, with s being the start state and p being the only final state.
Which one of the following regular expressions correctly describes the language accepted by A? (GATE 2023)
1. 1(0∗11)∗
2. 0(0 + 1)∗
3. 1(0 + 11)∗
4. 1(110∗)∗
Ans – (3)
Explanation –Â
Q2 – Consider the following definition of a lexical token id for an identifier in a programming
language, using extended regular expressions:
letter → [A-Z, a-z]
digit → [0-9]
id → letter (letter | digit)∗
Which one of the following Non-deterministic Finite-state Automata with ϵ-transitions accepts the set of valid identifiers? (A double-circle denotes a final state) (GATE 2023)
Ans – (3)
Explanation –
Q3 – Which of the following statements is/are CORRECT? (GATE 2023)
1. The intersection of two regular languages is regular.
2. The intersection of two context-free languages is context-free.
3. The intersection of two recursive languages is recursive.
4. The intersection of two recursively enumerable languages is recursively enumerable.
Ans – (1, 3, 4)
Explanation –
Q4 – Consider the pushdown automaton (PDA) P below, which runs on the input alphabet {a, b}, has stack alphabet {⊥, A}, and has three states {s, p, q}, with s being the start state. A transition from state u to state v, labelled c/X/γ, where c is an input symbol or ϵ, X is a stack symbol, and γ is a string of stack symbols, represents the fact that in state u, the PDA can read c from the input, with X on the top of its stack, pop X from the stack, push in the string γ on the stack, and
go to state v. In the initial configuration, the stack has only the symbol ⊥ in it. The PDA accepts by empty stack.
Which one of the following options correctly describes the language accepted by P? (GATE 2023)
1. {ambn | 1 ≤ m and n < m}
2. { ambn | 0 ≤ n ≤ m}
3. { ambn | 0 ≤ m and 0 ≤ n}
4. { am | 0 ≤ m} ∪ { bn | 0 ≤ n}
Ans – (1)
Explanation –
Q5 – Consider the language L over the alphabet {0, 1}, given below:
L = {w ∈ {0, 1}∗ | w does not contain three or more consecutive 1’s}.
The minimum number of states in a Deterministic Finite-State Automaton (DFA) for L is __________. (GATE 2023)
Ans – (4)
Explanation –