logo

Question detail

Given the production rules <letter> ::= "a" | "b" and <word> ::= <letter> | <letter> <word>, which string can be generated?

Try the question, check the answer, then read the explanation to understand the curriculum point.

At a glance

MCQ

Type

practice

Style

Topic

Context-free languages

Exam-style question

Try this first

Given the production rules <letter> ::= "a" | "b" and <word> ::= <letter> | <letter> <word>, which string can be generated?.

  1. A.aba
  2. B.abc
  3. C.baa1
  4. 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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions

No questions are published for this page yet.