Finite Automata

Please note that in order to allow letters in the FA’s alphabet, graph commands must be used with [alt], and ε labels are now selected via [alt-E].

The Finite Automaton Explorer extends the Graph Explorer’s functionality, allowing drawing and running of small Deterministic and Nondeterministic (Binary) Finite Automata (press [alt-D] to work with DFA’s and [alt-N] to work with NFA’s).

Create an account, then get started at your own MyAutomata page!

Screenshot of a Deterministic Finite Automaton, having accepted an input string.

There are three modes:

  • Edit Mode is used to draw the digraph for the automaton, which works as in the Graph Explorer. Transition edges can be labeled with digits, letters, or ε by selecting the edge and pressing the relevant key (using [alt-E] for ε); the last edge drawn can be immediately labeled by simply pressing the relevant key (without needing to select it). Selecting a node and pressing [!] toggles it as an accept node or not. [alt-S], as in the Graph Explorer, allows you to save your FA, which can be loaded via your MyAutomata page. To move to the next mode, click the Check Automaton button or press [Enter].
  • Code Mode allows entry of a binary input string to the FA via digits and/or letters from the FA’s alphabet, using [Backspace] to remove characters. Click the Run button or press [Enter] to run the FA with this input.
  • Run Mode visually walks through the FA’s processing of the chosen input string, highlighting the relevant states and animating the transitions. Pressing [Space] processes one character at a time of the input; when the end of the string is reached, a green checkmark indicates accept, and a red X indicates reject. Pressing [Space] again returns to Code Mode to enter another input string.

Brief directions

Drawing: click to make a vertex; click and drag to draw an edge (drag away from the vertex and back again to make a loop); for digraphs, click the arrowhead to change the edge’s direction.  [alt-C] clears the automaton, and you can press [alt-D] or [alt-N] to switch between deterministic and nondeterministic finite automata. Nodes can be labeled alphabetically via [alt-L], and transitions are labeled by selecting an edge and pressing a digit or letter (or [alt-E] for ε); if no edge is selected, the last edge drawn is so labeled.

Moving: hold [ctrl] down while clicking and dragging to move vertices; loop edges can be rotated around their vertex, as well.  If drawing is disabled, you needn’t hold down [ctrl].

Selecting: click and release a vertex or edge to select it (the selection is colored red); [Shift]-click to toggle selection of more vertices and/or edges; [Esc] clears the selection, and [Del] deletes the selected vertices and edges (along with any edges attached to deleted vertices).  If drawing is disabled, you needn’t hold down [Shift] to build a selection.

Saving: press [alt-S] to save your graph, choosing a name for it.  Don’t worry, everyone’s graphs are separate, and the names are just for your reference.

Checking and running:  Once a diagram has been checked by clicking the Check button or pressing [Enter], binary strings can be entered for input and sent to the FA by pressing the Run button or the [Enter] key. When running, [Space] steps through each character of the input, animating the state transitions, and when the string terminates, a green check mark indicates accept and red X indicates reject.