2

When converting NFA to DFA, do I always get the minimal DFA or not?

Sepfins
  • 123
  • 3
  • 1
    Generally, no.$,$ – Rick Decker Jan 23 '18 at 17:34
  • We discourage posts that simply state a problem out of context, and expect the community to solve it. Assuming you tried to solve it yourself and got stuck, it may be helpful if you wrote your thoughts and what you could not figure out. It will definitely draw more answers to your post. Until then, the question will be voted to be closed / downvoted. You may also want to check out these hints, or use the search engine of this site to find similar questions that were already answered. – Raphael Jan 23 '18 at 18:06
  • @Raphael but it's not a problem out of context... I simply asked a question about NFA to DFA conversion – Sepfins Jan 23 '18 at 18:12
  • Before asking, we want you to exhaust all reasonable resources to try to answer it on your own, and then show us in the question what you've tried and what progress you've made. For instance, a reasonable thing to try would be to work through a few examples by hand (executing the algorithm manually), to see what seems to happen. This helps you ask better questions, helps us see what level you are at and formulate our answers accordingly, and helps us repeat work you've already done. – D.W. Jan 23 '18 at 18:14
  • Of course @RickDecker gave the answer, not in general. But curiously, if you determinize, then reverse the language, determinize and repeat, you will have the minimal automaton. See Brzozowski's algorithm for DFA minimization. – Hendrik Jan Jan 23 '18 at 18:59
  • @HendrikJan When I first saw that result, it blew me away. – Rick Decker Jan 23 '18 at 19:31
  • @Discretelizard I don't think this is a duplicate. This question asks if determinization always produces a minimal automaton; the other one asks if there's an automaton where the minimal DFA has exponentially more states than the minimal NFA. – David Richerby Jan 23 '18 at 22:03
  • @DavidRicherby Ah indeed, I misread. – Discrete lizard Jan 23 '18 at 22:04
  • By the way, welcome to the site! – Rick Decker Jan 24 '18 at 00:29

2 Answers2

2

No, it is not in general minimal. The standard determinization procedure, the subset construction, always converts an NFA with $n$ states to a DFA with $2^n$ states and there is no reason that this should be minimal.

In practical terms, if you convert an NFA, you'll often find that there are unreachable states in the resulting DFA, which immediately shows that the result is not minimal. For a more extreme example, take any DFA with $n$ states, call it an NFA and determinize it. You now have a DFA with $2^n>n$ states that accepts the same language as it did before, so it's certainly not minimal. (This is a particularly strong example of the first case I mentioned. All states except subsets of size $1$ will be disconnected from the start state, and the states of size $1$ are a copy of the original DFA.)

David Richerby
  • 81,689
  • 26
  • 141
  • 235
0

If we take NFA with n states and convert into DFA with 2^n states then there are unreachable states in resulting DFA which gives the result as not a minimal DFA.so the NFA to DFA conversion thus not give the result ad minimal DFA.