Search code examples
finite-automataautomatastate-machineautomata-theory

Give context-free grammars that generate the following language


Give context-free grammars that generate the following language. In all parts the alphabet ∑ is {x,s}. {w| w starts and ends with the different symbols}


Solution

  • S -> xAs | sAx
    A -> xA | sA | xAs | sAx | e 
    

    e = epsilon