\[ \newcommand{\tr}{\Rightarrow} \newcommand{\trs}{\tr^{\!\ast}} \newcommand{\rlnm}[1]{\mathsf{(#1)}} \newcommand{\rred}[1]{\xrightarrow{#1}} \newcommand{\rreds}[1]{\mathrel{\xrightarrow{#1}\!\!^*}} \newcommand{\cl}{\mathsf{Cl}} \newcommand{\pow}{\mathcal{P}} \newcommand{\matches}{\mathrel{\mathsf{matches}}} \newcommand{\kw}[1]{\mathsf{#1}} \]

A deterministic finite state automaton (DFA) consists of 5 pieces of data:

  • A collection of states, $Q$, which can be any finite set.
  • A finite alphabet, $\Sigma$, (so we know what kinds of words we are willing to process)
  • A transition function, $\delta$, of type \(Q \times \Sigma \to Q\).
  • An initial state, \(q_0\), which is just a choice of any element of $Q$.
  • A collection of accepting states, $F$, which is any subset of $Q$.

We will often write an automaton as a tuple of its five components for short \((Q,\Sigma,\Delta,q_0,F)\).