The language is {w|w has an odd length} and the alphabet is {0,1}.
I came up with a solution of
S->1p|0p|e
p->00p|11p|01p|10p|e
and the book has
S->0|1|0S0|0S1|1S0|1S1
are these equivalent?
The language is {w|w has an odd length} and the alphabet is {0,1}.
I came up with a solution of
S->1p|0p|e
p->00p|11p|01p|10p|e
and the book has
S->0|1|0S0|0S1|1S0|1S1
are these equivalent?
They are not. The first grammar describes a language that includes the empty string; e
should not be an option for expanding S
.