in Theory of Computation
2,709 views
3 votes
3 votes
Convert the given CFG to GNF.

$S \rightarrow MN$
$M\rightarrow aMb|\epsilon $
$N\rightarrow aNb|\epsilon $
in Theory of Computation
2.7k views

4 Comments

i'm not saying its wrong just asking that is there any need of variables A1 and A2
1
1

@Utkarsh , yes , I think I have taken extra A1 and  A2 ...we can replace it by M and N

1
1
yeah it seems correct otherwise.
2
2

1 Answer

2 votes
2 votes

Although, @Tuhin Dutta is quite right in his approach. I would just like to add something.

The initial steps involving the conversion (CFG to GNF) actually mention that the UNIT & NULL productions must be removed before the final conversion.

So, I guess that the 'ϵ' would not stay in the final result.

To summarize, here is the solution:

In Step-2, I think the substitution method (to eliminate 'ϵ') will also be applied to 'S' because of which we'll have more number of symbols in the final GNF form.

Different sources tell different methods of doing this conversion so, I'm open to any critical evaluation.

Related questions