0

Regarding the language L2 where the #a's >= #b's I thought of the following:

S -> SaSbS 
S -> SbSaS
S -> SaS
S -> ε

When it comes to L1 I thought of utilising L2 in the following way and give an infinite degree of freedom to the number of a's:

S -> L1 A L1
A -> aA'
A'-> aA' | ε

I know that there are similar questions answered on this topic but I wanted to make my own attempt since the answers provided are not the same and two distinct CFGs may produce the same language. Are the CFGs provided correct?

RookieCookie
  • 302
  • 3
  • 12

0 Answers0