-
Which of the following languages is/are regular?
L1 : {wxwR | w, x 7isin; {a, b}* and |w|, |x| > 0}, wR is the reverse of string w
L2 : {an bm | m ≠ n and m, n ≥ 0}
L3 : {ap bq cr | p, q, r ≥ 0}
-
- L1 and L3 only
- L2 only
- L2 and L3 only
- L3 only
- L1 and L3 only
Correct Option: A
L1 = {wxwR| w, x ∈ {a, b}* and |w|, |x| > 0}
wR is reverse of string w.
It is regular
Regular expression
a (a + b)* a + b (a + b)* b
L2 = { an bm | m ≠ n , m, n ≥ 0 }
Hence m ≠ n, that mean n is greater than m, or m is greater than n.
So we need memory, so we can't draw DfA for it.
L3 = { ap bq cr | p, q, r ≥ 0 }
a, b, c