# Why isn't converting from an NFA to a DFA working?

I am just beginning to learn computation theory. I wrote up a non-deterministic finite automata that accepts strings that contain the substring "abba":

I tried to convert it to a DFA by putting together sets of states in the NFA to be states of the DFA:

However, I just realized that my DFA doesn't accept strings such as "abbaa" that do not end in "abba." That means that my methodology was wrong. Why? I thought it would make sense to combine states of the NFA to make states of the DFA.

## migrated from cstheory.stackexchange.comSep 16 '12 at 6:05

This question came from our site for theoretical computer scientists and researchers in related fields.

• First, make sure the NFA works (it only accepts strings that end with "abba") – Ran G. Sep 16 '12 at 11:07

• @user5507 It is find to define the final state as "if transition undefined stay accepted", but then, your transitions from {1,2,5} should always contains a 5. – Earth Engine May 21 '15 at 21:52