Wa0000.

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Introduction

An NFA or NDFA, like a DFA, is a state machine made up of states and transitions that can
accept or reject a finite string. We already know that Deterministic Finite Automata and Non-
Deterministic Finite Automata are the two types of Finite Automata Machines. In addition, we
must use circles to represent states and directed arrows to represent transitions, just like a DFA.
But what's the distinction?

Since NFAs have fewer constraints than DFAs, they can make complex Automata easier to
understand and depict in a diagram. We can define the non-deterministic finite automaton as a
finite automaton variant with two characteristics:

ε-transition: state transition can be made without reading a symbol; and


Nondeterminism: state transition can have zero or more than one possible value.

However, the above said features do not give NFA any additional power. When it comes to
power, NFA and DFA are equatable.

Due to the above additional features, NFA has a different transition function, rest is the same as
DFA.

Let us understand the concept of NFA with an example:

One thing to keep in mind is that in NFA if any path for an input string leads to a final state, the
input string is accepted. As shown in the above excerpt, there are different paths for the input
string "00" inside the preceding NFA. Since one of the paths leads to a final state, the above
NFA accepts "00."

The formal definition of NFA, like that of DFA, is: (Q, 𝚺, δ, q0, F), where
Formal definition of Non-Deterministic Finite Automata

𝚺 is a finite set of all alphabet symbols.


Q is a finite set of states.

δ: Q x 𝚺 → Q is the transition function from state to state.


q0 ∈ Q is the starting state, and the starting state must be in the set Q
F ⊆ Q is the set of accepted states, all of which must be in the set Q.

The only difference between an NFA and a DFA in terms of formal definition is that an NFA
requires to include the empty string (ε) in the delta function along with the other symbols.

Need for Non-Deterministic Finite Automata


There is a corresponding DFA for every NFA that accepts the same language. If the NFA has n
states, the DFA could have Θ(2n) states. So we work with NFAs because they are likely to be
much smaller than DFAs.

Constructing NFA for a given string is easier than constructing DFA for that particular string. In
other words, NFA can reduce the complexities of the mathematical work needed to establish
many important properties in computation theory. NFAs, for example, make it much easier to
prove regular language closure properties than DFA

Acceptance by Non-Deterministic Finite Automata


A Non-Deterministic Finite Automata acknowledges the input string if there is a set of transitions
that leads to the accepted state. As an outcome, whereas one accepting branch is sufficient for
the overall NFA to accept the string, every branch must reject for the overall NFA to reject.

Any guesses what the following NFA accepts?

Common try it, it's not that tough.

Yes, you are thinking right. This Non-Deterministic Finite Automata accepts any binary string
that contains 00 or 11 as a substring.

The transition table for the above NFA is as follows


Let us change the question and design an NFA that accepts all binary strings that end with 101.

Here is the required NFA. from the question, it's clear that the condition only lies in the ending of
the string, i,e, it should only end with 101. The starting string does not matter. So we are
passing the string 0,1 in the starting state and after that 1, 0, 1 is passed to the coming states.

The transition table for the above NFA is given below:

Differences between Deterministic Finite Automata and Non-Deterministic Finite Automata


A DFA can only have one transition for each symbol that exits the state. An NFA, on the other
hand, can have multiple transitions for the same symbol from the same state.
Non-Deterministic Finite Automata does not need the requirement to have a transition for each
symbol.
An empty string can have a transition in NFA. A DFA cannot transition on an empty string since
it is an invalid transition, but an NFA can.
Backtracking is allowed in DFA, whereas in NFA it's not always possible.
Also See, Symbol Table Operations

Frequently Asked Questions


What Is Non-determinism And Determinism in Automata and What Is The Difference Between
Them?
Determinism refers to the fact that our computational model (machine) knows what to do in the
face of any given input. Our machine may or may not know if it has to do with all possible inputs
due to nondeterminism. A non-deterministic machine can't be implemented (used) on a
computer unless it's converted into a deterministic machine.

Define Regular expression?


Regular Expressions are the generalized forms of regular languages that can be used to create
any string that is related to that language.

What Is the Difference Between FA And NFA? Are They Opposite To Each Other?
FA stands for finite automata, whereas NFA stands for non-deterministic finite automata. In FA,
each letter of the alphabet must have a transition from each state. As a result, the number of
transitions in FA must be equivalent to (number of states * number of alphabet letters). A letter
from a state may go through more than one transition in NFA. Finally, every FA is an NFA,
whereas every NFA may or may not be an FA.

Conclusion
To conclude, we talked about non-deterministic finite automata. We also learned about the
fundamental differences between NFA and DFA. We mentioned the importance of non-
deterministic finite automata. And in which condition, any string is accepted by NFA. Finally, we
looked at the major differences between NFA and DFA in aspects of detailing.

You might also like