0

I am trying to figure out a problem where I must draw a NFA for a given language.

The language is { w | the final five symbols of w include two a's and three b's }.

I believe I have it as a DFA and am not sure if there is a more reduced version. If somebody could take a look that would be very helpful. I feel as though it can be reduced into a fairly small NFA.

enter image description here

1 Answers1

1

First of all, what you have there is not a DFA; state a is clearly nondeterministic:

  • with an a you can go to both a and b
  • with a b you can got to both a and s

Second, since in an FSA you can only count with states (there is no stack), you have to keep track of how many of each symbol you saw in the last 5 characters in the state space. Just think about how many different combinations you need, and then the transitions will be obvious. That's the smallest NFA you can solve this exercise with.

David Nemeskey
  • 640
  • 1
  • 5
  • 16