
- Automata Theory - Applications
- Automata Terminology
- Basics of String in Automata
- Set Theory for Automata
- Finite Sets and Infinite Sets
- Algebraic Operations on Sets
- Relations Sets in Automata Theory
- Graph and Tree in Automata Theory
- Transition Table in Automata
- What is Queue Automata?
- Compound Finite Automata
- Complementation Process in DFA
- Closure Properties in Automata
- Concatenation Process in DFA
- Language and Grammars
- Language and Grammar
- Grammars in Theory of Computation
- Language Generated by a Grammar
- Chomsky Classification of Grammars
- Context-Sensitive Languages
- Finite Automata
- What is Finite Automata?
- Finite Automata Types
- Applications of Finite Automata
- Limitations of Finite Automata
- Two-way Deterministic Finite Automata
- Deterministic Finite Automaton (DFA)
- Non-deterministic Finite Automaton (NFA)
- NDFA to DFA Conversion
- Equivalence of NFA and DFA
- Dead State in Finite Automata
- Minimization of DFA
- Automata Moore Machine
- Automata Mealy Machine
- Moore vs Mealy Machines
- Moore to Mealy Machine
- Mealy to Moore Machine
- Myhill–Nerode Theorem
- Mealy Machine for 1’s Complement
- Finite Automata Exercises
- Complement of DFA
- Regular Expressions
- Regular Expression in Automata
- Regular Expression Identities
- Applications of Regular Expression
- Regular Expressions vs Regular Grammar
- Kleene Closure in Automata
- Arden’s Theorem in Automata
- Convert Regular Expression to Finite Automata
- Conversion of Regular Expression to DFA
- Equivalence of Two Finite Automata
- Equivalence of Two Regular Expressions
- Convert Regular Expression to Regular Grammar
- Convert Regular Grammar to Finite Automata
- Pumping Lemma in Theory of Computation
- Pumping Lemma for Regular Grammar
- Pumping Lemma for Regular Expression
- Pumping Lemma for Regular Languages
- Applications of Pumping Lemma
- Closure Properties of Regular Set
- Closure Properties of Regular Language
- Decision Problems for Regular Languages
- Decision Problems for Automata and Grammars
- Conversion of Epsilon-NFA to DFA
- Regular Sets in Theory of Computation
- Context-Free Grammars
- Context-Free Grammars (CFG)
- Derivation Tree
- Parse Tree
- Ambiguity in Context-Free Grammar
- CFG vs Regular Grammar
- Applications of Context-Free Grammar
- Left Recursion and Left Factoring
- Closure Properties of Context Free Languages
- Simplifying Context Free Grammars
- Removal of Useless Symbols in CFG
- Removal Unit Production in CFG
- Removal of Null Productions in CFG
- Linear Grammar
- Chomsky Normal Form (CNF)
- Greibach Normal Form (GNF)
- Pumping Lemma for Context-Free Grammars
- Decision Problems of CFG
- Pushdown Automata
- Pushdown Automata (PDA)
- Pushdown Automata Acceptance
- Deterministic Pushdown Automata
- Non-deterministic Pushdown Automata
- Construction of PDA from CFG
- CFG Equivalent to PDA Conversion
- Pushdown Automata Graphical Notation
- Pushdown Automata and Parsing
- Two-stack Pushdown Automata
- Turing Machines
- Basics of Turing Machine (TM)
- Representation of Turing Machine
- Examples of Turing Machine
- Turing Machine Accepted Languages
- Variations of Turing Machine
- Multi-tape Turing Machine
- Multi-head Turing Machine
- Multitrack Turing Machine
- Non-Deterministic Turing Machine
- Semi-Infinite Tape Turing Machine
- K-dimensional Turing Machine
- Enumerator Turing Machine
- Universal Turing Machine
- Restricted Turing Machine
- Convert Regular Expression to Turing Machine
- Two-stack PDA and Turing Machine
- Turing Machine as Integer Function
- Post–Turing Machine
- Turing Machine for Addition
- Turing Machine for Copying Data
- Turing Machine as Comparator
- Turing Machine for Multiplication
- Turing Machine for Subtraction
- Modifications to Standard Turing Machine
- Linear-Bounded Automata (LBA)
- Church's Thesis for Turing Machine
- Recursively Enumerable Language
- Computability & Undecidability
- Turing Language Decidability
- Undecidable Languages
- Turing Machine and Grammar
- Kuroda Normal Form
- Converting Grammar to Kuroda Normal Form
- Decidability
- Undecidability
- Reducibility
- Halting Problem
- Turing Machine Halting Problem
- Rice's Theorem in Theory of Computation
- Post’s Correspondence Problem (PCP)
- Types of Functions
- Recursive Functions
- Injective Functions
- Surjective Function
- Bijective Function
- Partial Recursive Function
- Total Recursive Function
- Primitive Recursive Function
- μ Recursive Function
- Ackermann’s Function
- Russell’s Paradox
- Gödel Numbering
- Recursive Enumerations
- Kleene's Theorem
- Kleene's Recursion Theorem
- Advanced Concepts
- Matrix Grammars
- Probabilistic Finite Automata
- Cellular Automata
- Reduction of CFG
- Reduction Theorem
- Regular expression to ∈-NFA
- Quotient Operation
- Parikh’s Theorem
- Ladner’s Theorem
Mealy Machine in Automata Theory
In a Mealy Machine, inputs and outputs come together to form the machine. In this chapter, we will explain the concept of Mealy Machine, then the components and strategy to form a Mealy machine by using transition graphs.
The Concept of Mealy Machine
In finite automata theory, the Mealy machine is a type of machine that can produce output. A Mealy machine's output capability is its unique thing. In this machine, the output depends on both the present state and the present input.
If we try to get differences with finite automata with no outputs, we can say in NFA or DFA we typically determined whether a string is accepted or rejected by starting from an initial state and potentially reaching multiple final states.
In case of Moore or Mealy machines, they do not require a final state. It has an initial state, but no final state is needed. Instead, for every input given to a state, the Mealy machine produces an output, which is recorded at each state.
Components of a Mealy Machine
Mealy machines are six-tuples by their definitions, which are similar to those we learnt in NFA and DFA but with one additional component.
Let's define these tuples −
- Q − A finite set of states (e.g., Q0, Q1, Q2).
- Σ (Sigma) − A finite set called the input alphabet (e.g., A, B).
- δ (Small delta) − The transition function, where Q × Σ → Q. It describes the state transitions based on the input alphabet.
- q0 − The initial state.
- O − A finite set of symbols called the output alphabet.
- λ (Lambda) − The output transition function, where λ: Q × Σ → O. It specifies the output for each state and input pair.
There are two transition functions, the state transition and output transition functions.
- The state transition function (δ) defines how the machine moves from one state to another based on the input. For instance, if we are in state Q0 and we give input 1, we may move to state Q1.
- The output transition function (λ) specifies the output produced for each input given to a state. For example, if we are in state Q0 and give input 1, the output might be A.
Designing a Mealy Machine
Let us take a couple of examples to understand the process of designing a Mealy machine.
Example 1
As our first example, consider the following transition table and graph −
State | Input 0 | Input 1 |
---|---|---|
q0 | q1, a | q2, a |
q1 | q1, b | q3, c |
q2 | q3, c | q2, a |
q3 | q3, c | q3, b |
From this table, we can create the Mealy machine by mapping the states, inputs, and outputs as described.

From the above machine, we can determine the output from a given input. We can analyse like this −
- Start at q0
- Input 0: Transition to q1, output a
- Input 1: Transition to q3, output c
- Input 1: Stay in q3, output b
- Input 1: Stay in q3, output b
So, the output string is "acbbb"
Example 2
Let us take another example for complementing a binary input string through a Mealy machine.
State | Input 0 | Input 1 |
---|---|---|
q0 | q1, 1 | q2, 0 |
The graph will look like this −

There is only one state. For input 0: stay in q0, output 1. And for input 1, stay in q0, output 0.
So, for the input string "011," the output should be "100," which is the 1's complement of the given string.
Conclusion
For finite automata with outputs, we consider the Moore and Mealy machines. We already learnt the Moore, here outputs are coming with the transition, so before reaching a state we are getting output. It is characterized by having an initial state but no final state.
In this chapter, we explained the structure of Mealy machines and how they are formed.