-2

find a simple grammar (a.k.a s-grammar) for the following language:

L={(ab)2mb :m>=0}

[i did this but it is wrong]

S-> aASBB|b

A-> a

B->b

Fulla
  • 79
  • 7

1 Answers1

1

What about this?

S -> aA | T
A -> bB
B -> aC
C -> bS
T -> b

This is a regular grammar - all productions of the form X -> sY or X -> t, and corresponds to a minimal DFA for the language in question via a direct mapping of productions to transactions and nonterminal symbols to states.

Patrick87
  • 27,682
  • 3
  • 38
  • 73