0% found this document useful (0 votes)
132 views

Home Automation Using ESP8266

Uploaded by

work.uditr
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)
132 views

Home Automation Using ESP8266

Uploaded by

work.uditr
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/ 4

Analysis of Different Methods to Solve a Problem L = anb2n for all n > = 1 using a

Turing Machine in Terms of their Complexity

Abhishek Shukla
MANIT Bhopal
India
[email protected]

ABSTRACT: This paper is an attempt to compare different methods to solve some context free as well as context sensitive
language [3] using Turing machine. Here we compare complexity [9] of two different methods to solve language like L= anb2n
for all n>=1.This paper give an idea to the reader to develop and analyse different types of methods to solve computational
problem in efficient way.

Keywords: Context Free Languages [1], Complexity, Turing machine [2]

Received: 17 April 2018, Revised 21 May 2018, Accepted 29 May 2018

© 2018 DLINE. All Rights Reserved

DOI: 10.6025/tmd/2018/6/2/43-46

1. Introduction

We have studied about Turing machine i.e. it is a tape which has infinite capacity to store data within the tape. It usages special
character “#” used for blank within the tape. It has a read/write head which can move either Left or Right and can read or write
within the tape one character at a time. A Turing machine is used to accept for those languages which are not accepted by DFA
or PDA. Turing machine is an acceptor for the languages those are generated by unrestricted grammar [7]. A Turing machine is
used to accept context sensitive, recursive [5], recursively enumerable languages [4].

Mathematically a Turing machine Tm can be described as follows.

Tm = {Q, Σ, τ, q0, δ, F, #}

Where

Q = {A finite Set of all internal states}

Transactions on Machine Design Volume 6 Number 2 August 2018 43


Σ = {A finite Set of input alphabets}
τ = {Finite set of symbols called the tape alphabet}
q0 = {initial state}
δ = Is a transition function defined as follows

δ : Q × τ → Q × τ × {L, R}

Here δ is a partial function on Q × τ.

F = {A finite set of final states}

# = # ε τ; Is a special symbol used for blank on the tape

Now we will described bellow two different methods to compute the language L = {anb2n; n > = 1}.

Method 1(Overwriting Method):


A Tm for the language L = {anb2n; n > = 1} is defined by
Tm1 = {Q, Σ, τ, q0, δ, F, #}
Where
Q = {q0, q1, q2, q3, q4, q5}
Σ = {a, b}
τ = {a, b, x, y, z, #}
q0 = {q0}
F = {q5}

And its transition function δ is defined as follows

δ (q0, a) = (q1, x, R)
δ (q1, a) = (q1, a, R)
δ (q1, y) = (q1, y, R)
δ (q1, b) = (q2, y, L)
δ (q2, y) = (q2, y, L)
δ (q2, a) = (q2, a, L)
δ (q2, x) = (q0, x, R)
δ (q0, y) = (q3, y, R)
δ (q3, y) = (q3, y, R)
δ (q3, z) = (q3, z, R)
δ (q3, b) = (q4, y, L)
δ (q4, y) = (q4, y, L)

44 Transactions on Machine Design Volume 6 Number 2 August 2018


δ (q4, z) = (q4, z, L)
δ (q4, x) = (q3, z, R)
δ (q3, #) = (q5, #, L)

Method 2 (Non Overwriting Method):


A Tm for the same language L = {anb2n; n > = 1} is defined by
Tm2 = {Q, Σ, τ, q0, δ, F, #}
where
Q = {s0, s1, s2, s3, s4, s5}
Σ = {a, b}
τ = {a , b, x, y, #}
q0 ={s0}
F = {s5}

and its transition function δ is defined as follows

δ (s0, a) = (s1, x, R)
δ (s1, a) = (s1, a, R)
δ (s1, y) = (s1, y, R)
δ (s1, b) = (s2, y, R)
δ (s2, b) = (s3, y, L)
δ (s3, y) = (s3, y, L)
δ (s3, a) = (s3, a, L)
δ (s3, x) = (s0, x, R)
δ (s0, y) = (s4, y, R)
δ (s4, y) = (s4, y, R)
δ (s4, #) = (s5, #, L)

Similarly for anb3n; n > = 1 Method1 would become little bit complicated and take more steps but Method2 will take just one
more step than anb2n and for anb4n Method1 goes more complicated and Method1 will take one more step than anb3n and so on.
As b’s integral multiple of n increases, number of steps as well as number of states in Method2 increases linearly and in
Method1 it increases randomly.

A table for Method2 is given as follows.

2. Conclusion

From the above two methods we analyze that method2 is efficient than method1 and take less number of steps to perform
computation hence the time complexity of method2 is fewer than method1.Though the space complexity of the above two
methods will be same as they both have the same number of states. At designer point of view also is easier than method1. In the
similar way we can see that for the language L = {anbnc2n n > = 1} which is not be accepted by either DFA or PDA but turing

Transactions on Machine Design Volume 6 Number 2 August 2018 45


Language No. of steps No. of States
a n b 3n 11 6

a n b 3n 12 7

a n b 3n 13 8

a n b 3n 14 9

a n b 3n 15 10

Table 1

machine , method2 will be efficient to method1. The above two comparison gives an idea to the readers to design some more
algorithms which would be easier in computational nature and perform in fewer time.

References

[1] Linz, Peter. Narosa Publication, An intoduction to Formal Languages and Automata fourth Edition.
[2] Alfred, V., Aho, Monica, S., Lam, Sethi, Ravi., Jeffery, D. Ullman by Pearson Education, Inc. and Dorling Kindersley Publication,
Compilers Principles, Techniques and Tools Second edition. Language No. of steps No. of States
[3] Introduction to automata theory, Languages and computation/John E. Hopcroft, Rajeev Motwani, Jeffery D. Ullman-2nd
edition.
[4] http://www-db.stanford.edu/ullman/ialc.html
[5] Introduction to Languages and The Theory of Computation by John C. Martin, 2nd EDN) ISBN-0-07-463722-3.
[6] Theory of computation by Bernard M. Moret Pearson –ISBN-10:8131708705.
[7] Fundamentals of Theory of computation by Raymond Greenlaw & H. James Hoover (Harcount) ISBN-81-7867-036-4
[8] Elements of Theory of computation by Lewis & Papadimitrou, PHI ISBN- 81-203-1271-6
[9] Elements of Descrete Maths By C. L. LIU TMH 2nd EDN ISBN-0-07-043476-X

46 Transactions on Machine Design Volume 6 Number 2 August 2018

You might also like