Answer:
See explaination
Explanation:
In our grammar for arithmetic expression, the start symbol is <expression>, so our initial string is:
<expression >
Using rule 5 we can choose to replace the nonterminal, producing the string:
<expression >*<expression >
We now have two nonterminals, to replace, we can apply rule three to the first nonterminal, producing the string:
<expression >+<expression>*<expression>
We can apply rule two to the remaining nonterminal, we get:
(number)+number*number
This is a valid arithmetic expression as generated by grammar.
Given a grammar G with start symbol S, if there is some sequence of production that when applied to the initial string S, result in the string s, then s is in L (G). the language of the grammar.