Suppose I have the following CFG that I would like to bring to CNF
S -> TA | bA | Ab | b
A -> Aa|a
T -> Ab
Then I have two options to get rid of the nonsolitary terminal a in Aa
1 - Make a new nonterminal K and introduce the rule
The grammar in this case becomes
K->a
S -> TA | bA | Ab | b
A -> AK|a
T -> Ab
2 - Observe that A->a already and use it
The grammar in this case becomes
S -> TA | bA | Ab | b
A -> AA|a
T -> Ab
My intuition is that both should be correct since I don't see that changing a nonterminal's name would change the language the grammar generates but I am not entirely sure.
Thanks.