lecture 7
lecture 7
i) NFA
ii) Transition Graphs
Non Deterministic Finite
Automata[1]
• NDFA, for a particular input symbol, the
machine can move to any combination of
the states in the machine.
• the exact state to which the machine
moves cannot be determined.
• it has finite number of states
Formal Definition of an NDFA[1]
• An NDFA can be represented by a 5-tuple (Q, ∑, δ, q0,
F) where :
• Q is a finite set of states.
• ∑ is a finite set of symbols called the alphabets.
• δ is the transition function where δ: Q × ∑ → 2Q
• (Here the power set of Q (2Q) has been taken because in
case of NDFA, from a state, transition can occur to any
combination of Q states)
• q0 is the initial state from where any input is processed
(q0 ∈ Q).
• F is a set of final state/states of Q (F ⊆ Q).
Graphical Representation of an
NDFA: (same as DFA)[1]
• An NDFA is represented by digraphs
called state diagram.
• The vertices represent the states.
• The arcs labeled with an input alphabet
show the transitions.
• The initial state is denoted by an empty
single incoming arc.
• The final state is indicated by double
circles.
Example[1]
• Let a non-deterministic finite automaton be
Q = {a, b, c}
• ∑ = {0, 1}
• q0 = {a}
• F = {c}
• The transition function δ as shown below −
Present State Next State for Input 0 Next State for Input 1
a a, b b
b c a, c
c b, c c
Graphical Representation[1]
Acceptors, Classifiers, and
Transducers[1]
Acceptor (Recognizer):
• An automaton that computes a Boolean
function is called an acceptor. All the
states of an acceptor is either accepting or
rejecting the inputs given to it.
• Classifier
• A classifier has more than two final states
and it gives a single output when it
terminates.
Acceptors, Classifiers, and
Transducers … contd[1]
Transducer
• An automaton that produces outputs
based on current input and/or previous
state is called a transducer.
• Transducers can be of two types −
• Mealy Machine − The output depends both
on the current state and the current input.
• Moore Machine − The output depends
only on the current state.
NFA to DFA Conversion
Transition Graphs
• a more powerful
machine that could
read one or more
letters of the input
string at a time and
could change its state
based on this
information.
• an edge may have
several labels
separated by commas
Example: A machine that
accepts only the string baa
Example: Machine that recognizes all
the words that contain a doubled letter
• There are different paths that the input baa
can take through the previous machine
✓baa could be accepted
✓the processing of a string might break
down at some point.
✓the machine might crash
• New definition of acceptance: a string is
accepted by a machine if there is some
way it could be processed so as to arrive
at a final state.
• There may also be ways in which this
string does not get to a final state, but we
ignore all failures.
Transition Graphs … definition
• A transition graph, (TG), is a collection of three things:
1. A finite set of states at least one of which is
designated as the start state and some (maybe
none) of which are designated as final states (+).
2. An alphabet ∑ of possible input letters from which
input strings are formed.
3. A finite set of transitions that show how to go from
one state to another based on reading specified
substrings of input letters (possibly even the null
string λ ).
• It is not required that there be any specific
number of edges emanating from every
state.
• A successful path through a transition
graph is a series of edges forming a path
beginning at some start state (there may
be several) and ending at a final state.
• An edge labelled with λ,
means that we can take
the ride it offers free
(without consuming any
letters from the input
string).
• we do not have to
follow that edge, but we
can if we want to.
▪ Λbbaab (not accepted)
▪ (abb)(λ)(aa)(b). (accepted)
• Because we have
allowed some edges to
be traversed for free,
we have also allowed
for the possibility of
more than one start
state.
• we could always
introduce more start
states , simply by
connecting them to the
original start state by
edges labeled λ
• Note: Every FA is also a TG but not every
TG satisfies the definition of an FA.
Example
A T.G that accepts only
A t.G that accepts nothing the word Λ
Example
R.E= (a+b)*b
Example T.G for EVEN-EVEN
Generalized Transition Graph
• A Generalized transition graph, (GTG), is a collection of
three things:
1. A finite set of states at least one of which is
designated as the start state and some (maybe
none) of which are final states (+).
2. An alphabet ∑ of input letters.
3. Directed edges connecting some pair of states, each
labeled with a regular expression.
Non Determinism
• There is a possible multiplicity of paths
• The ultimate path through the machine is
not determined by the input alone.
Resource/s
• 1]https://www.tutorialspoint.com/automata
_theory/non_deterministic_finite_automato
n.htm
• 2]Chapter 6 “Transition Graphs”,
Introduction to Computer Theory bu Daniel
I.A Cohen