Library

NPDA · Context-free

Between n and 2n b’s: aⁿbᵐ, n ≤ m ≤ 2n

For each a the machine pushes one X or two — its guess about how many b’s that a will pay for. Some sequence of guesses balances exactly when m lies between n and 2n.

asdonebs
The machine as drawn — 3 states, 6 transitions.

The author’s examples, run

ε → acceptaabb → acceptab → acceptaaaaabbbbbbbbb → accepta → rejectbabb → rejectbb → rejectbaaaabbbbbbbbb → reject