You are on page 1of 6

OPERATIONS ON DETERMINISTIC FINITE AUTOMATON

Amarjeet Kaur, Rajan Sandhu, Sanjeev Kumar, Sakshi


Department of Computer Science & Engineering, St. Soldier Institute of Engineering and Technology
amarjeetghotra27@gmail.com sandhu.rajan@gmail.com kumarsanjeev.2626@gmail.com kaushalsakshi.2626@gmail.com

ABSTRACT: Finite automaton the mathematical tool of a digital computer. Finite automata are used as string or language acceptors. Finite automata has finite number of states. If these states are uniquely determined, that automata is called deterministic finite automata (DFA). Designing complex DFA requires a lot of labour. This complexity can be reduced significantly if we break DFA problem into smaller problems, design them individually and then merge them using AND, OR or NOT operations. In AND operation, the individual states of one DFA is logically AND with states of second DFA. In OR operation, the individual states of one DFA are OR with states of other DFA. While in NOT operation, logical NOT operation is performed on individual states of DFA. Keywords: Finite Automata, Deterministic Finite Automata Logical Operations,

Q X >Q. The model of DFA looks like as follows:

INPUT TAPE

READ HEAD

FINITE CONTROL
(STATE)

II. ACCEPTANCE BY DFA

A string w is accepted by the DFA if DFA is in I. INTRODUCTION Finite automaton the mathematical tool of a digital computer. Finite automata are used as string or language acceptors. Finite automata has finite number of states. If these states are uniquely determined, that automata is called deterministic finite automata (DFA). Formally a DFA is a 5 tuple (, , Q, F, q0) where is the finite set of input symbols, Q is the finite set of states. F Q is the finite set of final states, q0 Q is the initial state. is the transition function of the form A DFA can be designed by either using transition table or using transition diagram. A transition table and diagram for a DFA that accepts a language over symbols {a, b} containing even number of as is given below: final state after reading the string.

III. DESIGNING DFA

States a q0 q1

Input Symbols B q0 q1

accepts a language having minimum 2 number of as and a DFA over {a, b} that accepts a language having minimum 2 number of as as below: (i) DFA M1 (, , Q, F1, q0) with minimum 2 number of as. ={a, b} Q=k0, k1, k2 =Q x>Q q0= k0 F= k2

q1 q0 Fig: Transition Table

Fig: Transition Diagram Fig: Transition Diagram IV. AND operation on DFA States AND operation is applied on two DFAs if the resultant DFA is supposed to meet the conditions of both DFAs. In the resultant DFA the input state is the union of input sets of both participating DFAs. The states of resultant DFA is the cross product of states of participating DFAs. The initial state and final state of resultant DFA is the intersection of initial states of participating DFAs and intersection of final states of participating DFAs respectively. If participating DFAs are denoted by M1 (, 1, Q1, F1, q01) and M2 (, 2, Q2, F2, q02) and resultant M (, , Q, F, q0). Then: = Q=Q1 x Q2 1=( Q1 x Q2) x>Q q0=( q01, q02) F=({ F1}{ F2}) (ii) DFA M2 (, , Q, F1, q0) with minimum 2 number of bs. ={a, b} Q=l0, l1, l2 =Q x>Q q0= l0 F= l2 k0 k1 k2 a k1 k2 k2 Fig: Transition Table Input Symbols b k0 k1 k2

Example: A DFA over {a, b} that accepts a language having minimum 2 number of as and minimum 2 number of bs can be constructed by applying AND operation on DFA over {a, b} that

Fig: Transition Diagram

States a l0 l1 l2 l0

Input Symbols b l1 l2 l2 Where q0= q1= q2= q3= q4= q5= q6= q7= q8=

q8

q8

q8

l1 l2 Fig: Transition Table

Let M (, , Q, F1, q0) DFA over {a, b} that accepts a language having minimum 2 number of as and minimum 2 number of bs. ={a, b} Q={(k0, l0), ( k0, l1), ( k0, l2), ( k1, l0), ( k1, l1), ( k1, l2), (k2, l0), ( k2, l1), ( k2, l2)} =Q x>Q q0= (k0, l0) F= {( k2, l2)}

(k0, l0) ( k0, l1) ( k0, l2) ( k1, l0) ( k1, l1) ( k1, l2) (k2, l0) ( k2, l1) ( k2, l2)

V. OR operation on DFA

OR operation is applied on two DFAs if the resultant DFA is supposed to meet the conditions of either DFA. In the resultant DFA the input state is the union of input sets of both participating DFAs. The states of resultant DFA is the cross product of states of participating DFAs. The initial state and final state of resultant DFA is the union of initial states of participating DFAs and union of final states of participating DFAs respectively. If participating DFAs are denoted by M1 (, 1, Q1, F1, q01) and M2 (, 2, Q2, F2, q02) and resultant M (, , Q, F, q0). Then: = Q=Q1 x Q2 =( Q1 x Q2) x>Q q0=( q01, q02) F=({ F1}U{ F2})

Fig: Transition Diagram

b q3 q4 q5 q6 q7 q8 q6 q7

States a q0 q1 q2 q3 q4 q5 q6 q7

Input Symbols

q1 q2 q2 q4 q5 q5 q7 q8

Example: A DFA over {a, b} that accepts a language having minimum 2 number of as or minimum 2 number of bs can be constructed by applying OR operation on DFA over {a, b} that accepts a language having minimum 2 number of as and a DFA over {a, b} that accepts a language having minimum 2 number of as as below:

(i)

DFA M1 (, , Q, F1, q0) with minimum 2 number of as. ={a, b} Q=k0, k1, k2 =Q x>Q q0= k0 F= k2

Let M (, , Q, F1, q0) DFA over {a, b} that accepts a language having minimum 2 number of as or minimum 2 number of bs. ={a, b} Q={(k0, l0), ( k0, l1), ( k0, l2), ( k1, l0), ( k1, l1), ( k1, l2), (k2, l0), ( k2, l1), ( k2, l2)} =Q x>Q q0= (k0, l0) F= {( k0, l2), ( k1, l2), (k2, l0), ( k2, l1), ( k2, l2)}

Fig: Transition Diagram

States a k0 k1 k2

Input Symbols b k0 k1 k2

k1 k2 k2 Fig: Transition Table

(ii)

DFA M2 (, , Q, F1, q0) with minimum 2 number of bs. ={a, b} Q=l0, l1, l2 =Q x>Q q0= l0 F= l2 States a q0 q1 q2 q3 q4 Fig: Transition Diagram q5 q6 q1 q2 q2 q4 q5 q5 q7 q8 q8 Fig: Transition Table Fig: Transition Diagram

Input Symbols b q3 q4 q5 q6 q7 q8 q6 q7 q8

States a l0 l1 l2 l0

Input Symbols b l1 l2 l2 Where q0= q1=

q7 q8

l1 l2 Fig: Transition Table

(k0, l0) ( k0, l1)

q2= q3= q4= q5= q6= q7= q8=

( k0, l2) ( k1, l0) ( k1, l1) ( k1, l2) (k2, l0) ( k2, l1) ( k2, l2)

Fig: Transition Diagram

States a k0 k1 k2 k3 k3

Input b k0 k1 k2 k3

IV. NOT operation on DFA

k1 k2

NOT operation is applied on a DFAs if the resultant DFA is supposed to meet the conditions exactly complementary to the condition of participating DFA. In the resultant DFA the input state is as that of participating DFA. The states of resultant DFA is same as that of states of participating DFAs. The initial state is same as the initial state of participating DFA. All the states other than final state of the participating DFA is final state in the resultant DFA. If participating DFA is denoted by M1 (, 1, Q1, F1, q01) and resultant M (, , Q, F, q0). Then: = Q=Q1 = Q1 x>Q q0=q01 F= F1

k3

Fig: Transition Table Let M (, , Q, F1, q0) that accepts language over {a, b} having number of a not equal to 2 can be designed as: ={a, b} Q={ q0, q1, q2, q3} = Q x>Q q0=q0 F={ q0, q1, q3}

Fig: Transition Diagram

Example: Design a DFA that accepts language over {a, b} having number of a not equal to 2. This can be constructed by designing a DFA containing exactly 2 number of as and then applying NOT operation on that. Let DFA M1 (, , Q, F1, q0) with exactly 2 number of as. ={a, b} Q={k0, k1, k2, k3} =Q x>Q q0= k0 F= k2 A DFA is a finite automata in which each state is uniquely determined. It is shown that using AND, OR and NOT operations on DFAs the complex V. CONCLUSION q0 q1 q2 q3 States a q1 q2 q3 q3 Fig: Transition Table Input b q0 q1 q2 q3

DFAs can be constructed with great ease. Using AND operation, a DFA can be constructed that satisfies conditions of all participating DFAs. Using OR operation, a DFA can be constructed that satisfies condition of any one of the participating DFAs. Using NOT operation, we can construct a DFA that accepts language complement to that of language accepted by participating DFA.

succinctness of their representation SIAM J. Comput., 18 (6) (1989), pp. 12631282 [9] A. Salomaa Theory of Automata Pergamon, Oxford (1969)

ACKNOWLEDGEMENT

The efforts, contributed by students and teachers, associated with this work are highly acknowledged with great thanks. REFERENCES [1] A.K. Chandra, D.C. Kozen, L.J. Stockmeyer Alternation J. ACM, 28 (1981), pp. 114133 [2] A. Fellah, H. Jrgensen, S. Yu Constructions for alternating finite automata Internat. J. Comput. Math., 35 (1990), pp. 117132 [3] J.E. Hopcroft, J.D. Ullman Introduction to Automata Theory, Languages, and Computation Addison-Wesley, Reading, MA (1979) [4] T. Jiang, B. Ravikumar Minimal NFA problems are hard Proc. 18th ICALP, Lecture Notes in Computer Science, Vol. 510, Springer, Berlin (1991), pp. 629640 [5] E. Leiss Succinct representation of regular languages by boolean automata Theoret. Comput., 13 (1981), pp. 323330 [6] A.R. Meyer, M.J. Fischer Economy of description by automata, grammars, and formal systems FOCS, 12 (1971), pp. 188191 [7] B. Ravikumar Some applications of a technique of Sakoda and Sipser SIGACT News, 21 (4) (1990), pp. 7377 [8] B. Ravikumar, O.H. Ibarra Relating the type of ambiguity of finite automata to the

You might also like