Exam-style question
Try this first
Given the production rules <letter> ::= "a" | "b" and <word> ::= <letter> | <letter> <word>, which string can be generated?.
- A.aba
- B.abc
- C.baa1
- D.empty string
Model answer
What a good answer should say
- aba
Explanation
Why this works
Each word consists of one or more letters, and each letter must be either "a" or "b". Therefore, "aba" can be generated.
Common mistake
No common mistake is linked to this question yet.
