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.
Subtypes
NFAs and DFAs are equivalent. Every DFA is also an NFA, and any language recognized by an NFA can also be recognized by a DFA.
Graphical representation of a state machine
It is common to represent a finite automaton by a directed graph with nodes for states and arrows labeled by the input for transitions.
We often mark final states (there can be more than one) with an extra circle.

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