Let M be the language over {a, b, c} accepting all strings so that: No a's occur before the first c. No b's occur after the first c. The last symbol of the string is c. There are fewer b's than a's. Construct a context-free grammar generating M.
Added by William R.
Step 1
The last symbol of the string is c, so any string in M can be represented as w = xcy, where x and y are strings over {a, b, c}. Show more…
Show all steps
Close
Your feedback will help us improve your experience
Supreeta N and 93 other Calculus 3 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
Each grammar in Exercises is proposed as generating the set $L$ of strings over $\{a, b\}$ that contain equal numbers of a's and b's. If the grammar generates $L$, prove that it does so. If the grammar does not generate $L$, give a counterexample and prove that your counterexample is correct. In each grammar, $S$ is the starting symbol. $$ S \rightarrow a b S|b a S| a S b|b S a| \lambda $$
Automata, Grammars, and Languages
Languages and Grammars
Recommended Textbooks
Calculus: Early Transcendentals
Thomas Calculus
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD