A finite-state machine (FSM), or a finite-state automaton, (FSA, plural: automata), is a mathematical model of computation.

An FSM can be in exactly one state at any given time. It changes state in response to input, according to a set of rules called transitions.

It is common to represent a finite automaton by a directed graph with nodes for states and arrows labeled by the input for transitions.

Wikipedia: state diagram for a turnstile

Subtypes

Acceptance of Inputs and Language

Given a sequence of inputs (input string), we can start in the start state and follow the transition from each symbol in turn. If we can wind up in a final (accepting) state after all inputs have been read, then we say that the input is accepted.

The set of strings accepted by an automaton is called the language of , denoted as .