Question 43Asked in UGC NET Computer Science, August 2016 (Paper II & III, Selected Questions)

Consider the following identities for regular expressions: (i) (r + s)* = (s + r)*

Consider the following identities for regular expressions: (i) (r + s)* = (s + r)* (ii) (r*) = r* (iii) (r* s*)* = (r + s)* Which of the above identities are true?
  1. A(i) and (ii) only
  2. B(ii) and (iii) only
  3. C(iii) and (i) only
  4. D(i), (ii) and (iii)
Show answerHide answer

Correct answer: (D) (i), (ii) and (iii)

Explanation

(r + s)* generates any string over r and s, the same as (s + r)*. (r*)* generates any string of r's, the same as r*. (r* s*)* also generates any string over r and s, the same as (r + s)*. All the identities are true.

From UGC NET Computer Science PYQ, August 2016 (Paper II & III, Selected Questions)

This is question 43 of UGC NET Computer Science PYQ, August 2016 (Paper II & III, Selected Questions). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.