A finite state machine (FSM) is a
mathematical model of a system that attempts to reduce the model
complexity by making simplifying assumptions. Specifically, it
assumes that:

  • The system being modeled can only assume a
    finite number of conditions, called states.
  • The system behavior within a given state is
    essentially identical.
  • The system resides in states for significant
    periods of time.
  • The system may change these conditions only in
    a finite number of well-defined ways, called transitions.
  • Transitions are the response of the system to
    events.
  • Transitions take (approximately) zero
    time.