The keyword automaton (self-running) means once the transitions are defined, the FSA can run without any extra intervention.

A finite state automata is a model of computation which has the specifications:

  • All inputs are in the form of formula, which are sequences of symbols belonging to an alphabet.
    • The FSA process the string symbol-by-symbol.
  • The output is a yes/no question, represented as a single bit,
  • It can only solve decision computational problems.
  • It cannot allocate new memory. Later, this property is given a mathematical definition, known as the memorylessness lemma.

A finite automaton, can be either deterministic or non-deterministic.

Deterministic

DFA

Definition

See Deterministic Finite Automaton

Non-Deterministic

NFA

NFA

See Non-Deterministic Finite Automaton

Definitions

#todo generalise for all state-based automata

Acceptance

FSA Acceptance (String) ^definition-accept-string

A string is sequence of symbols from the alphabet . It can be ‘fed into’ a FSA, which changes states based on the characters it encounters.

A string, is accepted by the FSA iff the associated computation path resulting from feeding to ends in an accept state , i.e. eventually reaches an accept state when given We say recognises .

FSA Recognition (Language) ^definition-accept-language

Let be a language (i.e. a set of strings/formulae). Then, let be a FSA. We say that accepts or recognises iff:

That is, accepts every word, , in and rejects every word not in . Often notated as:

(where is the language recognised by FSA )

Equivalence

FSA Equivalence ^definition-equivalence

Let be two finite state automata (FSA). Then:

That is, and are equivalent if they both accept the same language. In other words, their set of accepted strings are the same.

Two different DFAs, and can be checked for equivalence by minimalising them and checking if they are equal. That is:

State Transition Table/Matrix

A state transition table is a table used to represent the state transition function, . The first column represents the current state (), and the remaining columns represent the character that could be encountered. Thus, an entry on row and column is given by .

A state transition table will then have rows, i.e. rows equal to the number of states, and columns, i.e. columns equal to the number of symbols.

Current StateFlipNull
The above state transition table represents a machine that can flip a truth value, or leave it unchanged:
  • The set of states are
  • The input alphabet are
  • The initial state and accepting states are irrelevant.
  • The state transition function is defined as:

State Diagram

A state diagram weighted, directed graph where:

  • Each node represents a state
  • Each directed edge represents a transition between two states
  • The ‘weight’ represents the symbol required to make the transition

In most cases, the state diagram is a multigraph

For example, the flip/null machine previously mentioned has the state diagram:

%%🖋 Edit in Excalidraw, and the dark exported image%%

The accept and initial states are usually notated as:

%%🖋 Edit in Excalidraw, and the dark exported image%%

Computation Path

A computation path is a walk (in the graph theory sense) of the state diagram, that is, it involves a sequence of nodes (where nodes can be repeated).

For example, a computation path for the flip/null machine is , which would arise from doing the operations (in order): .

|300 %%🖋 Edit in Excalidraw, and the dark exported image%%

Single-State FSA

A FSA with only one state is known as the single-state FSA. Either this state can be an accept state, in which case the FSA accepts anything, or it is a non-accept state, in which case the FSA accepts nothing.

%%🖋 Edit in Excalidraw, and the dark exported image%%

Limitations

See Non-Regular Languages for a set of strings that cannot properly be recognised by a FSA.

Applications

Examples

Example: Tally Counter

A tally counter is a simple device used for counting.

  • It has two operations, increment and reset
  • Usually 2-digit (0 to 99) or 3-digit (0 to 999), but we will considered the 1-digit case.

It can be represented as a DFA:

  • Each number is represented as a state:
  • Each operation is a symbol in the alphabet:
  • The initial state is
  • Accepting states aren’t relevant here, we could have all states being accepting,

The state transition table is as follows:

Current StateIncrementReset
010
120
230
340
450
560
670
780
890
900

The state diagram is given by: %%🖋 Edit in Excalidraw, and the dark exported image%%

Example: Printer Manager

Suppose some software is required to run a printer management system, which is capable of taking in print requests by two users: User A & User B. It should be able to queue these requests, then print them accordingly. A (rough) state diagram for such a system would be given by:
%%🖋 Edit in Excalidraw, and the dark exported image%% Constraints:

  • Every succeeds , i.e. a print by a user is done only after the request has been queued by that user
  • Every is eventually followed by a : Every request is eventually printed