Theory of Computation questions

Q23

GATE CS 2024 CS-1Regular LanguagesMSQ1 mark
Let L1,L2L_1, L_2 be two regular languages and L3L_3 a language which is not regular. Which of the following statements is/are always TRUE?
More than one option can be correct.
Show answer without attempting

Answer: C, D

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

0/90 correct0 marks

Related topics in GATE CS