Consider the following regular expressions. R1: (a+b+ϵ)+ R2: (a+b+φ)* Select…

Consider the following regular expressions.

R1: (a+b+ϵ)+

R2: (a+b+φ)*

Select the wrong option.

Answer: C. R1 U R2 will contain φR1=(a+b+ϵ)+ = (a+b)* as R1 can generate any string from (a+b)* R2=(a+b+φ)* = (a+b)* as for any regular expression R, we have R+ φ =R, so (a+b+ φ)=(a+b). Hence…

  1. A.

    R1 is equal to (a+b)*

  2. B.

    R1=R2

  3. C.

    R1 U R2 will contain φ

  4. D.

    R1.R2 =(a+b)*

Attempted by 69 students.

Show answer & explanation

Correct answer: C

R1=(a+b+ϵ)+ = (a+b)* as R1 can generate any string from (a+b)*

R2=(a+b+φ)* = (a+b)* as for any regular expression R, we have R+ φ =R, so (a+b+ φ)=(a+b).

Hence R1 U R2 will not contain φ.

Since R1 =R2=(a+b)* so R1.R2 will also equal to (a+b)*

Explore the full course: Gate Guidance By Sanchit Sir

Loading lesson…