automata-theory

regular Expression in which Letter b in never Tripled


I need help regarding Regular Expression. I want a Regular expression in which letter b is never tripled. This means that no word contains the substring bbb in it. Language contains only letters {a,b}


Solution

  • The is a Problem in Answer given by Adina Ahmad. The problem is that if we want to write bbabba then that Regex will not work.

    So the Below Regex is perfect according to the condition.

    (a+ba+bba)*(bb+b+^)

    Where ^ as null word.

    Good Luck.