2081 7

CSC262 · 2081 · 5 marks

Define ε\varepsilonε-closure of a state. Differentiate between Moore and Mealy machine.

Define ε\varepsilonε-closure of a state. Differentiate between Moore and Mealy machine. [5]

Theory of ComputationChapter 2: Introduction to Finite AutomataEpsilon Closure of a State

Quick answer

If state A has ε-transitions to B, and B has an ε-transition to C, then: Every state is always in its own ε-closure; ε-closure is used when converting ε-NFA to DFA, where the start state of the DFA is taken as ε-closure of the start state of the ε-NFA; ε-closure captures all states reachable via epsilon moves alone...

ε-closure of a State and Difference Between Moore and Mealy Machine


Part 1: ε-closure of a State

Definition:

ε-closure of a state is the set of all states that can be reached from a particular state without reading any input symbol, i.e., by reading only ε (epsilon) transitions.

Formally, for a state q, the ε-closure(q) includes:

  • The state q itself
  • All states reachable from q by following one or more ε-transitions

Example:

If state A has ε-transitions to B, and B has an ε-transition to C, then:

ε-closure(A) = {A, B, C}

Key Points:

  • Every state is always in its own ε-closure.
  • ε-closure is used when converting ε-NFA to DFA, where the start state of the DFA is taken as ε-closure of the start state of the ε-NFA.

Part 2: Difference Between Moore Machine and Mealy Machine

Both are finite state machines (FSMs) that produce output, but they differ in how output is generated.

BasisMealy MachineMoore Machine
Output depends onBoth present state and present inputOnly the present state
Number of statesGenerally fewer statesGenerally more states
Number of outputsFor n inputs, there are n outputsFor n inputs, there are n+1 outputs
Output functionFunction of transitions; changes when input logic on present state changesFunction of current state; changes at clock edges when state changes occur
Reaction speedReacts faster to inputs (same number of clock cycles)Reacts slower to inputs (generally one clock cycle later)
Final statesNo final states in Mealy machineFinal states are present in Moore machine
Output placementOutput is placed on transitionsOutput is placed on states

Summary

  • ε-closure captures all states reachable via epsilon moves alone, and is fundamental to converting ε-NFA to DFA.
  • Mealy machine produces output based on both state and input (faster, fewer states), while Moore machine produces output based only on the current state (slower, more states).

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.