Library

DFA · Regular

Three wrong passwords and you are out

y is a correct password, n a wrong one, l logging out. Two wrong attempts in a row are tolerated; a third locks the account, which here simply has no edge out. Accepted: histories that end logged in.

f0inf1f2ynynyl
The machine as drawn — 4 states, 6 transitions.Every word up to length 5, one row per length in shortlex order, inked where it is accepted.

The author’s examples, run

y → acceptnnyly → acceptylny → acceptylylyly → acceptn → rejectynyly → rejectnlny → rejectnlylyly → reject