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
Answer and explanation
Concise answer
aba
Why this is correct
Each word consists of one or more letters, and each letter must be either "a" or "b". Therefore, "aba" can be generated.
Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.
Common mistake
No common mistake is linked to this question yet.
