CleverSphere

Simulating a finite automaton

A DFA reads a word symbol by symbol and changes state as it goes. In the end only the last state decides.

Rules

  • Start in the state with the arrow
  • Exactly one transition per symbol
  • Accepted if the last state is accepting

Your turn

Three problems on this topic. The software checks your answer exactly.

  1. 1 · Simulate a DFA
  2. 2
  3. 3

The automaton reads the word from left to right (start →, accepting *).

w = bbab

δab
→ *q0q2q0
*q1q0q0
q2q1q0

Which state does it end in? (number, q2 = 2)

Is the word accepted?

Worked example

The automaton reads the word from left to right (start →, accepting *).

w = baaa

δab
→ q0q0q2
q1q0q0
*q2q1q2

Worked solution

  1. 1q0 → q2 → q1 → q0 → q0
  2. 2q0 is not accepting.

Typical mistake: Only the state after the last symbol counts, not whether an accepting state was visited on the way.

Common questions

What is a DFA?

A deterministic finite automaton has exactly one next state for each symbol in each state.

Related

More topics