You are on page 1of 10

DFA & NFA

Introduction:
DFA means deterministic finite auto meta .
The machine consists of a sequence of states which
is
denoted by circles , the connections between
each states are represented using edges.
The machine has single transition for a particular
input from the current state is called DFA.

DFA can be defined as let M=(Q,,,Qo,A) is


quintuple function where,

Q=Set of states
=Set of input alphabets
=Transition function
q0 =initial state of the machine
A =Final state or accepting state

a.
b.
c.
d.

String matching
Compiler construction
Lexical analysis
Syntax analysis
Code optimization
Code generation

String matching:

String = H A I

H
Q0

A
Q1

I
Q2

Here,

Q0,Q1,Q2,Q3 are states.

HAI it is String input

Q3

Transition diagram:

=Inputs (0,1)
Q=Set of statements(a ,b ,c , d)
A=Final state(d)


a
b
c
d

0
b
b
d
d

1
a
c
a
d

NFA means non deterministic finite


automata.
It is machine transition from one state to
another state having multiple transition from
the current state and same inputs.

where M=(Q, , , q0 , A)

Inputs=0,1
Total States=5

You might also like