PlanetMath (more info)
 Math for the people, by the people.
Encyclopedia | Requests | Forums | Docs | Wiki | Random | RSS  
Login
create new user
name:
pass:
forget your password?
Main Menu
Owner confidence rating: Very high Entry average rating: No information on entry rating
deterministic finite automaton (Definition)

A deterministic finite automaton (or DFA) is a finite-state deterministic automaton. It can be formally defined as a 5-tuple $ (Q, \Sigma, T, q_0, F)$, where

Operation of the DFA begins at $ q_0$, and movement from state to state is governed by the transition function $ T$. $ T$ must be defined for every possible state in $ Q$ and every possible symbol in $ \Sigma$.

The way a DFA $ A$ works is as follows: when a string $ a=\alpha_1\alpha_2\cdots \alpha_n$ is fed nto $ A$ at starting state $ q_0$, $ A$ reads the leftmost symbol $ \alpha_1$ and reaches the next state $ q_1=\delta(q_0,\alpha_1)$. $ A$ then reads the next symbol $ \alpha_2$ and reaches the next state $ q_2=\delta(q_1,\alpha_2)$ and reaches the next state $ q_3$. $ A$ continues to read the symbols until the last symbol $ \alpha_n$ is read, reaching state $ q_n= \delta(q_{n-1},\alpha_n)$. The string $ a$ is said to be accepted by $ A$ if $ q_n\in F$, and rejected by $ A$ otherwise.

A DFA can be represented visually as a directed graph. Circular vertices denote states, and the set of directed edges, labelled by symbols in $ \Sigma$, denotes $ T$. The transition function takes the first symbol of the input string as, and after the transition this first symbol is removed. If the input string is $ \lambda$ (the empty string), then the operation of the DFA is halted. If the final state when the DFA halts is in $ F$, then the DFA can be said to have accepted the input string it was originally given. The starting state $ q_0$ is usually denoted by an arrow pointing to it that points from no other vertex. States in $ F$ are usually denoted by double circles.

DFAs represent regular languages, and can be used to test whether any string in $ \Sigma^*$ is in the language it represents. Consider the following regular language over the alphabet $ \Sigma := \left\{ \verb.a., \verb.b. \right\}$ (represented by the regular expression aa*b):


$\displaystyle \verb.<.S\verb.>.$ $\displaystyle \verb.::=.$ $\displaystyle \verb=a=\,A$  
$\displaystyle \verb.<.A\verb.>.$ $\displaystyle \verb.::=.$ $\displaystyle b\,\verb.\vert.\,\verb=a=\,A$  

This language can be represented by the following DFA.

$\displaystyle \UseComputerModernTips \xymatrix{ \ar[r] & *+[o][F-]{0} \ar[r]_a... ...\ar[r]_b & *++[o][F=]{2} \ar[dl]^{a,b} \ && *+[o][F-]{3} \ar@(r,d)[]^{a,b} } $

The vertex 0 is the initial state $ q_0$, and the vertex 2 is the only state in $ F$. Note that for every vertex there is an edge leading away from it with a label for each symbol in $ \Sigma$. This is a requirement of DFAs, which guarantees that operation is well-defined for any finite string.

If given the string aaab as input, operation of the DFA above is as follows. The first a is removed from the input string, so the edge from 0 to 1 is followed. The resulting input string is aab. For each of the next two as, the edge is followed from 1 to itself. Finally, b is read from the input string and the edge from 1 to 2 is followed. Since the input string is now $ \lambda$, the operation of the DFA halts. Since it has halted in the accepting state 2, the string aaab is accepted as a sentence in the regular language implemented by this DFA.

Now let us trace operation on the string aaaba. Execution is as above, until state 2 is reached with a remaining in the input string. The edge from 2 to 3 is then followed and the operation of the DFA halts. Since 3 is not an accepting state for this DFA, aaaba is not accepted.

Remark. Although the operation of a DFA is much easier to compute than that of a non-deterministic automaton, it is non-trivial to directly generate a DFA from a regular grammar. It is much easier to generate a non-deterministic finite automaton from the regular grammar, and then transform the non-deterministic finite automaton into a DFA.



"deterministic finite automaton" is owned by CWoo. [ full author list (3) | owner history (2) ]
(view preamble)

View style:

See Also: automaton, context-free language, regular language, language, non-deterministic finite automaton

Other names:  dfa, finite state machine, fsm
Log in to rate this entry.
(view current ratings)

Cross-references: Transform, non-deterministic finite automaton, generate, trace, sentence, finite, well-defined, label, regular expression, language, regular languages, represent, vertex, points, arrow, final state, empty string, edges, vertices, circular, directed graph, operation, starting state, transition function, strings, alphabet, states, finite set, automaton
There are 6 references to this entry.

This is version 11 of deterministic finite automaton, born on 2002-02-24, modified 2008-05-12.
Object id is 2553, canonical name is DeterministicFiniteAutomaton.
Accessed 15943 times total.

Classification:
AMS MSC68Q05 (Computer science :: Theory of computing :: Models of computation )
 68Q42 (Computer science :: Theory of computing :: Grammars and rewriting systems)
 03D10 (Mathematical logic and foundations :: Computability and recursion theory :: Turing machines and related notions)

Pending Errata and Addenda
None.
[ View all 5 ]
Discussion
Style: Expand: Order:
forum policy

No messages.

Interact
post | correct | update request | add derivation | add example | add (any)