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…
- A.
R1 is equal to (a+b)*
- B.
R1=R2
- C.
R1 U R2 will contain φ
- 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)*
Loading lesson…