Library

2NFA · Regular

Déjà vu: the last letter is a rerun

Accepts strings whose final letter occurred earlier too. The 2NFA guesses the earlier occurrence, races to the end marker, and steps back to confirm the match.

scansawArunAcheckAsawBrunBcheckBacc⊢, a, baba, ba, b⊣aa, ba, b⊣b
The machine as drawn — 8 states, 17 transitions.

The author’s examples, run

aba → acceptabb → acceptabab → acceptab → rejectba → rejecta → reject