Regular expression 00 or 11 not both
1,446
It will be the union of two languages:
$$ A = \mbox{All words that have 00 but not 11} $$
and
$$ B = \mbox{All words that have 11 but not 00} $$
A regular expression for a language that does not contain 11
can be of the form:
$$(1+\epsilon)(01+0)*$$
Therefore, a regular expression for A could be:
$$ (1+\epsilon)(01+0)* (00) (1+\epsilon)(01+0)* $$
And a regular expression for B could be similar.
Related videos on Youtube
Author by
draanb
Updated on August 01, 2022Comments
-
draanb over 1 year
Can anyone help me with this question: I know it before, but I have tried to solve it myself and didnt succeed. what is the regular expression for this language: L=all words that have 00 or 11 but not both.
Thank you!
-
Math1000 almost 9 yearsDid you try constructing a DFA to recognize this language? That should help.
-
draanb almost 9 yearsI constructed the dfa of the language that have 00, another dfa for the language that contain 11, using both i constructed the language that contain 11 or 00 but not both. I tried converting that dfa to regular expression but it didnt work for me..maybe i did somthing wrong
-
-
draanb almost 9 yearsThank you for your answered you realy helped me
-
draanb almost 9 yearsThank you too for your answer, im sorry that i cant accept two answers but he commented first, and so i read his answer first