The Lower Bound in Action
Try to build a DFA with one state fewer than the number of classes of the language; for each attempt the tool shows two words from different classes that reach the same state and the word on which the automaton is wrong.
Last updated:
On this page we practise the lower bound from the lesson “Myhill–Nerode:
What a State Remembers”: we try to build a DFA with fewer states than the number of classes, and see why every attempt fails.
A DFA with one state fewer
Choose a language. The tool says how many classes it has and gives the table of a DFA with one state fewer:
fill in the transitions and the accepting states, and try to build a DFA for the language.
At each check the tool takes one representative word from each class and runs your automaton on them.
There are more words than states, so two of them reach the same state, exactly as in the proof of the lower bound.
The tool shows the two words, the word that distinguishes them, and the word on which your automaton is wrong.
Try several times, changing the automaton each time to fix the mistake that was found.
The tool needs JavaScript. Use the questions on paper below.
Questions on paper
Question 1. Someone claims to have built a three-state DFA for the language , the words that contain or .
Without seeing the automaton, show that it is wrong on one of the words , , , , , .
Hint
Which states do reach? What is the distinguishing word for each pair?
Answer
The four words reach at most three states, so two of them reach the same state.
Each pair has a distinguishing word , and the two words obtained by appending end in the same state of the automaton, but exactly one of them is in the language; so the automaton is wrong on one of them:
- : , the words and .
- : , the words and .
- : , the words and .
- , and : , the words themselves; in each pair one of them is and the other is one of .
In every case the word on which the automaton is wrong is one of .
Question 2. Let , the words whose third letter from the end is .
Prove that every DFA with at most seven states is wrong on some word of length at most 5.
Hint
Use the eight words of length 3 and the distinguishing word from the section The k-th letter from the end.
Answer
The eight words of length 3 reach at most seven states, so two of them, , reach the same state.
By the argument in the lesson, if is the first position where they differ, the word distinguishes them, and its length is at most 2.
The words and end in the same state of the automaton, and exactly one of them is in the language, so the automaton is wrong on one of them.
Their length is .
Continue with Distinguishable or Not, go back to Myhill–Nerode: What a State Remembers, or see the glossary.