Theory of Computation - Context free languages

6. P, Q, R are three languages, if P and R are regular and if PQ = R, then

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


7. A class of language that is closed under

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


8. The productions
E—>E+E
E—>E—E
E-->E*E
E —> E / E
E —> id

Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


9. Which of the following definitions below generates the same language as L, where
L = {xn yn such that n > = 1} ?
I. E —> xEy | xy
II. xy | (x+ xyy+)
III .x+y+

  • Option : A
  • Explanation :
    II generates strings like xxyyy, which are not supposed to be.
    III generates strings like xyy, which are not supposed to be.
    I can be verified to generate all the strings in L and only those.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


10. Following context free grammar
S —> aB | bA
A —>b | aS | bAA
B —> b | bS | aBB
generates strings of terminals that have

  • Option : A
  • Explanation :
    S → aB → aaBB → aabB → aabb
    So (b) is wrong. We have
    S → aB → ab So
    (c) is wrong.
    A careful observation of the productions will reveal a similarity. Change A to B, B to A, a to b and b to a. The new set of productions will be the same as the original set. So (D) is false and (A) is the correct answer.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *