Three Processes on a DFA
Run three processes step by step on one DFA, with its state diagram coloured at each step: the reachable states, the equivalent states by table filling or by splitting into classes, and the classes of words with a distinguishing suffix for every pair.
Last updated:
On this practice page we practise three processes from the lessons Minimization: Removing Unreachable States and Minimization: Merging Equivalent States on one deterministic finite automaton (DFA):
finding the reachable states, finding the equivalent states, and grouping words into the classes that the language does not distinguish.
The three processes run on the same automaton, so the tool on this page shows them on one state diagram and colours it at each step.
Three automata are ready in the tool, and each of them can be edited.
Reachable states
A state is reachable when the run on some word, from the start state , ends in it.
The tab “1. Reachable states” builds the sets
one step at a time, where is a letter of the alphabet .
Each step adds the states that one more letter leads to, so holds the states reached by the words of length at most .
The search stops at the first with , and the states outside that set are removed together with the transitions that leave them.
Equivalent states
Two states are equivalent when no word separates them: on every word, the runs from the two states both end in accepting states or both end in states that do not accept.
The tab “2. Equivalent states” runs on the reachable states and offers two methods.
- Table filling, the method of the lesson: round 0 marks every pair of an accepting and a non-accepting state, and round marks a pair when some letter leads it to a pair marked in an earlier round. A pair that is still unmarked after round is a pair that no word of length at most separates.
- Splitting into classes (partition refinement) reaches the same classes from the other direction. It starts with two classes, the accepting states and the other states. In each round every state gets a signature: for each letter, the class of the previous round that the letter leads it to. A class whose states have different signatures splits into groups of equal signatures. After round , two states are in the same class exactly when no word of length at most separates them, as in table filling, and the process stops when no class splits.
The log of the splits records a word for every two classes that split apart:
the letter on which their signatures differ, followed by the word of the two classes that this letter leads to.
Distinguishable words
Two words and are distinguishable with respect to a language when some suffix puts exactly one of the words and in ; otherwise they are indistinguishable, and is the class of .
For a DFA that recognizes , this happens exactly when the runs on and on end in states that are not equivalent, and then a word that separates the two states is such a suffix.
The tab “3. Distinguishable words” groups the words you write into classes, by the state in which the run on each word ends, and gives a distinguishing suffix for every pair; select a cell to see the runs on and .
The button “One shortest word per class” writes, for every class, a shortest word whose run ends in it.
The tool needs JavaScript. The questions below can be solved on paper, with the transition table given there.
Questions
The questions are about the third automaton in the tool, “The number of a’s is divisible by 3, with duplicate states”.
Its alphabet is , its start state is and its accepting states are and :
| State | on | on |
|---|---|---|
Question 1. Compute until the sets stop growing. Which state is not reachable?
Then go through the steps of the first tab and compare.
Answer
, , , and , so the search stops and .
The state is not reachable: the only arrow that enters it leaves itself.
Question 2. Predict before you run the second tab: how many pairs does round 0 of table filling mark?
Which pairs does round 1 mark, and with which word? What are the classes of equivalent states?
Then check with both methods.
Hint
After is removed, two of the six states accept. In round 1, check for each unmarked pair where the letter leads its two states.
Answer
Round 0 marks the pairs of an accepting state ( or ) and a non-accepting state, with the word .
Round 1 marks four pairs, each with the word : and (the letter leads to the accepting and the other state to a non-accepting one), and and (the letter leads to the accepting ).
Round 2 marks no pair. The classes are , and :
each state remembers only the number of ‘s modulo 3. Splitting into classes reaches the same three classes:
in round 1 the class splits by the letter into and , and round 2 splits nothing.
Question 3. Are the words and distinguishable with respect to the language of the automaton?
And the words and ? Where they are, give a distinguishing suffix.
How many classes of words are there, and what is a shortest word of each class?
Check in the third tab.
Answer
The runs on and on both end in , so the two words are not distinguishable:
. The runs on and on end in and , which are not equivalent, and the suffix distinguishes them:
and . There are three classes, one for each class of equivalent states, and the shortest words are , and .
Each has length at most , as the note under the button says.
Back to Minimization: Merging Equivalent States, or see the glossary.