DFA: Deterministic Finite Automata
Definition
A deterministic finite automaton (DFA) is a tuple where:
| Component | Description |
|---|---|
| Finite set of states | |
| Input alphabet (finite) | |
| Transition function | |
| Start state | |
| Accepting states |
Key Feature: Determinism
For every state and symbol , there is exactly one next state .
- No ambiguity
- No “stuck” states (unless is partial)
- Exactly one computation path for each input
Extended Transition Function
Definition
Extend to :
Language
The string is accepted iff the unique computation path ends in an accepting state.
Example: Divisible by 3
DFA over accepting numbers whose digit sum is divisible by 3:
- (remainder mod 3)
- ,
Example: Even Parity
DFA over accepting strings with an even number of 1s:
- (parity of seen 1s)
- ,
- ,
- ,
Example: Ends with “ab”
DFA over accepting strings ending in “ab”:
- Transitions (key ones):
- : last char is (or start)
- : last char is
- : last two chars are
- : dead state (or integrate below)
- More commonly: with careful transitions
| State | Input | Input |
|---|---|---|
Complete vs Partial DFAs
Complete DFA
is total: there is exactly one transition for every .
Every input has a unique complete computation.
Partial DFA
may be undefined for some .
If computation reaches an undefined transition, the string is rejected.
Conversion
Any partial DFA can be converted to a complete DFA by adding a “trap” or “dead” state.
Rejection
A DFA rejects string if:
The computation exists (deterministically) but ends in a non-accepting state.
State Diagram Convention
- Circles represent states
- Double circles represent accepting states
- Arrow from “start” marks the start state
- Labelled arrows between states show transitions
Summary
- DFA: with deterministic transition function
- Exactly one computation path per input
- Accept iff final state is in
- Complete vs partial: complete has all transitions defined