I your first grammar, You can derive epsilon
from S
. So the empty word belong to the described language. Therefore you must have a epsilon
in the second equivalent grammar.
Now in a normal form grammar, when there is a derivation S -> epsilon
, then S
can't appear on the right of a derivation. So the rule
S -> BSA | SA | epsilon
is not allowed is a Chomsky normal form. So you probably want something as
S_0 -> S | epsilon // initial
S -> BA | A | BSA | SA
[...]