Build an FA that accepts only the words baa, ab, and abb and no other strings longer or shorter I have been trying solve this problem for a while now for a university assignment. I'm required to build a DFA and an NFA for the above question. So far I have been able to solve the DFA but can not find a solution for a proper NFA after multiple tries.
The solution of my DFA for the language provided above:
My attempts for the NFA are down below. I apologize for my messy handwriting but these were just rough works that I was drawing out on the go.
My first attempt at solving the NFA
My second attempt at solving the NFA
My third attempt at solving the NFA
The question is not clear as formed: if you want an NFA which is not a DFA and matches the language then you could take your DFA and add a new unreachable state with an $\epsilon$-transition to itself, or add other $\epsilon$-transition self-loops or many other things that will not change the language.
If the aim is to use non-determinism to reduce the size of the automaton, then you can omit the garbage state (so that the word would just &quot;fall out of&quot; the NFA at that point). Given that you have already optimised the paths for $ab,abb$ (based on their shared prefix) and $baa$ has no shared prefix or suffix with the other words, it looks like this is the only possible optimisation to be made.