logo

Question detail

Describe the language recognised by the regular expression (a|b)*abb. Give three example strings that are recognised and one string that is not recognised, explaining your choices.

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

At a glance

Question

Type

practice

Style

Topic

Regular languages

Exam-style question

Try this first

Describe the language recognised by the regular expression (a|b)*abb. Give three example strings that are recognised and one string that is not recognised, explaining your choices.

Model answer

What a good answer should say

  • The language consists of strings made from a and b that end with abb.
  • The part (a|b)* allows any number of a or b characters before the final abb.
  • Examples of recognised strings are abb, aabb and babb.
  • An example that is not recognised is abba, because it ends in a rather than abb.

Explanation

Why this works

The final abb is compulsory. The preceding part can contain any sequence of a and b, including no characters, so the string may be exactly abb or may have additional characters before abb.

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.