-
Consider the following languages:
L1 = {WW| W ∈ {a, b}*}
L2 = {WWR| W ∈ {a, b}*,WR is the reverse of W}
L3 = {02i | i is an integer}
L4 = {02i | i is an integer}
Which of the languages are regular?
-
- L1 and L2
- L2, L3 and L4
- L3 and L4
- Only L3
- L1 and L2
Correct Option: D
Lets study the regular language first and then will choose which language is regular. Conventions on regular expression.
1. Bold face is not used for regular expressions when the expression is not confusing. So, for example, (r + s) is used instead of (r + s).
2. The operation * has precedence over concatenation, which further has precedence over union (+). Thus, the regular expression (a + b(c*))) is written as a + bc*.
3. The concatenation of k r's, where r is a regular expression, is written as rk. Thus, for example rr = r2. The language corresponding to rk is Lkr, where Lr is the language corresponding to the regular expression r. For a recursive definition of Lkr .
4. The (r+) is used as a regular expression to represent L+r .
L3 = { 02i | i is an integer } follows all the conventions of the regular language and therefore, is regular.