Question: Consider the CFG (i) Prove that X can generate any b*. (ii) Prove that XaXaX can generate any b*ab*ab*. (iii) Prove that S can generate
Consider the CFG
(i) Prove that X can generate any b*.
(ii) Prove that XaXaX can generate any b*ab*ab*.
(iii) Prove that S can generate (b*ab*ab*)*.
(iv) Prove that the language of this CFG is the set of all words in (a + b)* with an even number of a's with the following exception: We consider the word A to have an even number of a's, as do all words with no a's, but of the words with no a's only Λ can be generated.
(v) Show how the difficulty in part (iv) can be alleviated by adding the production
S → XS
SSS | XaXaX | A XbX A
Step by Step Solution
3.32 Rating (164 Votes )
There are 3 Steps involved in it
ANSWER i We can prove that X can generate any b by induction on the length of the string For the base case if the length of the string is 0 then the string is which can be generated by X For the induc... View full answer
Get step-by-step solutions from verified subject matter experts
