[Math] How to draw a DFA from a regular expression

automataregular expressionsregular-language

I want to draw a DFA from the below language:

The set of strings in $\{a, b\}$ where every $a$ is immediately followed by $b$

I can write the regular expression for this language as so:

$$((b^*)(ab)(b^*))^*$$

How do I draw the DFA for this expression?

Best Answer

I hope it can help you

Language consist of :

  • $\epsilon$
  • strings of just b's
  • and strings such that every a is immediately followed by b $$L=\{\epsilon,b,bb,bbb,...,ab,abb,....,bab,bbababb,.... \}$$ Regular expression: $(b^*\,ab\, b^*)^*+b^*$

DFA that accepts L :

enter image description here

Related Question