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.

Share:
1,446

Related videos on Youtube

draanb
Author by

draanb

Updated on August 01, 2022

Comments

  • draanb
    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
      Math1000 almost 9 years
      Did you try constructing a DFA to recognize this language? That should help.
    • draanb
      draanb almost 9 years
      I 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
    draanb almost 9 years
    Thank you for your answered you realy helped me
  • draanb
    draanb almost 9 years
    Thank you too for your answer, im sorry that i cant accept two answers but he commented first, and so i read his answer first