0% found this document useful (0 votes)
44 views20 pages

Automata Chapter 1

This document defines automata and discusses different types of finite automata including deterministic finite automata and non-deterministic finite automata. It explains concepts like states, transitions, inputs, outputs, languages and provides examples to illustrate these concepts.

Uploaded by

minalukassa9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views20 pages

Automata Chapter 1

This document defines automata and discusses different types of finite automata including deterministic finite automata and non-deterministic finite automata. It explains concepts like states, transitions, inputs, outputs, languages and provides examples to illustrate these concepts.

Uploaded by

minalukassa9
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Chapter one: Introduction to Automata

Definition of Automata

An Automaton is defined as a system where energy, materials and information’s


are transformed, transmitted and used for performing some functions without direct
help of man. Example automatic packing machine and automatic photo printing
machines.

Fig. shows model discrete automaton


Input. At each of the discrete instants of time t1,t2,…., input values I1,I2….,
each of which can take a finite numbers of fixed values from input alphabets ,
are applied to input side of the model shown in above fig.
Output. O1,O2,….OQ are the outputs of the model, each of which can take
finite numbers of fixed values from an output.
States. At any instants of time automaton can be in one of the states
Q1,Q2,…Qn.
State relation. The next stage of an automaton at any instant of time is
determined by the present state and the present input.
Output Relation. Output is related to either state only or to both the input and
state.

The term "Automata" is derived from the Greek word "αὐτόματα" which means "self-acting".
An automaton (Automata in plural) is an abstract self-propelled computing device which
follows a predetermined sequence of operations automatically.
An automaton with a finite number of states is called a Finite Automaton (FA) or Finite State
Machine (FSM).
Alphabets and strings

Alphabet
 Definition − An alphabet is any finite set of symbols.
 Example − ∑ = {a, b, c, d} is an alphabet set where ‘a’, ‘b’, ‘c’, and ‘d’ are symbols.
String
 Definition − A string is a finite sequence of symbols taken from ∑.
 Example − ‘cabcad’ is a valid string on the alphabet set ∑ = {a, b, c, d}

Page | 1
Length of a String
 Definition − It is the number of symbols present in a string. (Denoted by |S|).
 Examples −
o If S = ‘cabcad’, |S|= 6
o If |S|= 0, it is called an empty string (Denoted by λ or ε)

1.2 Languages and Grammars


 Definition − A language is a subset of ∑* for some alphabet ∑. It can be finite or
infinite.
 Example − If the language takes all possible strings of length 2 over ∑ = {a, b}, then
L = { ab, aa, ba, bb }
Automata

Finite Automaton can be classified into two types −


 Deterministic Finite Automaton (DFA)
 Non-deterministic Finite Automaton (NDFA / NFA)

1.3 Finite automata, Deterministic and Non-deterministic finite automata

1.3.1 Deterministic Finite Automaton (DFA)

In DFA, for each input symbol, one can determine the state to which the machine will move.
Hence, it is called Deterministic Automaton. As it has a finite number of states, the machine is
called Deterministic Finite Machine or Deterministic Finite Automaton.

A DFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −


 Q is a finite set of states.

 ∑ is a finite set of symbols called the alphabet.


 δ is the transition function where δ: Q × ∑ → Q
 q0 is the initial state from where any input is processed (q 0 ∈ Q).
 F is a set of final state/states of Q (F ⊆ Q).
Graphical Representation of a DFA

A DFA is represented by digraphs called state diagram.

 The vertices represent the states.


 The arcs labeled with an input alphabet show the transitions.
 The initial state is denoted by an empty single incoming arc.
Page | 2
 The final state is indicated by double circles.
Example

Let a deterministic finite automaton be →

 Q = {a, b, c},
 ∑ = {0, 1},
 q0 = {a},
 F = {c}, and
Transition function δ as shown by the following table −

Present State Next State for Input 0 Next State for Input 1

a a b

b c a

c b c

Its graphical representation would be as follows −

Transition Systems
A transition graph or a transition system is a finite directed labeled graph in which
each vertex or node represents a state and the directed edges indicate the transition
of a state and the edges are labeled with input/output. An initial state
represented by a circle with an arrow pointing towards it, the final state by two
concentric circles, and the other states are represented by one circle.
The transitions frorn one internal state to another are governed bv the transition function δ, for
example, for

Then the dfa is in state q0 and the current input symbol is a, the dfa will go into state q1.
Properties of Transition Function.

Page | 3
Property 1. δ(q, ) = q in a finite automaton. This means the state of the
system can be changed only by an input symbol.
Property 2. For all strings W ∑* and input symbols a.
δ(q, aw) = δ ( δ(q, a), w)
δ(q, wa) = δ ( δ(q, w), a)
This property gives the state after the automaton reads the first symbol
of a string aw and the state after the automaton reads a prefix of the string
wa.
Example : prove that for any transition function δ and for any two input
string x and y.
δ(q, xy) = δ ( δ(q, x), y)  2.1
Proof: By the method of induction on |y|. i.e. length of y. when
|y|=1,y=a.
= δ(q, xa) = δ ( δ(q, x), a) by property 2.
Consider the finite state machine whose ={0,1}, K={q0,q1,q2, q3},q0 in
K is a initial state, final state is q0. Transition function δ is given in the
table. Give the entire sequence of state for the input string 110101.

δ(q0, 110101) = δ(q1, 10101) = δ(q0, 0101)


= δ(q2, 101) = δ(q3, 01)
= δ(q1, 1) = δ(q0, )
= q0
Hence state sequence is given below
1 1 0 1 0 1
q0  q1  q0  q2  q3  q1 q0.
Initial state is q0. Input is either 0 or 1. Start from q0, read 1 and go to q1, from q1,
read 1 and go to q0, from q0, read 0 and go to q2, from q2, read 1 and go to
q3, from q3, read 0 and go to q1, from q1, read 1 and go to q0, State q0 is
a final state.

Let consider the DFA ={a,b}, K={ q0 },q0 in K is a initial state, final state is q0.

This machine also accepts empty string. If initial state is


a final state, the machine will accept the empty string.
Set of string starting with a’s and b’s accepted by this
machine.

Page | 4
Languages L(m) = { x/x  * }
Let consider the DFA ={a,b}, K={q0,q1,D}, q0 in K is an initial state, final
state is q0.

Example

Let a deterministic finite automaton be →

 Q = {a, b, c},
 ∑ = {0, 1},
 q0 = {a},
 F = {c}, and
Transition function δ as shown by the following table −

Present State Next State for Input 0 Next State for Input 1

a a b

b c a

c b c

Its graphical representation would be as follows −

ACCEPTABILITY OF A STRING BY A FINITE AUTOMATON


Consider the finite state machine whose ={a,b}, K={q0,q1,q2,D},q0 in K is
a initial state, final state is q2 transition function δ is given in the table. Give
the entire sequence of state for the input string aaabb.
a b
 q0 q1 D
q1 q1 q2
* q2 D q1
D D D

The sequence of a’s followed by sequence b’s accepted by this machine. At

Page | 5
least one a and one b will be accepted. In the above fig. and table D is dead
state. Start from q0, read a and go to q1, from q1, read a and again go to
q1, from q1, read a and again go to q1, from q1, read b and go to q2,
from q2, read b and again go to q2, State q2 is a final state. The state
sequence of given input is q0q1q1q1q2q2. The string starting
with b is not accepted by the machine. The string end with a is not accepted
by the machine.

Consider the finite state machine whose ={0,1}, K={q0,q1,q2, q3},q0 in


K is a initial state, final state is q0. transition function δ is given in the
table. Give the entire sequence of state for the input string 110101.

δ(q0, 110101) = δ(q1, 10101) = δ(q0, 0101)


= δ(q2, 101) = δ(q3, 01)
= δ(q1, 1) = δ(q0, )
= q0
Hence state sequence is given below
1 1 0 1 0 1
q0  q1  q0  q2  q3  q1 q0.
Initial state is q0. Input is either 0 or 1. Start from q0, read 1 and go to q1, from q1,
read 1 and go to q0, from q0, read 0 and go to q2, from q2, read 1 and go to
q3, from q3, read 0 and go to q1, from q1, read 1 and go to q0, State q0 is
a final state.

Let consider the DFA ={a,b}, K={ q0 },q0 in K is a initial state, final state is q0.

Empty string is also accepted by this machine. If initial


state is a final state the empty string will be accepted
by the machine. Set of string starting with a’s and b’s
accepted by this machine.

Languages L(m) = { x/x  * }


Let consider the DFA ={a,b}, K={q0,q1,D}, q0 in K is an initial state, final
state is q0.

Page | 6
a b
 * q0 q1 D
q1 D q0
D D D

Input string = ababab, Sequences of ab’s accepted


by this machine. At least one ab’s will be
accepted. In the above fig. and table D is dead state.
Start from q0, read a and go to q1, from q1, read b
and go to q0, same manner the machine will
accepted the string ababab. State q0 is a final state.
The string starting with b and ending with a will not
accepted by the machine. Languages of the machine.
L(m) = { (ab)n / n >=0 }.

Consider the finite state machine whose ={ a,b }, K={q0,q1,q2},q0 in K is an initial state,
final state is q0.

a b
 * q0 q1 q1
q1 q2 q2
q2 q0 q0

Any string starting with a’s and b’s will be accepted by the machine. But string length should divisible
by 3. Language of the machine is L(m) = { x /x  *,|x| = 3K }. K is a integer.

Consider the DFA whose ={ A,B,…,Z,0,1…,9 }, K={ q0,q1,q2,q3,q4,q5,q6 },q0 in


K is a initial state, F = { q1,q2,q3,q4,q5,q6 }. Fortran Identifier maximum length is
6.
A-Z 0-9
 q0 q1 Ø
* q1 q2 q2
* q2 q3 q3
* q3 q4 q4
* q4 q5 q5
* q5 q6 q6

Any type of string starting with A-Z followed by A-Z or 0-9 and string length
should be 1 to 6 character. Languages L(m) = { x /x  A-Z and x  A-Z or 0-9,|x|
<=6}

Page | 7
Example
Let a deterministic finite automaton be →

 Q = {a, b, c},
 ∑ = {0, 1},
 q0 = {a},
 F = {c}, and
Transition function δ as shown by the following table −

Present State Next State for Input 0 Next State for Input 1

a a b

b c a

c b c

Its graphical representation would be as follows −

Example
Let us consider the DFA shown below. From the DFA, the acceptable strings can be derived.

Page | 8
Strings accepted by the above DFA: {0, 00, 11, 010, 101, ...........}
Strings not accepted by the above DFA: {1, 011, 111, ........}
1.3.2 Non-Deterministic Finite State Automata

In NFA, for a particular input symbol, the machine can move to any combination of the states in
the machine. In other words, the exact state to which the machine moves cannot be determined.
Hence, it is called Non-deterministic Automaton. As it has finite number of states, the machine is
called Non-deterministic Finite Machine or Non-deterministic Finite Automaton.

An NFA can be represented by a 5-tuple (Q, ∑, δ, q0, F) where −


 Q is a finite set of states.
 ∑ is a finite set of symbols called the alphabets.
 δ is the transition function where δ: Q × ∑ → 2Q
(Here the power set of Q (2Q) has been taken because in case of NDFA, from a state,
transition can occur to any combination of Q states)
 q0 is the initial state from where any input is processed (q0 ∈ Q).
 F is a set of final state/states of Q (F ⊆ Q).
Let see the example below, which describes the nondeterministic automaton since there are two
transitions labeled with ‘a’ out of qo.

Let a non-deterministic finite automaton be →

 Q = {a, b, c}
 ∑ = {0, 1}
 q0 = {a}
 F = {c}

Page | 9
The transition function δ as shown below −

Present State Next State for Input 0 Next State for Input 1

a a, b b

b c a, c

c b, c c

Its graphical representation would be as follows −

Consider the NFA whose ={a,b}, Q={ q0,q1,q2 },q0 in Q is initial state,
final state is q2, transition function δ is given in the table. To check
whether the given string aaabb is accepted by the machine or not.
Initial state q0. Two choose are there
reading a from q0 either it is go to q0 or
q1. Similarly two choose are there reading
b from q1 it is go either to q1 or q2. Final
state is q2. The string sequence of a’s
followed by sequence of b’s will be
accepted by the machine. The string
starting with b and ending a are not
accepted by the machine. The state
sequence is q0 ->q0->q0-> q1 -> q1 -> q2
for the input aaabb.
The initial state q0. Reading a from q0 and go to q0,
again a is reading from q0 and go to q0, again a is
reading from q0 and go to q1, again b reading from q1
and go to q1 and finally b reading from q1 and go to
q2,
Example: Ending of Strings

An NFA that accepts all binary strings that end with 101.

Page | 10
Design a NFA for the transition table as given below:

The transition diagram can be drawn by using the mapping function as given in the table.

Design an NFA with ∑ = {0, 1} in which double '1' is followed by double '0'.

Now before double 1, there can be any string of 0 and 1. Similarly, after double 0, there can be
any string of 0 and 1.

1.3.3 The Equivalence of DFA and NFA

Let, M = (Q, ∑, δ, q0, F) is an NFA which accepts the language L(M). There should be
equivalent DFA denoted by M' = (Q', ∑', q0', δ', F') such that L(M) = L(M'). Any string is

Page | 11
accepted by NFA can be accepted by a DFA. Method is called as subset.

Example 1:

Convert the given NFA to DFA.

For the given transition diagram we will first construct the transition table.

State 0 1

→q0 {q0, q1} {q1}

*q1 ϕ {q0, q1}


Now we will obtain δ' transition for state q0.

δ'([q0], 0) = {q0, q1}


= [q0, q1] (new state generated)
δ'([q0], 1) = {q1} = [q1]

The δ' transition for state q1 is obtained as:

δ'([q1], 0) = ϕ
δ'([q1], 1) = [q0, q1]
Now we will obtain δ' transition on [q0, q1].
δ'([q0, q1], 0) = δ(q0, 0) ∪ δ(q1, 0)
= {q0, q1} ∪ ϕ
= {q0, q1}
= [q0, q1]
Similarly,

δ'([q0, q1], 1) = δ(q0, 1) ∪ δ(q1, 1)


= {q1} ∪ {q0, q1}
= {q0, q1}
= [q0, q1]
As in the given NFA, q1 is a final state, then in DFA wherever, q1 exists that state
becomes a final state. Hence in the DFA, final states are [q1] and [q0, q1]. Therefore
set of final states F = {[q1], [q0, q1]}.

The transition table for the constructed DFA will be:

State 0 1

Page | 12
→[q0] [q0, q1] [q1]

*[q1] ϕ [q0, q1]

*[q0, q1] [q0, q1] [q0, q1]


The Transition diagram will be:

Example 2:

Convert the given NFA to DFA.

For the given transition diagram we will first construct the transition table.

State 0 1

→q0 q0 q1

q1 {q1, q2} q1

*q2 q2 {q1, q2}

Now we will obtain δ' transition for state q0.


δ'([q0], 0) = [q0]
δ'([q0], 1) = [q1]
The δ' transition for state q1 is obtained as:
δ'([q1], 0) = [q1, q2] (new state generated)
δ'([q1], 1) = [q1]
The δ' transition for state q2 is obtained as:
δ'([q2], 0) = [q2]
δ'([q2], 1) = [q1, q2]

Page | 13
Now we will obtain δ' transition on [q1, q2].
δ'([q1, q2], 0) = δ(q1, 0) ∪ δ(q2, 0)
= {q1, q2} ∪ {q2}
= [q1, q2]
δ'([q1, q2], 1) = δ(q1, 1) ∪ δ(q2, 1)
= {q1} ∪ {q1, q2}
= {q1, q2}
= [q1, q2]
The state [q1, q2] is the final state as well because it contains a final state q2. The transition
table for the constructed DFA will be:

State 0 1

→[q0] [q0] [q1]

[q1] [q1, q2] [q1]

*[q2] [q2] [q1, q2]

*[q1, q2] [q1, q2] [q1, q2]


The Transition diagram will be:

Consider the NFA whose ={a,b}, K={ q0,q1,q2 },q0 in K is a initial state, final
state is q2 transition function δ is given in the table. To check whether the
given string is aaabb accepted by the machine or not.

a b
 q0 {q0,q1} {Ø}
q1 {Ø} {q1,q2}
* q2 {Ø} {Ø}
NFA State Table
a b
[q0] [q0,q1] [Ø]
[q0,q1] [q0,q1] [q1,q2]
* [q1,q2] [Ø] [q1,q2]
[Ø] [Ø] [Ø]

Page | 14
NFA Equivalent DFA State table
DFA Transition Diagram and state sequence.

Language of the machine L(m) = { am, bn / n,m >=1}. The state diagram is given
beside Initial state q0. Reading a from q0 and go to [q0,q1], again reading a from
[q0,q1] and go to [q0,q1], again reading a from [q0,q1] and go to [q0,q1], and
reading b from [q0,q1] and go to [q1,q2], again reading b from [q1,q2], and go
to [q1,q2]. That is a final state. The string sequence of a’s followed by sequence of
b’s will be accepted by the machine. The string staring with b and ending a are
not accepted by the machine. The state sequence is q0 δ [q0,q1] δ [q0,q1] δ
[q0,q1] δ [q1,q2] δ [q1,q2] for the input aaabb.
Consider the set of strings over  = {0,1} which ending with either 00 or 11.

0 1
 q0 {q0,q1} {q0,q3}
q1 {q2} {Ø}
* q2 {Ø} {Ø}
q3 {Ø} {q4}
* q4 {Ø} {Ø}
NFA State Table
0 1
[q0 ] [q0,q1] [q0,q3]
[q0,q1] [q0,q1,q2] [q0,q3]
[q0,q3] [q0,q1] [q0,q3,q4]
*[q0,q1,q2] [q0,q1,q2] [q0,q3]
*[q0,q3,q4] [q0,q1] [q0,q3,q4]
NFA Equivalent DFA State table DFA State Diagram
Initial state is [q0 ]. The given input string is 10100. Reading 1 from q0 and go
to [q0,q1], again reading 0 from [q0,q1] and go to [q0,q1,q2], again reading 1 from
[q0,q1,q2] and go to [q0,q3], again reading 0 from [q0,q3] and go to [q0,q1] and
finally reading 0 from [q0,q1] and go to [q0,q1,q2]. It is a final state. So given
string is accepted by machine.

Minimization of Finite Automata


Consider a DFA over . Two states are Equivalent iff for any string x in *.
δ(p, x) and δ(q, x) are both in final state or both not in final state.

If P and Q are distinguishable, if a string x / δ(p, x)  F. and if a string x / δ(Q,

Page | 15
x)  F. one of them may be in Final state and another may not be in final state. X is
called the distinguishable string sequence.

If P and Q are two states, p reads a and go to r, similarly q reads a and go to s, r =


δ(p, x) and s = δ(q, x). if p and q are Equivalent, means automatically r and s are
equivalent. r and s are both in final state or both not in final state.

If r and q are distinguishable, if a string a / δ(p, a)  F. and if a string a / δ(Q, a)


 F. one of them may be in Final state and another may not be in final state. a is
called the distinguishable string sequence. Automatically, P and Q will be a
distinguishable.

We have to follow the various steps to minimize the DFA. These are as follows:
Step 1: Remove all the states that are unreachable from the initial state via any set of the
transition of DFA.

Step 2: Draw the transition table for all pair of states.


Step 3: Now split the transition table into two tables T1 and T2. T1 contains all final states,
and T2 contains non-final states.
Step 4: Find similar rows from T1 such that:

1. δ (q, a) = p
2. δ (r, a) = p
That means, find the two states which have the same value of a and b and remove one of
them.
Step 5: Repeat step 3 until we find no similar rows available in the transition table T1.
Step 6: Repeat step 3 and step 4 for table T2 also.
Step 7: Now combine the reduced T1 and T2 tables. The combined transition table is the
transition table of minimized DFA.

Step 1: In the given DFA, q2 and q4 are the unreachable states so remove them.
Step 2: Draw the transition table for the rest of the states.

Page | 16
State 0 1

→q0 q1 q3

q1 q0 q3

*q3 q5 q5

*q5 q5 q5
Step 3: Now divide rows of transition table into two sets as:
1. One set contains those rows, which start from non-final states:

State 0 1

q0 q1 q3

q1 q0 q3
2. Another set contains those rows, which starts from final states.

State 0 1

q3 q5 q5

q5 q5 q5

Now, eliminate the indistinguishable states


Since q3 and q5 in set 2 have the same rows for the same input 0 and 1, replace q5 by q3 for each
row in a set.
Step 4: Set 1 has no similar rows so set 1 will be the same.
Step 5: In set 2, row 1 and row 2 are similar since q3 and q5 transit to the same state on 0 and 1.
So skip q5 and then replace q5 by q3 in the rest.

State 0 1

q3 q3 q3
Step 6: Now combine set 1 and set 2 as:

State 0 1

→q0 q1 q3

q1 q0 q3

Page | 17
*q3 q3 q3

Now it is the transition table of minimized DFA.

Consider ={ 0, 1 } From the given automata construct a minimization automata.


There are six states available in this machine. Take all
the states make a partition further and further until can’t
make a partition. Out of six three will be final state
q3,q4,q5 make it one group rest of them (q0,q1,q6)
make it another group. Sequence of zeros followed by 1
and followed by zeros will be accepted. One alone also
accepted.

This is not a minimization automata. One


successor of q0, q1 is final state. But one
successor of q6 is not a final state. So q0
and q1 make it one partition and q6
make it another partition. Zero successor
of Q3,q4,q5 is q5 only and one successor
of Q3,q4,q5 is q6 only. So we can’t make
partition.
There are two type of machines are available Moore Machine and Mealy Machine. An
Automaton in which the output depends on the states of the machine is called a
Moore Machine. An Automaton in which the output depend on the input at any
instant of time is called a Mealy Machine.

Consider ={0,1} and output alphabets Δ = { y, n} construct Mealy Machine


any string ending with 2 zero’s or ending with 2 ones.
Mealy Machine  : K *   Δ
Input string is 001011. Initial state is q0, reading 0 from
q0 and goes to q1, output is n, reading 0 from q1 and

Page | 18
goes to q1, output is y, reading 1 from q1 and goes to q2,
output is n, reading 0 from q2 and goes to q1, output is
n, reading 1 from q1 and goes to q2, output is n, reading
1 from q2 and goes to q2, output is y. Input and output
table is given below.

Input 0 O 1 0 1 1
output N y n n n y
Final output is y, so string ending with 2 ones was accepted by the machine. The
given input size is six and output size is also six.
Consider ={0,1} and output alphabets Δ = { 0, 1, 2, 3, 4} construct Moore
Machine with string 10001. Moore Machine  : K  Δ.
The input string is 100. It’s start from q0, reading
1 from q0 and goes to q1, output is 1, reading 0
from q1 and goes to q2, output is 2, reading 0
from q2 and goes to q4. Final output is 4. Input
string binary value is 100 and equivalent decimal
value is 4.
1 0 0 N
q0  q q Q4 N+
1 2 1
0 1 2 4 N+
1
The given input size is 3 (N) but state sequence size and output size are 4. That is
N+1. Moore Machine are depends only on states. Now we will see the input string
10001. It’s start from q0, reading 1 from q0 and goes to q1, output is 1, reading 0 from
q1 and goes to q2,output is 2, reading 0 from q2 and goes to q4, output is 4,
reading 0 from q4 and goes to q3, output is 3, reading 1 from q3 and goes to q2.
Final output is 2. The input string binary value is 10001 and equivalent decimal
value 17. Input value is divide by 5 and get remainder is 2. That is the final output
of given input.
Construct Moore Machine equivalent Mealy Machine
Consider ={0,1} and output alphabets Δ = { 0, 1, 2, 3, 4} construct Moore Machine
equivalent Mealy Machine with string 10011.

The input string 10001. It’s start from q0, reading 1 from q0 and goes to q1, output is 1,
reading 0 from q1 and goes to q2,output is 2, reading 0 from q2 and goes to q4, output
is 4, reading 0 from q4 and goes to q4, output is 4, reading 1 from q4 and goes to q4.
Final output is 4. The input string binary value is 10011 and equivalent decimal value
19. Input value is divide by 5 and get remainder is 4. That is the final output of given
input.

Page | 19
Input 1 O 0 1 1
output 1 2 4 4 4

The given input size is 5 (N) and output size is also


5 (N).

Construct Mealy Machine equivalent Moore Machine


Mealy Machine M=(K, , Δ, δ, , q0)
Moore Machine M=(K * Δ, , Δ, δ1, 1, [q0, b] ) δ1([q, b], a) =
[δ (q, a),  (q0, a)]
1 ( [q0, b] ) = b

Input string is 100. Initial state is p0,n], reading 1 from [p0,n] and goes to [p2,n],
output is n, reading 0 from [p2,n] and goes to [p1,n], output is n, reading 0 from
[p1,n] and goes to [p1,y], output is y. Size (N) of input is equal to size (N) of the
output. Input and output table is given below.
Input 1 O 0
output N N Y

Page | 20

You might also like