There’s a question on my exercise sheet to find the complement of r = (a|b)*ab(a|b)*
I’ve come up with a solution, but I’m not sure if it’s correct. Please help me to check, and correct my errors.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m assuming that
aandbare the only allowed symbols.Your original expression matches any string that contains
ab. The complement is any string that does not containab. In other words if there is anathe next character must be anotheraor the end of the string. If aboccurs it must be before allas.So that gives the result:
I think your expression is equivalent to this.