Moore vs. Mealy Machines

2 min read Updated Fri Apr 24 2026 03:19:45 GMT+0000 (Coordinated Universal Time)

Output Length

Number of output symbols produced when the machine processes an input string.

For an input string of length nn:

MachineOutput LengthDescription
Mooren+1n+1Initial state + outputs for each input symbol
MealynnOutputs only for transitions based on input symbols

Output for Empty String

MachineOutputDescription
Mooreλ(q0)\lambda(q_0)Output associated with the initial state q0q_0
MealyΛ\LambdaNo output, since no transitions

Moore–Mealy Equivalence

Moore and Mealy machines are computationally equivalent models. Moore and Mealy machines are equivalent iff they produce the same output (ignoring the extra initial output) for the same input strings.

For any Moore machine, an equivalent Mealy machine can be constructed. And vice versa.

Conversion

Moore to Mealy

Move the state output of the destination state onto the transition leading to that state.

Each transition δ(qi,a)=qj\delta(q_i, a) = q_j in the Moore machine, translates to:

qia/λ(qj)qjq_i \xrightarrow{a / \lambda(q_j)} q_j

States remain the same. State outputs are moved to transitions.

Mealy to Moore

From a state, transitions with different outputs, the state must be split into multiple states.

For each transitions qia/xqjq_i \xrightarrow{a / x} q_j in Mealy machine, translates into a new Moore state (qj,x)(q_j, x) where:

  • state = destination state
  • output = transition output

Steps:

  1. Create states based on (destination state, output).
  2. Assign each new state the corresponding output value.
  3. Redirect transitions accordingly.

States may increase. Transition outputs are moved to states.