logo

AQA A-Level Computer Science practice

An FSM has a start state q0 and an accepting state q1. The only transition from q0 is labelled a and leads to q1. From q1, there are transitions labelled a and b that both lead back to q1. Write a regular expression for the language recognised by this FSM and explain how the expression corresponds to the FSM.

Try the question first, then check the answer and practise the same topic again.

At a glance

Question

Type

practice

Style

Topic

Regular languages

Exam-style question

Try this first

An FSM has a start state q0 and an accepting state q1. The only transition from q0 is labelled a and leads to q1. From q1, there are transitions labelled a and b that both lead back to q1. Write a regular expression for the language recognised by this FSM and explain how the expression corresponds to the FSM.

Answer and explanation

Concise answer

The regular expression is a(a|b)*.

Why this is correct

The FSM requires the first character to be a and then permits any sequence of a and b characters. The regular expression expresses exactly those two stages: a followed by (a|b)*.

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.

Related flashcards

No flashcards are published for this page yet.

Related practice questions