Combining two DFAs into 1 DFA using concatenation

812 Views Asked by At

L= { w : w has exactly two a's and at least two b's}

Picture of DFA's

https://i.stack.imgur.com/4mPHU.png

I have made the two DFA's separately, but I am having trouble combining them specifically the transition. I have attached the two DFA's. Can you help and explain it me please?

Thank you

1

There are 1 best solutions below

0
On

I like to think of Finite State Automata as memory-less algorithms. Effectively, each state corresponds to a Boolean flag. That is, arriving at a state indicates a true/false condition.

In using a programming analogy, it might be helpful to rename states using descriptive variable names. I might recommend the states:

  • $q_{0}$: The initial state.
  • $q_{a}$: We read one $a$ and no $b$'s.
  • $q_{b}$: We read one $b$ and no $a$'a
  • $q_{aa}$: We read two $a$'s and no $b$'s
  • $q_{ab}$: We read one $a$ and one $b$.
  • $q_{abb}$: We read one $a$ and at least two $b$'s
  • $q_{aab}$: We read two $a$'s and one $b$.
  • $q_{aabb}$: We read two $a$'s and at least two $b$'s
  • $q_{\text{reject}}$: We have determined the input string is not in the language.

Hopefully the names of these states suggest natural transitions to consider.