Q67.Marks: +2.0UGC NET Paper 2: Computer Science 11 March 2023
What is the safest order while simplifying Context Free Grammar?
1.Elimination of ε-productions, Unit productions and then Useless symbols & productions.✓ Correct
2.Elimination of useless symbols & productions, ε-productions and then Unit productions.
3.Elimination of Unit productions, ε-productions and then Useless symbols and productions.
4.Elimination of ε-productions, Useless symbols and productions and then Unit productions.
Solution
The correct answer is Elimination of ε-productions, Unit productions and then Useless symbols & productions.
Key Points
The order for simplifying a context-free grammar (CFG) is:
Elimination of ε-productions.
Elimination of unit productions.
Elimination of useless symbols & productions.
The reasoning behind this order is:
First, eliminate ε-productions: ε-productions can potentially introduce new unit productions into the grammar, so it’s usually better to eliminate these first.
Second, eliminate unit productions: The removal of unit productions could potentially make a previously useful production into a useless one, so it's better to handle unit productions before dealing with useless ones.
Third, eliminate useless symbols and productions: This is typically done last, as the previous elimination steps could potentially create new useless symbols or productions that need to be eliminated.
Therefore, the safest order according to the options provided would be: Elimination of ε-productions, Unit productions, and then Useless symbols & productions. So, your first option is the preferred one.