Question
Context Free Grammar Related Question Question: Eliminate ? productions, unit productions, useless symbols and then rewrite the resulting grammar in the Chomsky Normal Form (in
Context Free Grammar Related Question
Question:
Eliminate ? productions, unit productions, useless symbols and then rewrite the resulting grammar in the Chomsky Normal Form (in that order) for the following two input grammars:
S -> 0E0 | 1FF | ?
E -> G
F -> S | E
G -> S | ?
_____________________________________________________________________________________________________________________
I am having trouble answering this question, mainly because I find that the Grammer just loops through itself no matter the derivation. When you remove null productions for start state S, you go through removing the null productions in G, and then E, and then F, and then S again, or when you are removing useless Unit Productions, I don't know when to stop. What I've got so far is after reducing the unit productions, before we begin converting to Chomsky Normal Form, I get:
S' -> 0E0 | 1FF | 00 | 1F | 1
S -> 0E0 | 1FF | 00 | 1F | 1
F -> 0E0 | 1FF | 00 | 1F | 1
E-> 0E0 | 1FF | 00 | 1F | 1
I don't have time to show my work, I just followed the standard rules of reduction for Null and Unit productions before converting to Chomsky Normal Form, this just doesn't look correct. I'd appreciate any help I can get. Thanks in advance!
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started