In: Computer Science
Is the L(r1) = L(r2) where r1 = (ab*+c)(λ+∅) and r2 = (a+c)(b*+∅)? what are the languages of L(r1), L(r2)? show the definition's using regular expression, assume Σ = (a,b,c)
Answer: No, L(r1) is not equal to L(r2)
Input Alphabet Given Σ = (a,b,c)
Regular Expression -1
r1 = (ab*+c)(λ+∅)
r1 = (ab* λ + ab* ∅ + c λ + c ∅ )
r1 = (ab* λ + ab* ∅ + c λ + c ∅ )
r1 = (ab* λ + ∅ + c λ + ∅ )
r1 = (ab* λ + c λ )
r1 = (ab* + c ) // either single c or a followed by any number of b's (including zero b's)
L(r1) = { c , a ,ab ,abb, abbb,...............}
Regular Expression -2
r2 = (a+c)(b*+∅)
r2 = (a b*+a ∅ + c b*+c ∅)
r2 = (a b*+ ∅ + c b*+ ∅)
r2 = (a b*+ c b*)
// either c followed by any number of b's (including zero b's) or a followed by any number of b's (including zero b's)
L(r2) = { c , a ,ab ,abb, abbb,.... ,cb,cbb,cbbb, ...........................}
Rule-1
Rule-2
Definition: A Regular Expression RE can be defined as;
If X is a RE denoting the language L(X) and Y is a RE denoting the language L(Y), then
Note:
L (ε) = { ε } // epsilon ε is a RE indicates the language containing an empty string.
L ( ∅ ) = { } // null symbol ∅ is a RE denoting an empty language.
L = {x} // x is a RE where