Automata

Draw a finite automaton and watch it read a string symbol by symbol: the active state of a DFA, the set of active states of an NFA (with its λ-closure), the absorbing and unreachable states and the subset construction that turns an NFA into a DFA row by row. Also from a simple regular expression to its NFA. It works in your browser, on your phone too.

How to use it

  1. Start with «The locker lock»: a DFA that opens with 1 0 1. Press «Next step» and watch each key move the active state, with the table cell used at each moment.
  2. Carry on with «Open and close again» (what counts is where the string ends), «The trap and the unreachable state», «Guessing where it starts» (an NFA followed with a set) and «The master key», with λ-transitions.
  3. In «From NFA to DFA» and «The second-to-last is 1», the subset construction appears row by row: each DFA state is a set of NFA states, the empty one included.
  4. In «Your automaton» type the table (one line per transition: source, symbol and target; several targets with commas and λ for empty transitions) and a string, and press «Test the string» or «Convert to DFA». You can also type a regular expression such as (0+1)*11 and build its NFA.
  5. Press «Explain it slowly» at any step to see what is being done, written as in the topic’s Python blocks.

What it draws

Each state is a circle and the final ones have a double circle; the initial one has an arrow coming in from nowhere. Dashed arrows are λ-transitions. In coral, the active states and the arrows just used. At the top, in the strip, goes the Python line for each step with its result: f[("q1", "0")], cierre(mueve(activos, "1")) or acepta("1101"). On the right, the string with the symbol being read, the active states and the transition table (or the subset table).

The criteria it follows

  • An NFA accepts a string if any of the active states at the end is final: one good path is enough.
  • The initial set is the λ-closure of the initial state, and after each symbol it is closed again with λ.
  • If a DFA is missing an arrow, it is understood to go to a trap that is not drawn: the string is rejected.
  • In the subset construction only the reachable sets appear, in the order they come out, named A, B, C…; the empty set is called ∅.

For the exam

The automata topic quizzes ask what tells a DFA from an NFA, what a reachable or absorbing state or a connected DFA is, which regular expression defines an automaton and which DFA is equivalent to an NFA with λ. Here you can see all of that in motion; the theory and the exercises are in finite automata and regular expressions. The challenge below gives you strings on DFAs, sets of active states on NFAs and subset constructions, new every time.