Machine-translated by Google. Questions are authored in English.
Top

Discussion

Consider the Deterministic Finite-state Automaton (DFA) \(\mathcal{A}\) shown below. The DFA runs on the alphabet \(\{0, 1\}\), and has the set of states \(\{s, p, q, r\}\), with \(s\) being the start state and \(p\) being the only final state.

DFA with start state s and only final state p; transitions on 0 and 1: s to r and p, p to p and q, q to r and p, r to r and r

Which one of the following regular expressions correctly describes the language accepted by \(\mathcal{A}\)?

  • A.\(1(0^{*}11)^{*}\)
  • B.\(0(0+1)^{*}\)
  • C.\(1(0+11)^{*}\)
  • D.\(1(110^{*})^{*}\)

Answer: C

The language is \(1(0+11)^{*}\).

From the start state s, a 0 goes to the dead state r, which loops on everything, so every accepted string begins with 1, which reaches the final state p. From p, a 0 loops back to p, and a 1 goes to q, from which a second 1 returns to p while a 0 falls into r. So once in p, the machine stays in an accepting state exactly when the rest of the input is a sequence of blocks '0' and '11', which is \((0+11)^{*}\).

\(0(0+1)^{*}\) describes strings starting with 0, all of which are rejected. \(1(0^{*}11)^{*}\) and \(1(110^{*})^{*}\) both fail to generate 10, which the DFA accepts (s to p on 1, p to p on 0): in the first, anything after the leading 1 must end in 11, and in the second, it must begin with 11.

No comment is present. Be the first to comment.
Loading…

Post your comment

Please log in or register to post a comment.