Theory of Computation questions — page 5 of 7

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

Q32

GATE CS 2015 CS-3Regular LanguagesMCQ1 mark−1/3 if wrong
Let LL be the language represented by the regular expression Σ∗0011Σ∗\Sigma^* 0011 \Sigma^* where Σ={0,1}\Sigma = \{0, 1\}. What is the minimum number of states in a DFA that recognizes L‾\overline{L} (complement of LL)?
Show answer without attempting

Answer: B

Q41

GATE CS 2015 CS-3ComputabilityMCQ2 marks−2/3 if wrong
Language L1L_1 is polynomial time reducible to language L2L_2. Language L3L_3 is polynomial time reducible to L2L_2, which in turn is polynomial time reducible to L4L_4. Which of the following is/are true?

I.if L4∈P, then L2∈PII.if L1∈P or L3∈P, then L2∈PIII.L1∈P, if and only if L3∈PIV.if L4∈P, then L1∈P and L3∈P\begin{array}{rl} \text{I.} & \text{if } L_4 \in P \text{, then } L_2 \in P \\ \text{II.} & \text{if } L_1 \in P \text{ or } L_3 \in P \text{, then } L_2 \in P \\ \text{III.} & L_1 \in P \text{, if and only if } L_3 \in P \\ \text{IV.} & \text{if } L_4 \in P \text{, then } L_1 \in P \text{ and } L_3 \in P \end{array}
Show answer without attempting

Answer: C

Q44

GATE CS 2015 CS-3Context Free LanguagesMCQ2 marks−2/3 if wrong
Which of the following languages are context-free?

L1={ambnanbm∣m,n≥1}L2={ambnambn∣m,n≥1}L3={ambn∣m=2n+1} \begin{array}{l} L_1 = \{a^m b^n a^n b^m \mid m, n \ge 1\} \\ L_2 = \{a^m b^n a^m b^n \mid m, n \ge 1\} \\ L_3 = \{a^m b^n \mid m = 2n + 1\} \end{array}
Show answer without attempting

Answer: B

Q28

GATE CS 2015 CS-1ComputabilityMCQ1 mark−1/3 if wrong
For any two languages L1L_1 and L2L_2 such that L1L_1 is context-free and L2L_2 is recursively enumerable but not recursive, which of the following is/are necessarily true?

I. L1‾\overline{L_1} (complement of L1L_1) is recursive
II. L2‾\overline{L_2} (complement of L2L_2) is recursive
III. L1‾\overline{L_1} is context-free
IV. L1‾∪L2\overline{L_1} \cup L_2 is recursively enumerable
Show answer without attempting

Answer: D

Q49

GATE CS 2015 CS-1Regular LanguagesNAT2 marks
Consider the DFAs M and N given above. The number of states in a minimal DFA that accepts the language L(M)∩L(N)L(M) \cap L(N) is ________.
Question figure
Show answer without attempting

Answer: 1

Q50

GATE CS 2015 CS-1Context Free LanguagesMCQ2 marks−2/3 if wrong
Consider the NPDA ⟨Q={q0,q1,q2},Σ={0,1},Γ={0,1,⊥},δ,q0,⊥,F={q2}⟩\langle Q = \{q_0, q_1, q_2\}, \Sigma = \{0, 1\}, \Gamma = \{0, 1, \bot\}, \delta, q_0, \bot, F = \{q_2\} \rangle, where (as per usual convention) QQ is the set of states, Σ\Sigma is the input alphabet, Γ\Gamma is the stack alphabet, δ\delta is the state transition function, q0q_0 is the initial state, ⊥\bot is the initial stack symbol, and FF is the set of accepting states. The state transition is as follows:

Which one of the following sequences must follow the string 101100 so that the overall string is accepted by the automaton?
Question figure
Show answer without attempting

Answer: B

Q20

GATE CS 2015 CS-2ComputabilityMCQ1 mark−1/3 if wrong
Consider the following statements.

I. The complement of every Turing decidable language is Turing decidable
II. There exists some language which is in NP but is not Turing decidable
III. If L is a language in NP, L is Turing decidable

Which of the above statements is/are true?
Show answer without attempting

Answer: D

Q26

GATE CS 2015 CS-2ComputabilityMCQ1 mark−1/3 if wrong
Consider two decision problems Q1,Q2Q_1, Q_2 such that Q1Q_1 reduces in polynomial time to 3-SAT and 3-SAT reduces in polynomial time to Q2Q_2. Then which one of the following is consistent with the above statement?
Show answer without attempting

Answer: A

Q45

GATE CS 2015 CS-2Regular LanguagesNAT2 marks
The number of states in the minimal deterministic finite automaton corresponding to the regular expression (0+1)∗(10)(0 + 1)^*(10) is ___________.
Show answer without attempting

Answer: 3

Q46

GATE CS 2015 CS-2Regular LanguagesMCQ2 marks−2/3 if wrong
Which of the following languages is/are regular?

L1L_1: {wxwR∣w,x∈{a,b}∗ and ∣w∣,∣x∣>0}\{wxw^R \mid w, x \in \{a, b\}^* \text{ and } |w|, |x| > 0\}, wRw^R is the reverse of string ww
L2L_2: {anbm∣m≠n and m,n≥0}\{a^n b^m \mid m \neq n \text{ and } m, n \geq 0\}
L3L_3: {apbqcr∣p,q,r≥0}\{a^p b^q c^r \mid p, q, r \geq 0\}
Show answer without attempting

Answer: A

0/200 correct0 marks

Related topics in GATE CS