DFA · Regular
Exact change: 30¢ in nickels, dimes and quarters
n is 5¢, d is 10¢, q is 25¢. The machine accepts the coin sequences that add up to exactly 30¢ — the states are the running total, and overpaying has nowhere to go.
The author’s examples, run
nq → acceptddnn → acceptndnnn → acceptnnnnnn → acceptdq → rejectndnn → rejectddnnn → rejectdnnnnn → reject