A deterministic finite automaton has exactly one automaton transition for every automaton state and input symbol. Formally, a DFA is a tuple : is a nonempty finite set of automaton states, a finite alphabet, a function, the initial automaton state, and the accepting automaton states. Its unique path on a word accepts if it ends in after consuming the entire input. Visiting earlier does not suffice.
For a concrete binary divisibility automaton, recognize the words whose values in the binary numeral system are divisible by three. Choose , , , and . Each automaton state names the congruence class of the integer read so far. Appending a binary digit changes its value to , so the automaton transition isThe modular arithmetic therefore needs only three automaton states, whatever the input length. The full function is , , , , , and .
A three-state DFA for binary digits representing integers divisible by three, with accepted and rejected traces
. Details. For , the successive automaton states are , so the word is accepted. For , they are , so it is rejected. Leading zeros are allowed: they leave the initial automaton state unchanged. We explicitly assign value zero to the empty word, which is accepted because the initial automaton state is accepting. This is a convention for a formal language, rather than a claim that ordinary written numerals include a blank numeral.
The generator checks every word of up to eight binary digits, comparing the final automaton state with the integer value modulo three. Each length includes all words, preserving leading zeros as distinct inputs:
All 511 checks agree. They are useful for catching a reversed arrow or mistaken label, but the reason the DFA works at every length is its invariant: after reading any word of value , its automaton state is . The update preserves that statement by mathematical induction. Through the extended transition function of a deterministic finite automaton, this becomes .
A deterministic finite automaton whose automaton state is a pair of automaton states of two given deterministic finite automata, updated componentwise by each input symbol. Choosing accepting pairs by a Boolean function on component acceptance realizes intersection, union, or set difference of the recognized regular languages.
A state is accessible when some input word takes the initial state to it. Removing inaccessible states preserves the accepted language.
Two states are indistinguishable when every continuation is accepted from both or rejected from both. Distinguishable states admit at least one suffix with different acceptance outcomes.
Indistinguishability is a right-invariant equivalence relation. The quotient has states , transition , initial state , and accepting classes represented by accepting states. It accepts the original language and has no two distinct indistinguishable states.
A deterministic automaton is irreducible when every state is accessible and every pair of distinct states is distinguishable.
To recognize prescribed parities of several symbol counts, use one state for each tuple of parities. Reading a tracked symbol toggles its coordinate and leaves all other coordinates unchanged. For two tracked symbols this gives four states indexed by .
To recognize words having at most consecutive copies of a symbol, use states recording the current run length and one rejecting sink. Another symbol resets the run length to zero, while the st consecutive copy enters the sink.
DFA minimization merges states with identical acceptance behavior for every suffix and removes unreachable states. It produces a minimal deterministic finite automaton, unique up to renaming states.
A minimal deterministic finite automaton is the result of DFA minimization. An irreducible deterministic automaton has the fewest states among deterministic automata for its language and is unique up to isomorphism. Its states are the Myhill--Nerode classes.
The canonical residual automaton of a regular language has its distinct left quotients of a formal language as states, initial state , accepting states those containing the empty word, and letter transition . It is a complete minimal deterministic finite automaton; every other complete minimal deterministic finite automaton for that language is isomorphic to it.
In a minimal deterministic finite automaton accepting a finite language, any state lying on a nonempty directed cycle is the unique rejecting sink state. It cannot reach an accept state, since traversing the cycle arbitrarily many times would produce infinitely many accepted words. Every state reachable from it also rejects every continuation, so minimality forces all such states to be the same state.
For a positive integer , binary strings can be tested for divisibility by with residue states and transitionThe initial and accepting residue is zero. For , all seven states are reachable and pairwise distinguishable, so this automaton is minimal.
Articles by others on the same topic
There are currently no matching articles.
