Answer to Question #170625 in Functional Programming for MUHAMMAD SHAHBAZ ALI

Question #170625

Write a regular expression for the following languages, over sigma=(a,b) All strings that do not end with aa.All strings that contain an even number of b’s. All strings which do not contain the substring ba.


1
Expert's answer
2021-03-12T14:59:25-0500

Given,

"\\Sigma =(a,b)"

Condition (i) It is not ending with aa:

"L=\\{" Not end with aa "\\}"

"=\\{" ends with ab, ba, bb "\\}"

"(a+b)^*(ab+ba+bb)+\\epsilon +a+b"


For the second condition:

"L=\\{" even no of "b's" "\\}"

"=\\{a*ba*)*+a*"


For the third condition:

"L=\\{" not contained ba"\\}"

"=a*b*"


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS