Automata Theory — DFA Project

Password Validator

A Deterministic Finite Automaton that validates passwords by reading each character and transitioning between states.

Try it

Current DFA state:

How it works

This validator uses a minimized 5 state DFA. Each state tracks which category of requirements has been satisfied so far uppercase seen, or digit/special seen rather than tracking all combinations individually.

Q — States
{ q0, q1, q2, q3, q4 } — 5 states total
Σ — Alphabet
Uppercase (U), Digit (D), Special (S), Lowercase (L)
δ — Transition
δ(state, char) → next state
q0 — Start state
Begin here. No requirements satisfied yet.
q4 — Accept state
Both requirement groups met. Sink accept — loops on all input.
L — Neutral input
Lowercase loops back. No penalty, no progress.

State definitions

StateMeaningHas UHas D/SAccepts?
q0Start — nothing satisfiedNo
q1Has uppercaseNo
q2Has digit or specialNo
q3Has both — one step from acceptNo
q4All requirements satisfiedYes

Transition table (δ function)

δ(current state, input type) → next state  |  italic = self-loop

Stateuppercase (U)digit (D)special (S)lowercase (L)
q0q1q2q2q0
q1q1q3q3q1
q2q3q2q2q3
q3q4q4q4q4
q4q4q4q4q4

Step-by-step trace

Enter a password above and see how the DFA processes it character by character.

No input yet. Type a password to see the trace.