Theory of Autamata 4
Theory of Autamata 4
Theory of Autamata 4
Theory of Autamata
Computer Science
I declare that this assessment item is my own work unless otherwise acknowledged and is
in accordance with the University’s academic integrity policy.
I certify that this assessment item has not been submitted previously for academic credit in
this or any other course. I certify that I have not given a copy or have shown a copy of this
assessment item to another student enrolled in the course.
I acknowledge that the assessor of this assignment may, for the purpose of assessing this
assignment:
Reproduce this assessment item and provide a copy to another member of the Faculty; and/or
Communicate a copy of this assessment item to a plagiarism checking service (which may then
retain a copy of the item on its database for the purpose of future plagiarism checking).
Submit the assessment item to other forms of plagiarism checking.
I certify that any electronic version of this assessment item that I have submitted or will
submit is identical to this paper version.
A finite automaton (FA) is a simple idealized machine used to recognize patterns within input
taken from some character set (or alphabet) C. The job of an FA is to accept or reject an input
depending on whether the pattern defined by the FA occurs in the input.
As noted above, we can represent a FA graphically, with nodes for states, and arcs for
transitions.
Programs from FA
Let FA = {S,C,T,s0,F}
S = {s0, s1, s2, s3, s4}
C = {a,b,..z,A,B,..Z,0,1,..9,+,-,*,/}
F = {s4}
T = {(s0,m,s1), (s0,C-m,s0),
(s1,a,s2), (s1,m,s1), (s1,C-a-m,s0),
(s2,i,s3), (s2,m,s1), (s2,C-i-m,s0),
(s3,n,s4), (s3,m,s1), (s3,C-n-m,s0), (s4,C,s4)}
We can easily create a program from this description of the FA. We will use statement labels to
represent states and goto's to represent the meaning of an arc. (In general, goto's are discouraged,
but this is one case where their use is not only reasonable, it is quite common.) The variable
"accept" is true if the FA accepts, and is false otherwise.
A transition diagram or state transition diagram is a directed graph which can be constructed as
follows:
1. In DFA, the input to the automata can be any string. Now, put a pointer to the start state q and
read the input string w from left to right and move the pointer according to the transition
function, δ. We can read one symbol at a time. If the next symbol of string w is a and the pointer
is on state p, move the pointer to δ(p, a). When the end of the input string w is encountered, then
the pointer is on some state F.
2. The string w is said to be accepted by the DFA if r ∈ F that means the input string w is
processed successfully and the automata reached its final state. The string is said to be rejected
by DFA if r ∉ F.
Example
DFA with ∑ = {0, 1} accepts all strings starting with 1.
Solution:
The finite automata can be represented using a transition graph. In the above diagram, the
machine initially is in start state q0 then on receiving input 1 the machine changes its state to q1.
From q0 on receiving 0, the machine changes its state to q2, which is the dead state. From q1 on
receiving input 0, 1 the machine changes its state to q1, which is the final state. The possible
input strings that can be generated are 10, 11, 110, 101, 111......., that means all string starts with
1.
Example
Solution:
The NFA can be represented using a transition graph. In the above diagram, the machine initially
is in start state q0 then on receiving input 1 the machine changes its state to q1. From q1 on
receiving input 0, 1 the machine changes its state to q1. The possible input string that can be
generated is 10, 11, 110, 101, 111......, that means all string starts with 1.