I am trying prove that this DFA is minimal for this Union.
2 Answers
You can prove your DFA is minimal by proving that every state is both reachable and distinguishable.
To prove a state st
is reachable, you must give a word (a possibly empty sequence of symbols) that goes from the starting state (q0
in your diagram) to state st
. So for your diagram, you must give six words: one for each of q0
, q1
, q2
, q3
, q4
, and X
. I'll get you started:
state | word that reaches it from q0 |
---|---|
q0 |
"" (the empty word) |
q1 |
a |
q2 |
ab |
q3 |
(exercise for the reader) |
q4 |
(exercise for the reader) |
X |
(exercise for the reader) |
To prove two states s1
and s2
are distinguishable, you must give a word that goes from s1
to an accepting state and from s2
to a rejecting state, or vice versa. So for your diagram, you need to provide 6 choose 2 = 15 words: one to distinguish q0
from q1
, and one to distinguish q0
from q2
, and one to distinguish q1
from q2
, and so on. For example, the word a
distinguishes q0
from q3
, because a
goes from q0
to q1
(a rejecting state), but a
goes from q3
to q4
(an accepting state).
I'll get you started:
state 1 | state 2 | word that distinguishes the states |
---|---|---|
q0 |
q1 |
b |
q0 |
q2 |
"" (the empty string) |
q0 |
q3 |
a |
q0 |
q4 |
ba |
q0 |
X |
(exercise for the reader) |
q1 |
q2 |
(exercise for the reader) |
q1 |
q3 |
(exercise for the reader) |
q1 |
q4 |
(exercise for the reader) |
q1 |
X |
(exercise for the reader) |
q2 |
q3 |
(exercise for the reader) |
q2 |
q4 |
(exercise for the reader but you won't find one) |
q2 |
X |
(exercise for the reader) |
q3 |
q4 |
(exercise for the reader) |
q3 |
X |
(exercise for the reader) |
q4 |
X |
(exercise for the reader) |

- 375,296
- 67
- 796
- 848
-
do you mean that this is the minimal form for that language? – porgrammer3124 Sep 21 '21 at 19:34
-
I do not mean that the diagram posted is a minimal DFA. In fact my answer implies that it is **not** a minimal DFA (see the table entry for `q2`/`q4`). – rob mayoff Sep 21 '21 at 19:35
-
Could you show me the diagram of a minimal DFA ? – CS_student Sep 21 '21 at 19:39
-
@CS_student You may want to have a read through https://softwareengineering.meta.stackexchange.com/q/6166/294015 – Vatine Oct 10 '21 at 14:10
I would suggest two ways:
- Perform minimization (perhaps by a computer) and show the number of states is the same.
- Check that all states are reachable and distinguishable, i.e. For any state s there is a word w∈Σ∗ such that q0−→ws. For each pair (s1,s2) of states present a word w∈Σ∗ such that for s1−→ws′1 and s2−→ws′2 we have s′1 is an accepting state xor s′2 is an accepting state (i.e. s′1∈F⟺s′2∉F).

- 1,105
- 4
- 30
- 68