Skip to main content

Finite-State Machine

DFA - Deterministic Finite Automata

NFA - Non-deterministic Finite Automata

Use e (epsilon) transition to get to next state

Afinite-state machine(FSM) orfinite-state automaton(FSA, plural:automata), finite automaton, or simply astate 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 external inputs; the change from one state to another is called atransition. An FSM is defined by a list of its states, its initial state, and the conditions for each transition. Finite state machines are of two types --deterministic finite state machines and non-deterministic finite state machines.A deterministic finite-state machine can be constructed equivalent to any non-deterministic one.

The behavior of state machines can be observed in many devices in modern society that perform a predetermined sequence of actions depending on a sequence of events with which they are presented. Simple examples are vending machines, which dispense products when the proper combination of coins is deposited, elevators, whose sequence of stops is determined by the floors requested by riders, traffic lights, which change sequence when cars are waiting, and combination locks, which require the input of a sequence of numbers in the proper order.

The finite state machine has less computational power than some other models of computation such as the Turing machine.The computational power distinction means there are computational tasks that a Turing machine can do but a FSM cannot. This is because a FSM's memory is limited by the number of states it has. FSMs are studied in the more general field of automata theory.

image

https://en.wikipedia.org/wiki/Finite-state_machine