A finite-state machine (FSM) or finite-state automaton (FSA, plural: automata), finite automaton, or simply a state machine, is a mathematical model of computation. It is an abstract machine that can be in exactly one of a finite number of states at any given time. The FSM can change from one state to another in response to some inputs; the change from one state to another is called a transition.[
![Finite-state machine - Wikipedia](https://cdn-ak-scissors.b.st-hatena.com/image/square/33c0df4e847b35dc9a4a4be474ef62c1e7efde8b/height=288;version=1;width=512/https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2Fa%2Fa2%2FAutomata_theory.svg%2F1200px-Automata_theory.svg.png)