Week 02 · Sipser 1.1 · Part I

Deterministic finite automaton

A DFA has one finger on the input and one finger on the diagram, and it may never lift either. Build one below, then step a string through it and watch where the computation lands — because landing, not stopping, is what acceptance means.

State diagram

Drag states to arrange them. Double-click a state to make it accepting. In + arrow mode click the source state, then the target.

Run one string

—
Press step to move one symbol.

The language, up close

Every string over the alphabet up to that length, accepted ones marked. This is the fastest way to find out whether the machine you drew is the machine you meant.

Formal description

One transition per line: q0 1 -> q1. Several symbols at once: q0 0,1 -> q0. Directives: start:, accept:, states:. # starts a comment.

Is it really a DFA?

What this page is trying to teach

A DFA must be total. The health panel complains about every missing δ(q, a) because Definition 1.5 makes δ a function on all of Q × Σ. Drawing only the interesting arrows is the commonest way a correct idea becomes a wrong answer in an exam.

There is no accept-and-stop. Step a string that reaches an accepting state early and then leaves it: the verdict flips back. If you want contains rather than ends with, the accepting state has to be a trap that loops on every symbol.

Say what each state means. Every example here names its states after the fact they record — r1 is "the prefix so far is ≡ 1 mod 3", not "the second circle". Carry that habit into the exam; it earns partial credit when the diagram is wrong.