1

Let's say I have the following two grammars, and V is the start symbol.

$V \to aVb | ab | \Lambda$

and

$V \to aTb | ab$

$T \to aTb | \Lambda$

I refute that these are equivalent because with the first grammar we are able to print out an empty string, but are not possible to do this with the second grammar. Am I approaching this problem in the correct way?

  • You are certainly right, $\Lambda$ is in the language generated by the first grammar, not the second. Be careful with terminology, a grammar doesn't "print out" anything. Moreover, $\Lambda$ is nothing, what would it mean to "print it out"? – vonbrand Sep 10 '15 at 19:24

2 Answers2

1

That is correct. More specifically, the language that is generated by the first grammar is $\{a^n b^n \mid n \in \mathbb{N}\}$, while the second grammar generates $\{a^{n+ 1} b^{n + 1} \mid n\in \mathbb{N}\}$.

Dominik
  • 19,963
0

Am I approaching this problem in the correct way?

Yes.

Thumbnail
  • 563