Finite Automata: Deterministic Finite Acceptor (DFA)
Finite Automata: Deterministic Finite Acceptor (DFA)
2
3 We have seen in the first chapter how a language can be generated by a grammar. A language
4 can be recognized by a machine. Such a device is called a recognition device. Hence a language
5 can have a representation in the form of generative device as a grammar as well as in terms of a
6 recognition device called acceptor. The simplest machine or recognition device is the finite state
7 machine which we will discuss in the machine section. Apart from these two types there is
8 another representation like regular expression.
9 Finite automata can be represented by the graph where the vertices give the internal states and
10 the edges transitions. Transition diagram consists of states and the transitions of states.
11 Informally, a state of a system is an instantaneous description of that system which gives all
12 relevant information necessary to determine how the system can evolve from that point on and
13 represented by a circle. Transitions are changes of states that can occur spontaneously or in
14 response to inputs to the states. Though transitions usually take time, we assume that state
15 transitions are instantaneous (which is an abstraction). A system containing only a finite number
16 of states and transitions among them is called a finite-state transition system. Finite-state
17 transition systems can be modeled abstractly by a mathematical model called finite automation.
18 Let us consider the finite automation that accepts any number of “a” and after accepting a single
19 “b” it reaches final state. The transition diagram is shown in fig. 2.1. q0 is the initial state and
20 preceded by an arrow to represent initial state. Final state q1 represented by the double circle.
21 After reaching the final state a q1, If the machine accepts “a” or “b” it reaches to the “trap state”
22 qt or hanging state. At trap state the machine does not respond after giving any input to the
23 system. The inner loop at q0 signifies that machine can accept a single “a”, more than one “a” or
24 no “a”. The inner loop at qt signifies that machine can accept a single “a” or a single “b”, more
25 than one “a/b” or no “a/b”. It is obvious that the language generated from the transition diagram
26 is L(G) ={anm: n≥0}.
a
b
q0 q1
,b
a
,b
a
qt
27
28 Fig. 2.1
29
30 We know that acceptor is of two types, Deterministic Finite Acceptor (DFA) and Non
31 Deterministic Finite Acceptor (NFA).
32 Deterministic Finite Acceptor (DFA): A Deterministic Finite Acceptor (DFA) is defined by the
33 quintuple
1
34 M= (Q, ∑, δ, q0, F)
35 Where Q is the finite set of internal states.
36 ∑ is the set of symbols called input alphabet.
37 δ: Q X ∑ Q is the total function called the transition function.
38 q0εQ is the initial state
39 F εQ is the final state.
40 The finite automation stated in fig 2.1 value of Q= q0, q1, qt
41 ∑= {a,b}
42 q0= q0
43 F= q1
44 δ (q0,a)= q0
45 δ (q0,b)= q1
46 δ (q1,a)= qt
47 δ (q1,b)= qt
48 δ (qt,a)= qt
49 δ (qt,b)= qt
50 Finite automata and their probabilistic counterpart Markov chains are useful tools when we are attempting
51 to recognize patterns in data. These devices are used in speech processing and in optical character
52 recognition. Markov chains have even been used to model and predict price changes in financial markets.
53 Example 2.1: Consider the dfa as shown in fig: 2.1. The language of the automation anbbam: n, m≥0.
a
a
b b
q0 q1 qf
a
b
a, b
qt
54
55 Fig. 2.2
56 Example 2.2:
57 (a)For ∑={a, b} , construct dfa’s that accept set of strings consisting of all strings with exactly one “a”.
b b
q0 a
q1
qt
b
a, b
qt
58
59 Fig. 2.3
2
60 (b)For ∑= {a, b}, construct dfa’s that accept set of strings consisting of all strings with at least one “a”.
b a, b
q0 a
q1
qt
61
62 Fig. 2.4
63 (c)For ∑= {a, b}, construct dfa’s that accept set of strings with no more than three “a”.
b
a, b
a a a a
qt
q0 qt
q1 qt
q2 qt
q3 qt
64
65 Fig. 2.5
66 (d)For ∑= {a, b}, construct dfa’s that accept set of strings with at least one “a” and exactly two “b”.
00 a
10
b b
01 a
a
11
b b
02 a
12
a
b
a,b
qt
67
68 Fig. 2.6
3
69
70
71
72
73