Skip to Main Content

Deterministic Finite Automata

What is Deterministic Finite Automata?

Deterministic finite automata (or DFA) are finite state machines that accept or reject strings of characters by parsing them through a sequence that is uniquely determined by each string.

The term “deterministic” refers to the fact that each string, and thus each state sequence, is unique. In a DFA, a string of symbols is parsed through a DFA automata, and each input symbol will move to the next state that can be determined.

These machines are called finite because there are a limited number of possible states which can be reached. A finite automaton is only called deterministic if it can fulfill both conditions. DFAs differ from non-deterministic automata in that the latter are able to transition to more than one state at a time and be active in multiple states at once.

In practice, DFAs are made up of five components (and they’re often denoted by a five-symbol set known as a 5-tuple). These components include:

  • A finite number of states
  • A set of symbols known as the alphabet, also finite in number
  • A function that operates the transition between states for each symbol
  • An initial start state where the first input is given or processed
  • A final state or states, known as accepting states.

How can I use Deterministic Finite Automata?

Although they were originally created as abstract mathematical models, DFAs today have become widespread in both computer and data science. Finite automata are used by most computer language compilers to assist in parsing and preparing code for actual use. Additionally, they are used extensively in language processing systems, including in natural language processing, to assist programs in understanding how to respond to unique and varied inputs.

DFAs, because of their inability to actively inhabit multiple states at once, are also essential in everything from password recognition algorithms (to determine whether a user’s input is correct or incorrect) to filtering algorithms and even in text processing applications. In data science, basic deterministic finite automata can be used as sorting tools when building data warehouses and other storage systems.

By parsing data as it arrives and determining its proper location, a DFA can automate a large portion of the sorting and do so significantly faster than manually performing the task. When combined with a Non-deterministic Finite Automaton (or NFA), data warehouses can also ascertain whether data belongs in more than one location. DFA and NFA can be used separately to create a much broader and effective solution.

Back to Glossary

Want the latest in analytics?