Gate2020 cs Q17

0. Consider the language L = {an| n ≥ 0} ∪ { anbn | n ≥ 0} and the following statements.
I. L is deterministic context-free.
II. L is context-free but not deterministic context-free.
III. L is not LL(k) for any k.
Which of the above statements is/are TRUE?

  • Option : B
  • Explanation :
    Statement I - L = {an| n ≥ 0} ∪ { anbn | n ≥ 0}
                ↓             ↓
              Linear power      well know DCFL
    ∴ it is regular
    ∴ L = Regular ∪ DCFL {use the closure properties}
    L = DCLF
    Statement--III As we cannot write LL( k ) grammar, for any value of k, Hence statement III is correct.
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 *