1

please solve this question.thanks

Consider the language L expressed by (a+b)*a defined over Σ = {a, b}. Draw FA and construct the CFG corresponding to the language L.

nomia
  • 59
  • 3
    Why..? Just "thanks" is not enough to show your respect. Consider at least stating your own ideas please. – ftfish Feb 07 '14 at 19:50

3 Answers3

3

i am new here this is why i don't know how to post or where to write.sorry i bother you but i just want to match my answer because i was not sure about my answer.enter image description here

thank you for answer.

nomia
  • 59
  • 1
    The language L contains strings that end with "a", but with your grammar you don't describe this.. You could modify your grammar as followed: $$S \rightarrow Aa$$ $$A \rightarrow aA|bA| \varnothing $$ So the word that is accepted contains a sequence of $a$ and $b$ that is created by $A$ and it ends with $a$. As regards the DFA you have to describe which is the initial state and which the final state. – Mary Star Feb 08 '14 at 23:16
2

A context free grammar corresponding to the language $L$ is: $$S \to aS|bS|a$$

Mary Star
  • 13,956
  • The grammar is correct. But it is not context free. It is regular, since the language it produces is regular. – frabala Feb 14 '14 at 18:22
0

enter image description here Question:Consider the language L expressed by (a+b)*a defined over Σ = {a, b}. Draw FA and construct the CFG corresponding to the language L.

Solution: (a+b)*a

Rizwan
  • 1