GATE 2004 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2004

199 questions

MCQ 1991-mark 199

Questions 126–130 of 199

Q126Context Free Grammar1 markMCQ−0.33 if wrong
Which of the following grammar rules violate the requirements of an operator grammar? P, Q, R are nonterminals, and r,s,t are terminals.
(i)P→QR(i)P\rightarrow QR
(ii)P→QsR(ii)P\rightarrow QsR
(iii)P→ε(iii)P\rightarrow \varepsilon
(iv)P→QtRr(iv)P\rightarrow QtRr

Q127Push-down Automata1 markMCQ−0.33 if wrong
Let M=(K,Σ,Γ,Δ,s,F)M=(K, \Sigma, \Gamma, \Delta, s, F) be a pushdown automaton, where
K={s,f},F={f},Σ={a,b},Γ={a} and K=\{s, f\}, F=\{f\}, \Sigma=\{a, b\}, \Gamma=\{a\} \text { and }
Δ={((s,a,ϵ),(s,a)),((s,b,ϵ),(s,a)),((s,a,a),(f,ϵ)),((f,a,a),(f,ϵ)),((f,b,a),(f,ϵ))}\Delta=\{((s, a, \epsilon),(s, a)),((s, b, \epsilon),(s, a)),((s, a, a),(f, \epsilon)),((f, a, a),(f, \epsilon)),((f, b, a),(f, \epsilon))\}
Which one of the following strings is not a member of L(M)?

Q128Context Free Language1 markMCQ−0.33 if wrong
The language {ambncm+n∣m,n≥1a^{m}b^{n}c^{m+n}|m,n\geq 1} is

Q129Recursive Language1 markMCQ−0.33 if wrong
L1 is a recursively enumerable language over Σ\Sigma. An algorithm A effectively enumerates its words as w1, w2, w3, ... define another language L2 over Σ\SigmaU{#} as
{wi # wj : wi, wj ∈\in L1, i <\lt j}.
Here # is a new symbol. Consider the following assertions.
 S1 :  L1 is recursive implies L2 is recursive
S2 : L2 is recursive implies L1 is recursive 
Which of the following statements is true ?

Q130Parsing1 markMCQ−0.33 if wrong
Consider the grammar with the following translation rules and E as the start symbol.
E → E1 # T { E. value =  E1 .value * T. value }
      |         T {E. value = T. value}
T → T1 & F { T. value = T1. value + F. value}
      |         F { T. value = F. value }
F → num {F. value = num. value }
Compute E.value for the root of the parse tree for the expression:2 # 3 & 5 # 6 & 4.