q:
b*ab*(b*ab*ab*)*
The part in () represent number of even a's. we add one a in front to make it odd.
r:
b*ab*(b*ab*ab*)* + b(bb)* + (aba)*
first part for odd a, second for odd bs and third for aba
s:
(aa)* + (aaa)* + (aaaaa)*
first for 2, second for 3 and third for 5
u:
(b*ab*(b*ab*ab*)*).((a*ba*ba*)*a*)
x = b*ab*(b*ab*ab*)*
y = (a*ba*ba*)*a*
Hope this helps.
Please rate the answer if you like it.
Do leave a comment.Any suggestion/query is much appreciated.
Give a regular expression for each of the following languages. r. { x∈{a, b}* | the...