Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(2DFA)
Presented By: Raushan kumar
DFA
Input is processed once from left to right. After an input has been read, the DFA decides whether the input is accepted or rejected.
2DFA
Can read the input back and forth with no limit on how many times an input symbol can be read. As in the case of DFA, the 2DFA decides whether a given input is accepted or rejected.
WHAT IS 2DFA?
Two-way Finite Automata have a read head, which can move left or right over the input string. Consists of the symbols of the input string as occupying cells of a nite tape, one symbol per cell.
The input string is enclosed in left and right endmarkers and , which are not elements of the input alphabet . The read head may not move outside of the endmarkers.
STRUCTURE OF 2DFA
Function takes a state and a symbol as arguments and returns a new state and a direction to move the head. If (p, b) = (q, L/R), then whenever the machine is in state p and scanning a tape cell containing symbol b, it moves its head one cell in the direction d and enters state q.
EXAMPLE:
2DFAs can be seen as read-only Turing machines with no work tape, only a read-only input tape
TURING MACHINE
Move back and forth in the working tape while reading and/or writing. Has no limit to the amount of memory that it can use.
2DFA can solve any problems that are solvable by DFA. Next, are there problems that can be solved by 2DFA but cannot be solved by DFA
MATHEMATICAL REPRESENTATION
= (Q , , , , qo , ) Q = A nonempty finite set of state in M. = A nonempty finite set of input symbols. (delta.upp) = A nonempty finite set of outputs. (delta.low) = It is a transition function which takes two arguments input state and input symbol. qo = Initial state of M belongs to Q. (lambda) = It is a mapping function which maps Q to giving output associated with each state.
M
State 1 q,r
a,b
Input condition that must exist in order to execute these transitions from State 1
i,j
State 2 x,y
MOORE MACHINE
Present state q0 q1 q2 q3
TRANSITION DIAGRAM
1
1 0
q0
1 1
q1
1
0 0
q2
0
q3
0
State 1
a,b q,r
Input condition that must exist in order to execute these transitions from State 1
i,j x,y
State 2
MEALY MACHINE
state 1
Present state q1 q2 q3 q4
Input State q3 q1 q2 q4
a=0 output 0 1 1 1
a=1
0 1 0 0
TRANSITION DIAGRAM
0/1
q1
1/0
1/0 0/0
q2
1/1 0/1
q3
1/0
q4
0/1
a P b
a/P c
MOORE MACHINE
b/P
q1
c/P
MEALY MACHINE
EXAMPLE
1
q1
a 0 a 1
q0
q3
a/b
b q2 0
a MOORE MACHINE
q1
a/1 a/1 a/1 , b/1
q0
b/0
q3
b/1 b/0 q2
TRANSFORMING A MEALY MACHINE INTO A MOORE MACHINE b/0 a/0 a/1 b/1 q1 b/1 MEALY MACHINE
b 0 a/1 b 1 a/1
q11
a b/1
q12
b/1
MOORE MACHINE
THANK YOU