πŸ“Š Theory of Computation and Compiler Design
Q. The language L = { 0^i 2 1 ^i i>-0 } over the alphabet (0,1,2) is
  • (A) not recurcise
  • (B) is recursive and deterministic CFL
  • (C) is a regular language
  • (D) is not a deterministic CFL but a CFL
πŸ’¬ Discuss
βœ… Correct Answer: (B) is recursive and deterministic CFL
πŸ“Š Theory of Computation and Compiler Design
Q. A minimum state deterministic finite automation accepting the language L = {W |W € {0,1}* , number of 0's and 1's in W are divisible by 3 and 5 respectively has
  • (A) 15 States
  • (B) 11 states
  • (C) 10 states
  • (D) 9 states
πŸ’¬ Discuss
βœ… Correct Answer: (A) 15 States
πŸ“Š Theory of Computation and Compiler Design
Q. If s is a string over (0 + 1)* then let n0 (s) denote the number of 0’s in s and n1 (s)the number of l’s in s. Which one of the following languages is not regular?
  • (A) L = {s € (0 + 1)*n0 (s) is a 3-digit prime
  • (B) L = {s € (0 + 1)* | for every prefix s’ of s, l 0 (s’) — n1 (s’) | <= 2 }
  • (C) L={s € (0+1)* | n0(s) - n1(s) | <= 4}
  • (D) L = {s € (0 + 1) | n0 (s) mod 7 = n1 (s) mod 5 = 0 }
πŸ’¬ Discuss
βœ… Correct Answer: (C) L={s € (0+1)* | n0(s) - n1(s) | <= 4}
πŸ“Š Theory of Computation and Compiler Design
Q. For S € (0+1)* let d(s)denote the decimal value of s(e.g.d(101)= 5).Let L = {s € (0 + 1) | d (s) mod 5 = 2 and d (s) mod 7 != 4)}Which one of the following statements is true?
  • (A) L is recursively enumerable, but not recursive
  • (B) L is recursive, but not context-free
  • (C) L is context-free, but not regular
  • (D) L is regular
πŸ’¬ Discuss
βœ… Correct Answer: (D) L is regular
πŸ“Š Theory of Computation and Compiler Design
Q. Consider the following statements about the context free grammarG = {S - >SS, S - >ab, S - >ba, S - ε}I. G is ambiguousII. G produces all strings with equal number of a’s and b’sIII. G can be accepted by a deterministic PDA.Which combination below expresses all the true statements about G?
  • (A) 1 only
  • (B) 1 and 3
  • (C) 2 and 3
  • (D) 1,2 and 3
πŸ’¬ Discuss
βœ… Correct Answer: (D) 1,2 and 3
πŸ“Š Theory of Computation and Compiler Design
Q. Let L1 be a regular language, L2 be a deterministic context-free language and L3 a recursively enumerable, but not recursive, language. Which one of the following statements is false?
  • (A) L1 n L2 is a deterministic CFL
  • (B) L3 n L1 is recursive
  • (C) L1 U L2 is context free
  • (D) L1 n L2 n L3 is recursively enumerable
πŸ’¬ Discuss
βœ… Correct Answer: (B) L3 n L1 is recursive
πŸ“Š Theory of Computation and Compiler Design
Q. Consider the languages: GATE[2005]L1 = {wwR w €{0, 1} *1L2 ={w#ww € {O,1}*},where # is a special symbolL3 ={www € {0,1}*}Which one of the following is TRUE?
  • (A) L1 is a deterministic CFL
  • (B) L2 is a deterministic CFL
  • (C) L3 is a CFL, but not a deterministic CFL
  • (D) L3 is a deterministic CFL
πŸ’¬ Discuss
βœ… Correct Answer: (B) L2 is a deterministic CFL
πŸ“Š Theory of Computation and Compiler Design
Q. Consider the languages: L1 ={a^n b^n c^m | n,m >01 and L2 ={a^n b^m c^m |n,m> o) Which one of the following statements is FALSE?
  • (A) L1 n L2 is a context-free language
  • (B) L1 u L2 is a context-free language
  • (C) L1 and L2 are context-free languages
  • (D) L1 n L2 is a context sensitive language
πŸ’¬ Discuss
βœ… Correct Answer: (A) L1 n L2 is a context-free language
πŸ“Š Theory of Computation and Compiler Design
Q. Let L1 be a recursive language, and let L2 be a recursively enumerable but not a recursive language. Which one of the following is TRUE?
  • (A) L1' is recursive and L2' is recursively enumerable
  • (B) L1' is recursive and L2' is not recursively enumerable
  • (C) L1' and L2' are recursively enumerable
  • (D) L1' is recursively enumerable and L2' is recursive
πŸ’¬ Discuss
βœ… Correct Answer: (B) L1' is recursive and L2' is not recursively enumerable

Jump to