Finite Automaton

3 min read Updated Tue Apr 28 2026 07:56:31 GMT+0000 (Coordinated Universal Time)

Aka. FA. A machine with:

  • A finite number of states
  • Has one or more starting states
  • Transitions based on input symbols
  • Optionally has some accepting states

For each state and input symbol, exactly one transition exists.

A finite automaton is a 5-tuple M=(Q,Σ,q0,A,δ)M = (Q, \Sigma, q_0, A, \delta).

Where:

  • QQ is a finite set of states
  • Σ\Sigma is a finite input alphabet
  • q0Qq_0 \in Q is the start state
  • AQA \subseteq Q is the set of accepting states
  • δ:Q×ΣQ\delta : Q \times \Sigma → Q is the transition function

FA with Outputs

Traditionally FAs are concerned with accepting or rejecting strings. But they can also generate outputs from an output alphabet. Will be covered in Moore Machines and later.

Used when systems must generate outputs while processing input sequences. Common in digital circuits, controllers, and reactive systems.

Transition Function

Denoted by δ\delta. It maps a state and an input symbol to the next state.

Extended Transition Function

Denoted by δ\delta^*. Handles strings instead of each symbol. δ(q,x)\delta^*(q, x) is the state reached after reading string xx starting from state qq.

Acceptance by an FA

A string is accepted iff the machine ends in an accepting state after reading it.

The language accepted by MM is L(M)={xΣx  is accepted by  M}L(M) = \set{ x \in Σ^* | x\;\text{is accepted by}\;M }

Representations of FA

Transition Diagram

FA is represented as a directed graph with labelled edges.

  • Vertices are states
  • Labeled edges are transitions
  • Start state is marked
  • Accepting states are double-circled

Transition Table

Rows represent current states. Columns represent input symbols. Entries give next states.

Conversion with Regular Expressions

To a Regular Expression

  • Start by analyzing the FA’s structure.
  • Identify paths and loops to construct the RE.
  • This process can be complex for larger FAs.

From a Regular Expression

  • Identify repititive elements.
  • Identify components such as union, concatenation, and Kleene star.
  • Create states to represent these components and transitions based on the structure of the RE.

Kleene’s Theorem

A language LΣL \subseteq \Sigma^* is regular iff there exists a finite automaton that accepts LL.

Every FA has an equivalent regular expression. And vice versa.

Other Important Thoerems

Theorem 1

If a language has nn distinguishable strings, the FA must have at least nn states.

Theorem 2

Language of palindromes over any alphabet Σ\Sigma is not regular because a FA has fixed number of states and it’s not enough to check for palindromes.

Set Operations on FA

Suppose M1=(Q1,Σ,q1,A,δ1)M_1 = (Q_1, \Sigma, q_1, A, \delta_1) and M2=(Q2,Σ,q2,A,δ2)M_2=(Q_2, \Sigma, q_2, A, \delta_2) are FAs accepting languages L1L_1 and L2L_2 respectively.

Let M=(Q1×Q2,Σ,(q1,q2),A1,δ)M=(Q_1 \times Q_2, \Sigma, (q_1, q_2), A_1, \delta). Here δ((p,q),a)=(δ1(p,a),δ2(q,a))\delta((p,q), a) = (\delta_1(p, a), \delta_2(q, a)). Based on how A1A_1 is defined, MM can accept different languages: L1L2L_1 \cup L_2 or L1L2L_1 \cap L_2 or L1L2L_1 - L_2.

Distinguishing Strings

Two strings xx and yy are distinguishable with respect to a language LL if their language quotients (with respect to LL) are different.

2 strings xx and yy are distinguishable with respect to LL iff L/xL/yL/x \neq L/y. Any string in one of these sets but not the other is said to distinguish xx and yy with respect to LL.

A string zz is an extension of xx with respect to LL if exactly one of xzxz and yzyz belongs to LL.