Theory of Computation questions

Q16

GATE CS 2016 CS-1Regular LanguagesMCQ1 mark−1/3 if wrong
Which of the following languages is generated by the given grammar?
S⟶aS∣bS∣ϵS \longrightarrow aS \mid bS \mid \epsilon
Show answer without attempting

Answer: D

Q17

GATE CS 2016 CS-1ComputabilityMCQ1 mark−1/3 if wrong
Which of the following decision problems are undecidable?
I. Given NFAs N1N_1 and N2N_2, is L(N1)∩L(N2)=ΦL(N_1) \cap L(N_2) = \Phi?
II. Given a CFG G=(N,Σ,P,S)G = (N,\Sigma,P,S) and a string x∈Σ∗x \in \Sigma^*, does x∈L(G)x \in L(G)?
III. Given CFGs G1G_1 and G2G_2, is L(G1)=L(G2)L(G_1) = L(G_2)?
IV. Given a TM MM, is L(M)=ΦL(M) = \Phi?
Show answer without attempting

Answer: C

Q18

GATE CS 2016 CS-1Regular LanguagesMCQ1 mark−1/3 if wrong
Which one of the following regular expressions represents the language: the set of all binary strings having two consecutive 0s and two consecutive 1s?
Show answer without attempting

Answer: B

Q42

GATE CS 2016 CS-1Context Free LanguagesMCQ2 marks−2/3 if wrong
Consider the following context-free grammars:
G1:S→aS∣B,B→b∣bBG_1: S \to aS|B, B \to b|bB
G2:S→aA∣bB,A→aA∣B∣ϵ,B→bB∣ϵG_2: S \to aA|bB, A \to aA|B|\epsilon, B \to bB|\epsilon
Which one of the following pairs of languages is generated by G1G_1 and G2G_2, respectively?
Show answer without attempting

Answer: D

Q43

GATE CS 2016 CS-1Context Free LanguagesMCQ2 marks−2/3 if wrong
Consider the transition diagram of a PDA given below with input alphabet Σ={a,b}\Sigma = \{a,b\} and stack alphabet Γ={X,Z}\Gamma = \{X,Z\}. ZZ is the initial stack symbol. Let LL denote the language accepted by the PDA.

Which one of the following is TRUE?
Question figure
Show answer without attempting

Answer: D

Q44

GATE CS 2016 CS-1ComputabilityMCQ2 marks−2/3 if wrong
Let XX be a recursive language and YY be a recursively enumerable but not recursive language. Let WW and ZZ be two languages such that Y‾\overline{Y} reduces to WW, and ZZ reduces to X‾\overline{X} (reduction means the standard many-one reduction). Which one of the following statements is TRUE?
Show answer without attempting

Answer: C

Q16

GATE CS 2016 CS-2Regular LanguagesNAT1 mark
The number of states in the minimum sized DFA that accepts the language defined by the regular expression
(0+1)∗(0+1)(0+1)∗(0+1)^*(0+1)(0+1)^*
is _________.
Show answer without attempting

Answer: 2.0

Q17

GATE CS 2016 CS-2Regular LanguagesMCQ1 mark−1/3 if wrong
Language L1L_1 is defined by the grammar: S1→aS1b∣εS_1 \to aS_1b \mid \varepsilon
Language L2L_2 is defined by the grammar: S2→abS2∣εS_2 \to abS_2 \mid \varepsilon

Consider the following statements:
PP: L1L_1 is regular
QQ: L2L_2 is regular

Which one of the following is TRUE?
Show answer without attempting

Answer: C

Q18

GATE CS 2016 CS-2Context Free LanguagesMCQ1 mark−1/3 if wrong
Consider the following types of languages: L1L_1 : Regular, L2L_2 : Context-free, L3L_3 : Recursive, L4L_4 : Recursively enumerable. Which of the following is/are TRUE?

I. L3‾∪L4\overline{L_3} \cup L_4 is recursively enumerable
II. L2‾∪L3\overline{L_2} \cup L_3 is recursive
III. L1∗∩L2L_1^* \cap L_2 is context-free
IV. L1∪L2‾L_1 \cup \overline{L_2} is context-free
Show answer without attempting

Answer: D

Q42

GATE CS 2016 CS-2Regular LanguagesMCQ2 marks−2/3 if wrong
Consider the following two statements:

I. If all states of an NFA are accepting states then the language accepted by the NFA is Σ∗\Sigma^*.
II. There exists a regular language AA such that for all languages BB, A∩BA \cap B is regular.

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

Answer: B

Q43

GATE CS 2016 CS-2Context Free LanguagesMCQ2 marks−2/3 if wrong
Consider the following languages:
L1={anbmcn+m:m,n≥1}L_1 = \{a^n b^m c^{n+m} : m,n \ge 1\}
L2={anbnc2n:n≥1}L_2 = \{a^n b^n c^{2n} : n \ge 1\}

Which one of the following is TRUE?
Show answer without attempting

Answer: B

Q44

GATE CS 2016 CS-2ComputabilityMCQ2 marks−2/3 if wrong
Consider the following languages.
L1={⟨M⟩∣M takes at least 2016 steps on some input}L_1 = \{\langle M \rangle \mid M \text{ takes at least 2016 steps on some input}\}
L2={⟨M⟩∣M takes at least 2016 steps on all inputs}L_2 = \{\langle M \rangle \mid M \text{ takes at least 2016 steps on all inputs}\}
L3={⟨M⟩∣M accepts ε}L_3 = \{\langle M \rangle \mid M \text{ accepts } \varepsilon\}

where for each Turing machine MM, ⟨M⟩\langle M \rangle denotes a specific encoding of MM. Which one of the following is TRUE?
Show answer without attempting

Answer: C

Q46

GATE CS 2016 CS-2Context Free LanguagesMCQ2 marks−2/3 if wrong
A student wrote two context-free grammars G1\mathbf{G_1} and G2\mathbf{G_2} for generating a single C-like array declaration. The dimension of the array is at least one. For example,
int a[10][3];
The grammars use DD as the start symbol, and use six terminal symbols int ; id [ ] num.
Grammar G1\mathbf{G_1}Grammar G2\mathbf{G_2}
D→int L;D \to \textbf{int}\, L;D→int L;D \to \textbf{int}\, L;
L→id [EL \to \textbf{id}\, [EL→id EL \to \textbf{id}\, E
E→num ]E \to \textbf{num}\, ]E→E[num]E \to E[\textbf{num}]
E→num ][EE \to \textbf{num}\, ][EE→[num]E \to [\textbf{num}]
Which of the grammars correctly generate the declaration mentioned above?
Show answer without attempting

Answer: A

0/130 correct0 marks

Related topics in GATE CS