Is this NFA correct for the language {w | w ends with an a and no a occurs between any occurrences of b}?

129 Views Asked by At

Language: {w | w ends with an a and no a occurs between any occurrences of b}

The NFA must have exactly 3 states.

enter image description here

1

There are 1 best solutions below

2
On BEST ANSWER

It depends a little on what NFA are allowed. Your machine is OK (as Brian told you) but has two initial states. Not everyone likes that.

Alternatively, change the label from (0,a,1) into (0,b,1) and add an edge (0,a,2). Then only state 0 needs to be initial.