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 EITC/IS/CCTF Computational Complexity Theory Fundamentals:
- Are regular languages equivalent with Finite State Machines?
- Is PSPACE class not equal to the EXPSPACE class?
- Is algorithmically computable problem a problem computable by a Turing Machine accordingly to the Church-Turing Thesis?
- What is the closure property of regular languages under concatenation? How are finite state machines combined to represent the union of languages recognized by two machines?
- Can every arbitrary problem be expressed as a language?
- Is P complexity class a subset of PSPACE class?
- Does every multi-tape Turing machine has an equivalent single-tape Turing machine?
- What are the outputs of predicates?
- Are lambda calculus and turing machines computable models that answers the question on what does computable mean?
- Can we can prove that Np and P class are the same by finding an efficient polynomial solution for any NP complete problem on a deterministic TM?
View more questions and answers in EITC/IS/CCTF Computational Complexity Theory Fundamentals

