A formal definition of a Nondeterministic Finite State Machine (NFSM) can be stated as follows: an NFSM is a mathematical model used to describe computations or processes that can be in one of a finite number of states at any given time. It is characterized by its ability to transition from one state to another in a non-deterministic manner, meaning that there may be multiple possible transitions for a given input symbol.
Formally, an NFSM is defined as a 5-tuple (Q, Σ, δ, q0, F), where:
– Q is a finite set of states,
– Σ is a finite set of input symbols called the alphabet,
– δ is the transition function that maps Q × (Σ ∪ {ε}) to the power set of Q, where ε represents the empty string,
– q0 is the initial state,
– F is the set of final states.
The transition function δ allows for non-determinism by mapping a state and an input symbol (or the empty string) to a set of possible next states. This means that for a given input symbol, the NFSM can transition to multiple states simultaneously. The transition function can also have ε-transitions, where the machine can transition without consuming any input symbol.
In contrast, a Deterministic Finite State Machine (DFSM) is a similar mathematical model but with a key difference: it can transition from one state to another in a deterministic manner, meaning that there is a unique next state for each input symbol. Formally, a DFSM is defined as a 5-tuple (Q, Σ, δ, q0, F), where the transition function δ maps Q × Σ to Q.
The key difference between NFSMs and DFSMs lies in their transition functions. While the transition function of an NFSM can map a state and an input symbol to multiple possible next states, the transition function of a DFSM can only map them to a single next state. This deterministic nature of DFSMs makes their behavior predictable and easier to analyze compared to the non-deterministic behavior of NFSMs.
To illustrate this difference, consider the following example:
Suppose we have an NFSM and a DFSM that recognize a language consisting of strings of 0s and 1s where the last symbol is always a 1. The NFSM can have multiple paths to reach an accepting state, while the DFSM has a unique path for each input symbol.
NFSM:
Q = {q0, q1, q2}
Σ = {0, 1}
δ(q0, 0) = {q0}
δ(q0, 1) = {q0, q1}
δ(q1, 0) = {q2}
δ(q1, 1) = {q2}
δ(q2, 0) = ∅
δ(q2, 1) = ∅
q0 = initial state
F = {q2}
DFSM:
Q = {q0, q1, q2}
Σ = {0, 1}
δ(q0, 0) = q0
δ(q0, 1) = q1
δ(q1, 0) = q2
δ(q1, 1) = q1
δ(q2, 0) = q2
δ(q2, 1) = q2
q0 = initial state
F = {q2}
In this example, the NFSM can accept strings like "011", "111", "00001", as it can transition to an accepting state from multiple paths. On the other hand, the DFSM only accepts strings like "111" and rejects all other strings, as it follows a unique path for each input symbol.
A Nondeterministic Finite State Machine (NFSM) is a mathematical model that allows for non-deterministic transitions, where multiple next states can be reached for a given input symbol. This is in contrast to a Deterministic Finite State Machine (DFSM), where each input symbol has a unique next state. NFSMs and DFSMs have different transition functions, resulting in different computational behaviors.
Other recent questions and answers regarding Examination review:
- Why is understanding the formal definition of NFSMs and their relationship to DFSMs important in the field of cybersecurity?
- How does the size of the equivalent DFSM relate to the computational complexity of simulating an NFSM?
- What is the power set of states in the context of NFSMs and why is it important in simulating the machine?
- How can we overcome the challenges of simulating an NFSM by using a DFSM?

