Home » Theory of Computation » Theory of computation miscellaneous » Question

Theory of computation miscellaneous

Theory of Computation

  1. Consider the following statements about the context-free grammar:
    G = { S → SS, S → ab, S → ba, S → ∈ }
    1. G is ambiguous.
    2. G produces all strings with equal number of a's and b's.
    3. G can be accepted by a deterministic PDA.
    Which combination below expresses all the true statements about G?
    1. 1 only
    2. 1 and 3
    3. 2 and 3
    4. 1, 2 and 3
Correct Option: B

Due to S → S this Grammar is ambiguous right hand side has two Non terminals. Also the strings like aaabbb have equal no. of a's & b's but can't be produced by this grammar. So 2 is false.
Statement 3 is true since it is a CFG so accepted by PDA.



Your comments will be displayed only after manual approval.