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

Discussion

Which of the following pairs of regular expressions are equivalent ?

  • A.\(1(01)^{*}\) and \((10)^{*}1\)
  • B.\(x(xx)^{*}\) and \((xx)^{*}x\)
  • C.\(x^{+}\) and \(x^{+}x^{*+}\)
  • D.All of the above

Answer: D

The answer is All of the above: every pair is equivalent.

  • \(1(01)^{*}\) and \((10)^{*}1\) both give 1, 101, 10101, ...: alternating strings that begin and end with 1.
  • \(x(xx)^{*}\) and \((xx)^{*}x\) both give the strings of x of odd length: x, xxx, xxxxx, ...
  • \(x^{+}\) and \(x^{+}x^{*+}\): since \((x^{*})^{+} = x^{*}\), the second is \(x^{+}x^{*} = x^{+}\), one or more x's.

Because each of the three pairs describes the same language, no single pair is the whole answer.

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

Post your comment

Please log in or register to post a comment.