Theory of Computation questions — page 2 of 7

Q38

GATE CS 2024 CS-1Context Free LanguagesMCQ2 marks−2/3 if wrong
Consider the following grammar GG, with SS as the start symbol. The grammar GG has three incomplete productions denoted by (1), (2), and (3).
S→daT∣(1)S \to daT \mid (1)
T→aS∣bT∣(2)T \to aS \mid bT \mid (2)
R→(3)∣ϵR \to (3) \mid \epsilon
The set of terminals is {a,b,c,d,f}\{a, b, c, d, f\}. The FIRST and FOLLOW sets of the different non-terminals are as follows.
FIRST(S)={c,d,f},FIRST(T)={a,b,ϵ},FIRST(R)={c,ϵ}\text{FIRST}(S) = \{c, d, f\}, \text{FIRST}(T) = \{a, b, \epsilon\}, \text{FIRST}(R) = \{c, \epsilon\}
FOLLOW(S)=FOLLOW(T)={c,f,$},FOLLOW(R)={f}\text{FOLLOW}(S) = \text{FOLLOW}(T) = \{c, f, \$\}, \text{FOLLOW}(R) = \{f\}
Which one of the following options CORRECTLY fills in the incomplete productions?
Show answer without attempting

Answer: A

Q50

GATE CS 2024 CS-1Regular LanguagesMSQ2 marks
Consider the 5-state 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's in ww and n1(w)n_1(w) be the number of 1′s1's in ww.
Which of the following statements is/are FALSE?
Question figure
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q59

GATE CS 2024 CS-1Context Free LanguagesNAT2 marks
Let G=(V,Σ,S,P)G = (V, \Sigma, S, P) be a context-free grammar in Chomsky Normal Form with Σ={a,b,c}\Sigma = \{a, b, c\} and VV containing 10 variable symbols including the start symbol SS. The string w=a30b30c30w = a^{30}b^{30}c^{30} is derivable from SS. The number of steps (application of rules) in the derivation S→∗wS \to^* w is _________
Show answer without attempting

Answer: 179

Q61

GATE CS 2024 CS-1Regular LanguagesNAT2 marks
Consider the following two regular expressions over the alphabet \{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 5, which are neither in rr nor in ss, is _________
Show answer without attempting

Answer: 44

Q22

GATE CS 2024 CS-2Regular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions is equivalent to the language accepted by the DFA given below?
Question figure
Show answer without attempting

Answer: A

Q41

GATE CS 2024 CS-2Regular LanguagesMCQ2 marks−2/3 if wrong
Let MM be the 5-state NFA with ϵ\epsilon-transitions shown in the diagram below.

Which one of the following regular expressions represents the language accepted by MM ?
Question figure
Show answer without attempting

Answer: B

Q52

GATE CS 2024 CS-2Context Free LanguagesMSQ2 marks
Consider a context-free grammar GG with the following 3 rules.
S→aSS \to aS, S→aSbSS \to aSbS, S→cS \to c

Let w∈L(G)w \in L(G). Let na(w),nb(w),nc(w)n_a(w), n_b(w), n_c(w) denote the number of times a,b,ca, b, c occur in ww, respectively. Which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C

Q62

GATE CS 2024 CS-2Regular LanguagesNAT2 marks
Let L1L_1 be the language represented by the regular expression b∗ab∗(ab∗ab∗)∗b^*ab^*(ab^*ab^*)^* and L2={w∈(a+b)∗∣∣w∣≤4}L_2 = \{ w \in (a + b)^* \mid |w| \le 4\}, where ∣w∣|w| denotes the length of string ww. The number of strings in L2L_2 which are also in L1L_1 is ___________
Show answer without attempting

Answer: 15

Q14

GATE CS 2023 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Consider the Deterministic Finite-state Automaton (DFA) A\mathcal{A} shown below. The 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 A\mathcal{A}?
Question figure
Show answer without attempting

Answer: C

Q24

GATE CS 2023 CSRegular LanguagesMSQ1 mark
Which of the following statements is/are CORRECT?
More than one option can be correct.
Show answer without attempting

Answer: A, C, D

Q39

GATE CS 2023 CSContext Free LanguagesMCQ2 marks−2/3 if wrong
Consider the context-free grammar GG below
<br>S→aSb∣X<br>X→aX∣Xb∣a∣b<br>\begin{align*}<br>S & \to aSb \mid X \\<br>X & \to aX \mid Xb \mid a \mid b<br>\end{align*}
where SS and XX are non-terminals, and aa and bb are terminal symbols. The starting non-terminal is SS.

Which one of the following statements is CORRECT?
Show answer without attempting

Answer: B

Q40

GATE CS 2023 CSContext Free LanguagesMCQ2 marks−2/3 if wrong
Consider the pushdown automaton (PDA) PP below, which runs on the input alphabet {a,b}\{a, b\}, has stack alphabet {⊥,A}\{\bot, A\}, and has three states {s,p,q}\{s, p, q\}, with ss being the start state. A transition from state uu to state vv, labelled c/X/γc/X/\gamma, where cc is an input symbol or ϵ\epsilon, XX is a stack symbol, and γ\gamma is a string of stack symbols, represents the fact that in state uu, the PDA can read cc from the input, with XX on the top of its stack, pop XX from the stack, push in the string γ\gamma on the stack, and go to state vv. In the initial configuration, the stack has only the symbol ⊥\bot in it. The PDA accepts by empty stack.

Which one of the following options correctly describes the language accepted by PP?
Question figure
Show answer without attempting

Answer: A

Q63

GATE CS 2023 CSRegular LanguagesNAT2 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 = \{w \in \{0, 1\}^* \mid w \text{ does not contain three or more consecutive 1's}\}.
The minimum number of states in a Deterministic Finite-State Automaton (DFA) for LL is ____________.
Show answer without attempting

Answer: 4

Q12

GATE CS 2022 CSRegular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions correctly represents the language of the finite automaton given below?
Question figure
Show answer without attempting

Answer: D

Q23

GATE CS 2022 CSComputabilityMSQ1 mark
Which of the following statements is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q46

GATE CS 2022 CSComputabilityMSQ2 marks
Which of the following is/are undecidable?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q47

GATE CS 2022 CSContext Free LanguagesMSQ2 marks
Consider the following languages:

L1={anwan∣w∈{a,b}∗}L_1 = \{a^nwa^n \mid w \in \{a, b\}^*\}
L2={wxwR∣w,x∈{a,b}∗,∣w∣,∣x∣>0}L_2 = \{wxw^R \mid w, x \in \{a, b\}^*, |w|, |x| > 0\}

Note that wRw^R is the reversal of the string ww. Which of the following is/are TRUE?
More than one option can be correct.
Show answer without attempting

Answer: A, B, C

Q48

GATE CS 2022 CSContext Free LanguagesMSQ2 marks
Consider the following languages:

L1={ww∣w∈{a,b}∗}L_1 = \{ww \mid w \in \{a, b\}^*\}
L2={anbncm∣m,n≥0}L_2 = \{a^nb^nc^m \mid m, n \ge 0\}
L3={ambncn∣m,n≥0}L_3 = \{a^mb^nc^n \mid m, n \ge 0\}

Which of the following statements is/are FALSE?
More than one option can be correct.
Show answer without attempting

Answer: B, C, D

Q1

GATE CS 2021 CS-1Context Free LanguagesMCQ1 mark−1/3 if wrong
Suppose that L1L_1 is a regular language and L2L_2 is a context-free language. Which one of the following languages is NOT necessarily context-free?
Show answer without attempting

Answer: C

Q12

GATE CS 2021 CS-1ComputabilityMSQ1 mark
Let ⟨M⟩\langle M \rangle denote an encoding of an automaton MM. Suppose that Σ={0,1}\Sigma = \{0, 1\}. Which of the following languages is/are NOT recursive?
More than one option can be correct.
Show answer without attempting

Answer: D

0/200 correct0 marks

Related topics in GATE CS