To send content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about sending content to .

To send content to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about sending to your Kindle.

Note you can select to send to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be sent to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.

By using this service, you agree that you will only keep articles for personal use, and will not openly distribute them via Dropbox, Google Drive or other file sharing services.
Please confirm that you accept the terms of use.

In today's world of intense information dissemination and globalisation, the need of the hour is to bring out a well-structured and authentic textbook, especially in the field of computer science and technology. Our humble effort in this regard is to make a sincere value addition through this textbook.

This book is the culmination of our fascination for the subject of computation and its applications. It has been designed for students of computer science at the postgraduate level and is logically conceived, self-contained, well-organised and user-friendly.

The book contains an in-depth coverage of all the topics related to the theory of computation as mentioned in the syllabuses of B.E., M.C.A. and M.Sc. (Computer Science) of various universities. Sufficient amount of theoretical inputs supported by a number of illustrations are included for those who take deep interest in the subject.

The book includes 15 chapters, segregated into three sections. Part one ‘Fundamentals of Computation’, contains chapters 1 to 3. Chapter 1 is introductory in nature and gives a broad picture of the subject. Chapters 2 and 3 discuss Formal Language Theory and Regular Expressions and Languages. Part two ‘Models and Principles of Computation’, comprises chapters 4 to 7, and discusses topics like Finite State Machine, Equivalent Automata, Optimisation/Minimisation of DFA, Finite Automata and Regular Expressions, Transducers et cetera in a systematic way. Finally, part three ‘Advanced Models and Principles of Computation’ includes chapter 9 to 15, and addresses issues of Context- Free Grammar and Context-Free Languages, Simplification of Context-Free Grammar, Pushdown Automata, Pumping Lemma, Turing Machine, TM Extensions and Languages and Formal Languages/Grammar Hierarchy .

A language is a system of signs used to communicate information to others. However, the language of computation is a combination of both english and mathematics. Fundamentally, a computer is a symbol manipulator, in the sense, that it takes sequences of symbols as inputs and manipulates them as per the program specifications. These symbols are precise and unambiguous, unlike the language of humans. The first step in communicating a problem to a machine is the design of a proper language of computation and this is the fundamental object of computability.

While discussing about languages, it is important to note two cases:

a. During the evaluation of an input expression (e.g.: calculator), the language of arithmetic expression handles both the input and the output communication.

b. In the case of web form, the language simply describes all the legitimate inputs to the field and the output is simply a binary value-Yes or No.

Thus, the problems belonging to case (a), have both input and an output language, while, those belonging to case (b), have only an input language. It is of interest to note that, from the perspective of theory of computation, any type of problem can be expressed in terms of a language recognition.

Since a language is a medium of communication, it should be given some meaning (i.e. its semantics). But much of the manipulation of symbols, strings and language could be done effectively without understanding their semantics and this is the subject of this section. In other words, the mathematical study of the theory of computation begins with the understanding of the mathematics of symbols and strings.

Consider the problem of heating a room. Assume that the thermostat is used as a controller and we do not have the exact model of how the the thermostat functions. It is only known that the thermostat turns on the radiator when temperature is between 68 and 70 degrees and it turns off the radiator when temperature is between 80 and 82 degrees. This heating system can be modelled as an automaton shown in the figure below, where X denotes the temperature.

The automaton shown is a non deterministic automaton, in the sense that for a given initial condition it accepts the whole family of different executions (solutions).

Elevator Controller

Consider an elevator that serves two floors. Inputs to elevator are calls to a floor, either from inside the elevator or from the floor itself.

The following are the 3 possible inputs:

i) no calls (a)

ii) call to floor one (b)

iii) call to floor two. (c)

The following are the 6 possible states:

q1 – waiting on first floor

q2 – about to go up

q3 – going up

q4 – going down

q5 – waiting on second floor

q6 – about to go down.

The above transition diagram is without the accepting and rejecting states because the elevator design is simple and acceptance is not an issue. In designing a more complex elevator, with states like overloading, breakdown etc., accepting and rejecting states become significant.

Computation is a concept common to all computing machines, regardless of the messy details associated with their hardware implementation. However, actual computing machines/computers are too complicated (due to the several constraints caused by physical reality) for a manageable mathematical theory to be ascribed to them. Therefore, in order to fully understand the power and limitation of real machines, idealised computers or computational models are designed and studied. These idealised computers may be accurate in some ways but perhaps not in others.

There are several computational models and the purpose of a computational model is to capture the computational aspects that are relevant to the particular problem under consideration while hiding the other unimportant aspects. Thus, a computational model can be thought of as a custom machine designed to suit particular needs. Some of the important computational models are – deterministic finite automaton (DFA), the non-deterministic finite automaton (NFA), the deterministic pushdown automaton (DPDA), the nondeterministic pushdown automation (NPDA), the deterministic Turing machine (DTM) and the nondeterministic Turing machine (NTM). Undoubtedly each of these models has a special significance in the theory of computation. The most basic computational model is the deterministic finite automaton (DFA).

Finite Automata

As discussed in chapter 1, finite automaton is a mathematical model of a system with discrete inputs and outputs. Such a system can be in any one of the finite number of internal configurations or ‘states’ and each state of the system provides sufficient information concerning the past inputs so that the behaviour of the system could be studied on the provision of subsequent inputs.

‘Grammar is the mathematics of a language and mathematics is the grammar of creation.’

Introduction

In any language such as English, Hindi or Sanskrit, words can be combined in several ways. Naturally, some combinations form valid sentences, while others do not. The validity of a sentence is determined by the grammar of a language, which comprises a set of rules. For instance, ‘The boy prepares tea quickly’, although meaningless, is a perfectly legal sentence. In other words, the sentences in a language may be nonsensical, but they must obey the rules of grammar. The discussion in this chapter deals with only the syntax of sentence (the way the words are combined) and not with the semantics of sentences (meaning).

In the previous chapters, two different (though equivalent) methods: finite automata and regular expressions were introduced for describing languages. These methods have their own limitations in the sense that some simple languages, such as {0n1n|n ≥ 0}, cannot be described by these methods. Formal languages and grammars are widely used in connection with programming languages. During programming, we proceed with an intuitive knowledge of the languages, which leads to errors. Therefore, a precise description of the language is needed, at almost every step, which helps to understand the syntax diagrams found in programming texts. Among the ways in which programming languages can be defined precisely, grammars or context-free grammars are most widely used. This method happens to be a very powerful method and such grammars can describe certain features which have a recursive structure. Context-free-grammars (CFG) were first used in the study of human languages.