Remove useless, unit, and λ-productions from the following grammar. What language does it produce? S → aA | aBB A → aaA | λ B → bB | bbC C → B
Added by Lance V.
Step 1
- A production is useless if it does not contribute to the language generated by the grammar. We need to check if all non-terminals can derive a terminal string and if they can be reached from the start symbol. - Starting with S: - S → aA (A can derive Show more…
Show all steps
Your feedback will help us improve your experience
Akash M and 78 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
7. Eliminate useless productions from S -> aA | B | C A -> aB | XB B -> Aa C -> cCD D -> ddd | Cd.
Akash M.
What language does the grammar with these productions generate? S → Aa, A → B, B → Aa.
The language $L$, is defined as set of strings that start and end with equal number of a's and contain any number of b's. The grammar $L(G)$ for language $L$ is defined with productions as: (A) $S \rightarrow a B a$ $B \rightarrow \varepsilon \mid b B$ (B) $S \rightarrow a B$ $B \rightarrow a \mid b B$ (C) $S \rightarrow a T \mid b S$ $T \rightarrow a T|b T| a \mid b$ (D) $S \rightarrow \mathrm{B} \mid a \mathrm{Sa}$ $B \rightarrow \varepsilon \mid b B$
Databases
File Management
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD