Top 80+ Solved Theory of Computation and Compiler Design MCQ Questions Answer

From 31 to 45 of 74

Q. Which of the following statements in true?

a. If a language is context free it can always be accepted by a deterministic push-down automaton

b. The union of two context free languages is context free

c. The intersection of two context free languages is context free

d. The complement of a context free language is context free

  • b. The union of two context free languages is context free

Q. Which of the following is true for the language {a^p} p is prine ?

a. It is not accepted by a turing machine

b. It is regular but not context free

c. It is context free but not regular

d. It is neither regular nor context free but accepted by a turing machine

  • d. It is neither regular nor context free but accepted by a turing machine

Q. If L and L' are recursively enumerable, then L is

a. regular

b. context free

c. context sensitive

d. recursive

  • d. recursive

Q. Consider the following context free languages:L1 = {0^i 1^j 2^k | i+j = k}L2 = {0^i 1^j 2^k | i = j or j = k}L3 = {0^i 1^j | i = 2j+1}Which of the following option is true?

a. L1, L2 and L3 can be recognized by Deterministic Push down automata

b. L1, L2 can be recognized by Deterministic Push down automata

c. L1, L3 can be recognized by Deterministic Push down automata

d. None of the above

  • c. L1, L3 can be recognized by Deterministic Push down automata

Q. Consider three decision problems P1, P2 and P3. It is known that P1 is decidable and P2 is undecidable. Which one of the following is TRUE?

a. P3 is decidable if P1 is reducible to P3

b. P3 is undecidable if P3 is reducible to P2

c. P3 is undecidable if P2 is reducible to P3

d. P3 is decidable if P3 is reducible to P2's complement

  • c. P3 is undecidable if P2 is reducible to P3

Q. Consider the following decision problems:(P1) Does a given finite state machine accept a given string(P2) Does a given context free grammar generate an infinite number of stingsWhich of the following statements is true?

a. Both (P1) and (P2) are decidable

b. Neither (P1) nor (P2) are decidable

c. Only (P1) is decidable

d. Only (P2) is decidable

  • a. Both (P1) and (P2) are decidable

Q. In a compiler, keywords of a language are recognized during

a. parsing of the program

b. the code generation

c. the lexical analysis of the program

d. dataflow analysis

  • c. the lexical analysis of the program
Subscribe Now

Get All Updates & News