logo

Question detail

Which string is generated by the regular expression a(a|b)*?

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

At a glance

MCQ

Type

practice

Style

Topic

Regular languages

Exam-style question

Try this first

Which string is generated by the regular expression a(a|b)*?.

  1. A.ba
  2. B.ababa
  3. C.bbb
  4. D.bbab

Model answer

What a good answer should say

  • ababa

Explanation

Why this works

The expression must begin with a. After that, it can contain zero or more occurrences of either a or b, so ababa is 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.