0
Write regular expression for the following languages.

(i) Language containing all the strings in which every pair of adjacent a's appears before any pair of adjacent b over the alphabet ∑ = {a, b}

(ii) Language containing all the strings in which all possible combination of a's and b's is present but strings does not have two consecutive a's , over the alphabet ∑= {a, b}.

Mumbai university > Comp > SEM 4 > TCS

Marks: 5M

Year: Dec 2015

0  upvotes
0

(i) Language containing all the strings in which every pair of adjacent a's appears before any pair of adjacent b over the alphabet ∑ = {a, b}.

Solution:

  • Using R(L), to denote the regular expression for the given language L.

  • We have R(L)= Strings in which every pair of adjacent a's appears before any pair of adjacent b over the alphabet.

  • So, R(L) = (a + ba)* (b + ab)* (a + €)

(ii) Language containing all the strings in which all possible combination of a's and b's is present but strings does not have two consecutive a's , over the alphabet ∑= {a, b}.

Solution:

  • Using R(L), to denote the regular expression for the given language L.

  • We have R(L)= Strings in which all possible combination of a's and b's is present but strings does not have two consecutive a's , over the alphabet.

  • So, R(L) = (b + ab) * + (b + ab)* aa(b + ba)*

0  upvotes
Please log in to add an answer.

Next up

Read More Questions

If you are looking for answer to specific questions, you can search them here. We'll find the best answer for you.

Search

Study Full Subject

If you are looking for good study material, you can checkout our subjects. Hundreds of important topics are covered in them.

Know More