DFAs are rather nice for some tasks and when identified can greatly speed up the core of an algorithm. Take for example, the question of "Is a number divisible by 3?" Classically, you would read the entire number into memory, and then divide it by 3. However, this requires that you have memory at least as large as the number. This isn't practical for very large numbers of very small memory.

Consider the following deterministic finite automaton. You start at the > and follow it around. Treat the number you want to test for divisibility by 3 as a binary number e.g '3' is '11', and '4' is '100'. If you end up in a state labeled with '*' you have a number divisible by 3. The number in the state is the modulo of the number. One important concept here is that this takes up only 2 bits of memory to store which state you are in. This can be seen in the four states in the diagram below. Each state could be labed from 0-3 (in binary 00, 01, 10, 11). In this instance, the start state (state 3) is designated 'n' for null.

        /--\
       >| n|
        \--/
       /    \
      0      1
     v        v
/-- /--\ <-1-- /--\ <-0-- /--\ --\
0   |*0|       | 1|       | 2|   1
\-> \--/ --1-> \--/ --0-> \--/ <-/

To follow this DFA, lets take 9 as an example. One starts in state 'n' with the highest bit. The binary representation would be '1001'. Thus, the first step would be to follow the path from 'n' to '1' along the '1' arrow. From state '1', a '0' leads us to state '2', and the next '0' leads us back to state '1'. The final '1' leads us to state '*0'.

Other common tasks where DFAs live at the core are terminal programs, web servers, and game AI's.