The two strings 0010 and 1000 may be distinguished from each other by a three-state automaton in which the transitions from the start statego to two different states, both of which are terminal in the sense that subsequent transitions from these two states always return to the same state. The state of this automaton records the first symbol of the input string. If one of the two terminal states is accepting and the other is rejecting, then the automaton will accept only one of the strings 0010 and 1000. However, these two strings cannot be distinguished by any automaton with fewer than three states.
Simplifying assumptions
For proving bounds on this problem, it may be assumed without loss of generality that the inputs are strings over a two-letter alphabet. For, if two strings over a larger alphabet differ then there exists a string homomorphism that maps them to binary strings of the same length that also differ. Any automaton that distinguishes the binary strings can be translated into an automaton that distinguishes the original strings, without any increase in the number of states. It may also be assumed that the two strings have equal length. For strings of unequal length, there always exists a prime number whose value is logarithmic in the smaller of the two input lengths, such that the two lengths are different modulo. An automaton that counts the length of its input modulo can be used to distinguish the two strings from each other in this case. Therefore, strings of unequal lengths can always be distinguished from each other by automata with few states.
History and bounds
The problem of bounding the size of an automaton that distinguishes two given strings was first formulated by, who showed that the automaton size is always sublinear. Later, proved the bestupper bound known,, on the automaton size that may be required. This was improved by to. There exist pairs of inputs that are both binary strings of length for which any automaton that distinguishes the inputs must have size. Closing the gap between this lower bound and Robson's upper bound remains an open problem. Jeffrey Shallit has offered a prize of 100 British pounds for any improvement to Robson's upper bound.
Special cases
Several special cases of the separating words problem are known to be solvable using few states:
If two binary words have differing numbers of zeros or ones, then they can be distinguished from each other by counting their Hamming weights modulo a prime of logarithmic size, using a logarithmic number of states. More generally, if a pattern of length appears a different number of times in the two words, they can be distinguished from each other using states.
If two binary words differ from each other within their first or last positions, they can be distinguished from each other using states. This implies that almost all pairs of binary words can be distinguished from each other with a logarithmic number of states, because only a polynomially small fraction of pairs have no difference in their initial positions.
If two binary words have Hamming distance, then there exists a prime with and a position at which the two strings differ, such that is not equal modulo to the position of any other difference. By computing the parity of the input symbols at positions congruent to modulo, it is possible to distinguish the words using an automaton with states.