Professional Documents
Culture Documents
Computers are used everywhere – Processing numbers, data, images and controlling
the operations of various devices
Are computers capable of computing anything? If computers cannot do everything,
what are they and why? In essence, what is computation?
To study limitations of computations we study the essence of computers rather than
studying varieties of computers.
The essence of computation is Turing Machine – conceived by Alan Turing in early
20th Century. It s a simple device but every task performed by modern computers can
be accomplished by Turing Machine.
Before studying Turing machine a simple device called finite automata can be
studied, which can model a large number of systems used in practice.
To learn about the fundamental capabilities and ultimate limitations we look to the
theory of computation or theoretical computer science.
Theory of Computation
Specifications of a Language:
Sentence Formation:
Importance of strings
The input to our computers is always strings. Everything can be converted to questions about
strings. Hence we will be concerned with acceptance or non acceptance of strings.
Automata theory is the study of abstract computing devices, or "machines." Before there were
computers, in the 1930's, A.Turing studied an abstract machine that had all the capabilities of
today's computers, at least as far as in what they could compute. Turing's goal was to describe
precisely the boundary between what a computing machine could do and what it could not
do; his conclusions apply not only to his abstract Turing Machines, but to today's real
machines.
In the 1940's and 1950's, simpler kinds of machines, which we today call "finite automata,"
were studied by a number of researchers. These automata, originally proposed to model brain
function, turned out to be extremely useful for a variety of other purposes. Also in the late
1950's, the linguist N. Chomsky began the study of formal "grammars." While not strictly
machines, these grammars have close relationships to abstract automata and serve today as
the basis of some important software components, including parts of compilers.
All of these theoretical developments bear directly on what computer scientists do today.
Some of the concepts, like finite automata and certain kinds of formal grammars, are used in
the design and construction of important kinds of software. Other concepts, like the Turing
machine, help us understand what we can expect from our software.
Finite automata are a useful model for many important kinds of hardware and software like
There are many systems or components, such &s those enumerated above, that may be
viewed as being at all times in one of a finite number of "states." The purpose of a state is to
remember the relevant portion of the system's history. Since there are only a finite number of
states, the entire history generally cannot be remembered, so the system must be designed
carefully, to remember what is important and forget what is not.
The advantage of having only a finite number of states is that we can implement the system
with a fixed set of resources. For example, we could implement it in hardware as a circuit or
as a simple form of program that can make decisions looking only at a limited amount of data
or using the position in the code itself to make the decision.
There are two important notations that are not automaton-like, but play an important role in
the study of automata and their applications.
1. Grammars that are useful models when designing software that processes data with a
recursive structure. An example is a 'parser’, the component of a compiler
2. Regular Expressions that denote the structure of data, especially text strings.
What is JFLAP
JFLAP is a package of graphical tools which can be used as an aid in learning the basic
concepts of Formal Languages and Automata Theory.
Regular languages - create
DFA
NFA
regular grammar
regular expression
push-down automaton
context-free grammar
L-Systems
Create L-systems
A finite automaton has a finite set of states with which it accepts or rejects strings. “Program”
prescribes how symbols read affect current state. Final state is state FA is in when finished
reading the input string. There are ACCEPT states (double circle) and REJECT states. A
finite automaton accepts input string if final state is accept state; otherwise it rejects.
1. The simplest nontrivial finite automaton is an on/off switch. The device remembers
whether it is in the "on" state or the "off" state, and it allows the user to press a button
whose effect is different, depending on the state of the switch. That is, if the switch is
in the off state, then pressing the button changes it to the on state, and if the switch is
in the on state, then pressing the same button turns it to the off state.
2. Finite Automaton to accept (1+01)*00(1+0)* (Note that the string should have 00 to
be accepted. Other variants – 1 or 01 any number of times can precede 00 and any
combination of 1 and 0 can succeed 00. But minimum string accepted is 00)
3. Finite automaton to accept (0*10*1)*0*10* (Note that the string should have a 1, or
odd number of 1’s to be accepted. Other variants – any number of 0’s followed by a 1,
followed by any number of zeros, followed by a 1, or any number of repetitions of
this combination (0*10*1), followed by any number of zeros, followed by a 1,
followed by any number of zeros)
A trap is state that once entered, one can never leave. A trap state is used to reject partly read
strings that will never be accepted, or to accept partly read strings that will definitely be
accepted.
6. An automaton with a trap state to accept strings with alternating 0’s and 1’s
7. Another design of the automaton to accept strings with alternating 0’s and 1’s
8. Automata to accept a) All binary strings with at least one 0 b) All binary strings
with at most one 0 c) All binary strings starting and ending with 0 (and single-0
string counts) are illustrated below:
9. A vending machine designed to give soda if coins, in any combination of 1, 2 or 5,
amount to 5 and to eject coins if the amount is less or more.
11. Think of real world situations where we come across acceptance or non acceptance of
strings – An ATM machine which declines transactions given three consecutive
wrong PIN can be thought of rejecting strings with three consecutive zeros. Think of
other situations and try to model them with JFLAP – like the standard task to find all
occurrences of a short string, called the pattern string, within a long string, called the
text string – String Processing.
Exercises for the Hands on Session:
1. Construct an automaton to accept valid integers like +989, -978, 980 etc
10. Construct an automaton whose language is the set of strings of a’s and b’s and c’s that
contain abc as a substring
11. Construct an automaton that accepts all strings of {a, b, c} whose symbols are in the
alphabetical order like aaabccc and not like abca or cb
12. Construct an automaton that accepts all binary strings with an even number of 0’s and
and the number of 1’s is a multiple of 3.