0

I want to remove the epsilon transition from following grammar: \begin{eqnarray} S & \rightarrow & A | B \\ A & \rightarrow & \epsilon \\ B & \rightarrow & aBa \\ B & \rightarrow & b \\ \end{eqnarray} This is the result of removing $\epsilon$ transition: \begin{eqnarray} S & \rightarrow & \epsilon | B \\ B & \rightarrow & aBa \\ B & \rightarrow & b \end{eqnarray}

My question is what's the difference between languages that accept these two grammars?

clemens
  • 382
  • 2
  • 12
T.Meyer
  • 11
  • 2

2 Answers2

1

There is no difference. Both grammars describe the same language $$L = \{ \epsilon \} \cup \{ a^nba^n | \forall n > 0\}.$$

clemens
  • 382
  • 2
  • 12
0

No difference. You can't re-choose the terminal $A$ after choosing it even once in your example.

clemens
  • 382
  • 2
  • 12
Gal Rettig
  • 62
  • 6