Question 1 
L2 is contextfree.  
L1 intersection L2 is contextfree.  
Complement of L2 is recursive.  
Complement of L1 is contextfree but not regular. 
Discuss it
Question 2 
Deterministic finite automata(DFA) and Nondeterministic finite automata(NFA)  
Deterministic push down automata(DPDA)and Nondeterministic push down automata(NPDA)  
Deterministic singletape Turing machine and Nondeterministic singletape Turing machine  
Singletape Turing machine and multitape Turing machine 
Discuss it
NDPDA can handle languages or grammars with ambiguity, but DPDA cannot handle languages with ambiguity and any contextfree grammar.
Question 3 
A  
B  
C  
D 
Discuss it
Question 4 
Push Down Automata (PDA) can be used to recognize L1 and L2  
L1 is a regular language  
All the three languages are context free  
Turing machine can be used to recognize all the three languages 
Discuss it
L2 is not regular, can be proved using pumping lemma (refer to Ullman). But L2 is CFL.
S → AB A → 0Aε B → 1BεL3 is not CFL, can be proved using pumping lemma (refer to Ullman). But L3 is Recursive. Every regular language is also a CFL. So PDA can be used to recognized L1 and L2. As a CFL and Regular language is algo a Recursive language. Hence, Turing machine can be used to recognise L1, L2 and L3. L2 is not regular, can be proved using pumping lemma (refer to Ullman). But L2 is CFL.
S → AB A → 0Aε B → 1BεL3 is not CFL, can be proved using pumping lemma (refer to Ullman). But L3 is Recursive. Every regular language is also a CFL. So PDA can be used to recognised L1 and L2. As a CFL and Regular language is algo a Recursive language. Hence, turing machine can be used to recognise L1, L2 and L3. Source: http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html
Question 5 
Only L2 is context free  
Only L2 and L3 are context free  
Only L1 and L2 are context free  
All are context free 
Discuss it
Question 6 
All palindromes  
All odd length palindromes.  
Strings that begin and end with the same symbol  
All even length palindromes 
Discuss it
Question 7 
L1 = {  m, n >= 0 } L2 = {  i, j, k >= 0 }Then L is
Not recursive  
Regular  
Context free but not regular  
Recursively enumerable but not context free. 
Discuss it
Question 8 
not recursive  
is recursive and is a deterministic CFL.  
is a regular language.  
is not a deterministic CFL but a CFL. 
Discuss it
 For each occurrence of ‘0’ , we PUSH X in the stack.
 When ‘2’ appears, no stack operation is performed. But, state of the automata is changed.
 For each occurrence of ‘1’ , we POP X from the stack.
 If at the end Z_{0} is on the stack top then input string is accepted
 When ‘0’ appears in the input string , we replace it with X .Then, traverse to the rightmost corner and replace ‘1’ with Y.
 We go back to the leftmost ‘0’ and repeat the above process.
 While traversing rightwards from the beginning of the input string, if after X, ‘2’ appears and after ‘2’, Y appears then we reach the HALT state. Thus, the given language is recursive. Every recursive language is a CFL. Thus, option (B) is the answer. Please comment below if you find anything wrong in the above post.
Question 9 
S > aB S > bA B > b A > a B > bS A > aS B > aBB A > bAAWhich of the following strings is generated by the grammar?
aaaabb  
aabbbb  
aabbab  
abbbba 
Discuss it
S > aB S > bA B > b A > a B > bS A > aS B > aBB A > bAAWe can derive aabbab using below sequence
S > aB [Using S > aB] > aaBB [Using B > aBB] > aabB [Using B > b] > aabbS [Using B > bS] > aabbaB [Using S > aB] > aabbab [Using B > b]
Question 10 
1  
2  
3  
4 
Discuss it
Question 11 
None of the languages  
Only L1  
Only L1 and L2  
All the three languages 
Discuss it
Question 12 
L1 only  
L3 Only  
L1 and L2  
L2 and L3 
Discuss it
Question 13 
G = {S → SS, S → ab, S → ba, S → Ε} I. G is ambiguous II. G produces all strings with equal number of a’s and b’s III. G can be accepted by a deterministic PDA.Which combination below expresses all the true statements about G?
I only  
I and III only  
II and III only  
I, II and III 
Discuss it
Question 14 
A  
B  
C  
D 
Discuss it
Question 15 
max(l,m) + 2  
l + m + 2  
l + m + 3  
max(l, m) + 3 
Discuss it
S > ACCB C > aCbepsilon A > aAa B > BbbNow, the most optimal and intuitive way to generate a string of the form a^{l}b^{m} would be to first use "C > aCbepsilon" production rule to get as many a and b as we can, which would be min(l,m). To get the rest of the string, we could just use latter two production rules accordingly. Formally deriving the string of the general format a^{l}b^{m} from the above grammar 
1. S > AC 2. > A(aCb) 3. > .... 4. > .... 5. > A(a^{m} C b^{m}) 6. > A(a^{m} b^{m}) 7. > aA(a^{m} b^{m}) 8. > .... 9. > .... 10. > a^{(lm1)}A(a^{m} b^{m}) 11. > a^{l} b^{m}From above set of derivation steps we can count the total steps as follows:
Production 1 took 1 step : 1 [using S>AC] Production 25 took steps : min(l,m) [using C>aCb] Production 6 took 1 step : 1 [using C>epsilon] Production 711 took steps : max(l,m)min(l,m) [using A > aAa or B > Bbb] Total steps : max(l,m) + 2Hence, answer should be (A): max(l,m) + 2 This explanation is contributed by Vineet Purswani.
Question 16 
L1 = {a^{n}b^{n}c^{m}  n, m > 0} L2 = {a^{n}b^{m}c^{m}  n, m > 0}Which one of the following statements is FALSE?
L1 ∩ L2 is a contextfree language  
L1 U L2 is a contextfree language  
L1 and L2 are contextfree language  
L1 ∩ L2 is a context sensitive language 
Discuss it
Question 17 
L1 = {ww^{R} w ∈ {0, 1}*} L2 = {w#w^{R}  w ∈ {0, 1}*}, where # is a special symbol L3 = {ww  w ∈ (0, 1}*)Which one of the following is TRUE?
L1 is a deterministic CFL  
L2 is a deterministic CFL  
L3 is a CFL, but not a deterministic CFL  
L3 is a deterministic CFL 
Discuss it
Question 18 
regular  
contextfree but not regular  
context sensitive but not context free  
type0 but not context sensitive 
Discuss it
We construct a PDA for the given language.
PUSH Z_{0} in the stack initially. PUSH X in the stack for each occurrence of ‘a’ . PUSH Y in the stack for each occurrence of ‘b’. POP X and Y from the stack for each occurrence of ‘c’.
If after popping all X and Y from the stack , no input element is left in the string and we get Z_{0} on the top of the stack then the string is accepted.
Thus, option (B) is correct.
Please comment below if you find anything wrong in the above post.
Question 19 
L is necessarily finite  
L is regular but not necessarily finite  
L is context free but not necessarily regular  
L is recursive but not necessarily context free 
Discuss it
The strings of a language L can be effectively enumerated means a Turing machine exists for language L which will enumerate all valid strings of the language.
If the string is in lexicographic order then TM will accept the string and halt in the final state. But, if the string is not lexicographic order then TM will reject the string and halt in nonfinal state.
Thus, L is recursive language.
We can not construct PDA for language L. So, the given language is not context free.
Thus, option (D) is correct.
Please comment below if you find anything wrong in the above post.
Question 20 
G is not ambiguous  
There exist x, y, ∈ L (G) such that xy ∉ L(G)  
There is a deterministic pushdown automaton that accepts L(G)  
We can find a deterministic finite state automaton that accepts L(G) 
Discuss it
An ambiguous grammar can be converted to unambiguous one. Here we can get grammar in partial GNF form as S > ab  abS  aSb  aSbS We can convert this into GNF too but no need for PDA reasoning so, above grammar is not a ambiguous thus a definite PDA possible Trick for this is but just deriving 34 strings from grammar, we can easily understand its (a^{n}b^{n})* above expression a^{n}b^{n} is in CFL thus closure of DCFG is a DCFG i.e., you can get L = {ε, ab, abab, aabb, aabbab, abaabb, ababab,......} PDA will push "a" until "b" is read, start popping "a" for the "b" read. If "a" is read again from the tape then push only when stack is empty else terminate. Repeat this until string is read. Remember fastest way to get answer is by elimination other options.
Question 21 
Context Free  
Regular  
Deterministic Context Free  
Recursive 
Discuss it
But in the given case, length of stack is restricted. Thus, this pushdown automata can only accept languages which can also be accepted by finite state automata and a finite state automata accepts only regular languages.
Thus, B is the correct choice.
Please comment below if you find anything wrong in the above post.
Question 22 
If a language is context free it can always be accepted by a deterministic pushdown automaton  
The union of two context free languages is context free  
The intersection of two context free languages is context free  
The complement of a context free language is context free 
Discuss it
Question 23 
10110  
10010  
01010  
01001 
Discuss it
Question 24 
L1 = {a^{m}b^{n}a^{n}b^{m} ⎪ m, n ≥ 1} L2 = {a^{m}b^{n}a^{m}b^{n} ⎪ m, n ≥ 1} L3 = {a^{m}b^{n} ⎪ m = 2n + 1}
L1 and L2 only  
L1 and L3 only  
L2 and L3 only  
L3 only 
Discuss it
Question 25 
There exist contextfree languages such that all the contextfree grammars generating them are ambiguous  
An unambiguous context free grammar always has a unique parse tree for each string of the language generated by it.  
Both deterministic and nondeterministic pushdown automata always accept the same set of languages  
A finite set of string from one alphabet is always a regular language. 
Discuss it
A) For realworld programming languages, the reference CFG is often ambiguous, due to issues such as the dangling else problem. //Wikipedia
B) A string is ambiguous if it has two distinct parse trees;The grammar is unambiguous,if a string has distinct parse trees.
C) Deterministic pushdown automata can recognize all deterministic contextfree languages while nondeterministic ones can recognize all contextfree languages
Therefore it's FALSE
D)Properties of Regular Language:
 The set of regular languages over an alphabet is closed under operations union, concatenation and Kleene star.
 Finite languages are regular
Question 26 
A  
B  
C  
D 
Discuss it
• Data Forwarding : In figure(2),ADD and SUB instructions have data dependency due to R1 registers,2nd and 3rd instructions read the register R1 value at ID stage but 1st instruction updates the value of R1 after WB stage .So 2nd SUB instruction is stalled for next two cycles to get updated value of R1 register.
• Internal data forwarding is a mechanism to reduces the stalls due to data dependency, it uses hardware technique to forward the result of interstage buffer register (IBR) to next instruction's buffer register. As soon as result is available after ALU operation (in 1st instruction), result is transferred as input to ALU unit, then updated value of R1 gets available after ALU operation (otherwise it is available after WB satge),so no stalls are there.
• The ALU result from the EX/MEM register is always fed back to the ALU input latches. If the forwarding hardware detects that the previous ALU operation has written the register corresponding to the source for the current ALU operation, con trol logic selects the forwarded result as the ALU input rather than the value read from the register file.
• As given in Ques, It is straight from question,register R1 value is copied(or better say loaded) to memory location M[100] then M[100]'s value is stored to registers R2 and R3 .Options A,B and C are wrong since they do not produce same result as desired.
• Let's suppose register R1,R2,R3 and memory reference M[100] have initial values 10,20,30 and 40 respectively then after the execution of sequence of operation,registers R2,R3 and memory references M[100] have values 10,10 and 10 respectively.
• In option A ,after the execution of operations,registers R2,R3 and memory references M[100] have values 20,10 and 20 respectively. In option B, registers R2 , R3 and memory references M[100] have values 10,10 and 40 respectively and option C ,reg isters R2,R3 and memory references M[100] have values 20,20 and 10 respectively . But option D produces ,all registers and memory reference have value same value 10 as desired , so option (D) is correct only.
This solution is contributed by Nirmal Bharadwaj.
Question 27 
A  
B  
C  
D 
Discuss it
Question 28 
(s, a, Z_{0}) → (s, XXZ_{0})
(s, ϵ, Z_{0}) → (f, ϵ)
(s, a, X) → (s, XXX)
(s, b, X) → (t, ϵ)
(t, b, X) → (t,.ϵ)
(t, c, X) → (u, ϵ)
(u, c, X) → (u, ϵ)
(u, ϵ, Z_{0}) → (f, ϵ)
The language accepted by the PDA is
{a^{l}b^{m}c^{n}  l = m = n}  
{a^{l}b^{m}c^{n}  l = m}  
{a^{l}b^{m}c^{n}  2l = m+n}  
{a^{l}b^{m}c^{n}  m=n} 
Discuss it
Question 29 
L_{1} = {a^{i} b^{j} c^{k}  i = j, k ≥ 1}
L_{1} = {a^{i} b^{j}  j = 2i, i ≥ 0}
Which of the following is true?
L_{1} is not a CFL but L_{2} is  
L_{1} ∩ L_{2} = ∅ and L_{1} is nonregular  
L_{1} ∪ L_{2} is not a CFL but L_{2} is  
There is a 4state PDA that accepts L_{1}, but there is no DPDA that accepts L_{2} 
Discuss it
B: L_{1} ∩ L_{2} = ∅ is true
L_{1}is not regular => true
=> B is true
C: L_{1} ∪ L_{2} is not a CFL nut L_{2} is CFL is closed under Union
=> False
D: Both L_{1} and L_{2} accepted by DPDA
Question 30 
{0^{n} 10^{2n}  n ≥ 1}  
{0^{i} 10^{j} 10^{k}  i, j, k ≥ 0} ∪ {0^{n} 10^{2n}  n ≥ l}  
{0^{i} 10^{j}  i, j ≥ 0} ∪ {0^{n} 10^{2n}  n ≥ l}  
The set of all strings over {0, 1} containing at least two 0's  
None of the above 
Discuss it
Question 31 
S→aS∣A
A→aAb∣bAa∣ϵ
Which of the following strings is generated by the grammar above?
aabbaba  
aabaaba  
abababb  
aabbaab 
Discuss it
Question 32 
S→aS∣A
A→aAb∣bAa∣ϵ
For the correct answer in Q75, how many steps are required to derive the string and how many parse trees are there?
6 and 1  
6 and 2  
7 and 2  
4 and 2 
Discuss it
Question 33 
C1: For DFA (ϕ, Ʃ, δ, qo, F), if F = ϕ, then L = Ʃ* C2: For NFA (ϕ, Ʃ, δ, qo, F), if F = ϕ, then L = Ʃ* Where F = Final states set ϕ = Total states setChoose the correct option ?
Both are true  
Both are False
 
C1 is true, C2 is false  
C1 is false, C2 is true

Discuss it
Question 34 
l ≤ P ≥ r  
l = P = r  
l ≥ P ≤ r  
none of these

Discuss it
# parse tree = # LMD’s = # RMD’s
Therefore l = P = r.