Umair 1
Umair 1
Umair 1
ASSIGNMENT NO 01
1
AUTOMATA THEORY AND IT’S TYPES
AUTOMATA THEORY
Automaton, in plural Automatons or Automata, is a self-operating device. Automata
Theory lies in Computer Science and Discrete Mathematics. It is the study of the abstract
machine in theoretical computer science. It is designed to automatically follow a
predetermined sequence of operations. The term automata is derived from the Greek
word αὐτόματα, which means 'self-making'. It means it automatically processes the
production of specific work.
AUTOMATA INVENTOR
The Jacques de Vaucanson was responsible for the invention of innovative and impressive
Automata.
As all of us know, every machine takes some input. That input can have to pass through
multiple stages. Every stage has some information on what to do with the incoming input. It
can either reject the input or return some output. So, that needs computation of the machine.
This is the basic concepts behind Automata Theory.
Characteristics of Automata
The basic characteristics of automata include the following:
❑ INPUTS - It is a finite set of input symbols or sequences of symbols, {x1, x2,
x3,...,xk}, where k is the number of inputs.
❑ OUTPUTS - It is a finite set of output symbols, {y1, y2, y3,...,ym}, where m is the
number of outputs.
❑ STATES - It is a finite set, denoted by Q whose definition depends on the type of
automaton.
AUTOMATA TERMINOLOGIES
These are some basic terminology used in Automata Theory.
➢ Alphabets
A finite, non-empty set of symbols is known as Alphabet. It is denoted by Greek letter ∑.
This is the set over which the strings are defined. These are some examples of alphabets.
❖ Examples of Alphabets
∑ = {a,b,c,d}
∑ = {A,B,C} // It is an alphabet
∑ = {0,1,2,3} // It is an alphabet of digits
∑ = {0,1,a,b,c,d} // It is an alphabet of digits
2
AUTOMATA THEORY AND IT’S TYPES
➢ Strings
A String over an alphabet is a finite sequence of any symbol selected from the set of alphabet
symbols. It is generally denoted by w.
An empty string is denoted by as є or λ.
❖ Examples of Strings
∑1 = {0,1}
w = 100111 // It is a string over an alphabet ∑1
∑2 = {a,b,c}
w2 = abaccab // It is a string over an alphabet ∑2
➢ Length of string
The number of symbols present in the string is known as the Length of the string. The
length of the string is denoted by |w|. For the string S = 'adadda', the length of the string is |S|
= 6.
➢ Languages
A set of valid strings over a finite alphabet. It is denoted by L. Language can be
finite or infinite.
Empty Language - The empty string contains no string, denoted by {} or ∅.
❖ Example of Language
∑ = {a,b}
Here, the language takes all the possible strings of length 2 over the set Σ = {a, b}.
➢ Kleene Closure
The set ∑+ is the infinite set of all possible strings of all possible length over Σ.
It is generated by concatenating arbitrary elements of a set of strings. It is also
called Positive Closure or Kleene Star.
3
AUTOMATA THEORY AND IT’S TYPES
TYPES OF AUTOMATA
We will only discuss about the Finite Automata & it’s types.
FINITE AUTOMATA
Finite Automata (FA) is the simplest machine to recognize
patterns. It is used to characterize a Regular Language.
For example: /baa+!/.
Also it is used to analyze and recognize Natural language
Expressions.
The finite automata or finite state machine is an abstract
machine that has five elements or tuples. It has a set of
states and rules for moving from one state to another but it
depends upon the applied input symbol. Based on the states
and the set of rules the input string can be either accepted
or rejected. Basically, it is an abstract model of a digital
computer which reads an input string and changes its
internal state depending on the current input symbol. Every
automaton defines a language i.e. set of strings it accepts. The figure shows some essential
features of general automation.
4
AUTOMATA THEORY AND IT’S TYPES
Q, ∑, δ, q0, F
q0 q1 q0
q1 q1 q2
q2 q1 q1
5
AUTOMATA THEORY AND IT’S TYPES
➢ Parts of DFA
A Deterministic Finite Automata has three parts-
❖ A tape to hold the input string.
❖ A tape head to read the input symbols.
❖ A control that contains three main parts – set of start states, set of transition
functions and final states.
Q, ∑, δ, q0, F
6
AUTOMATA THEORY AND IT’S TYPES
0 1
→ q0 q1 q0
q1 q1 q2
*q2 q2 q2
7
AUTOMATA THEORY AND IT’S TYPES
➢ Features of NFA
❖ NFA can perform parallel computation, multiple processes can be running
concurrently.
❖ It can permit null or empty (ε) string transition.
❖ In NFA, a state may have zero, one or many exciting arrows for each alphabet
symbol. It has a choice of where to move to the next state.
❖ We can easily convert every NFA into an equivalent DFA.
❖ It is easy to understand and functionality may be easier than a DFA.
(Q, ∑, δ, q0, F)
8
AUTOMATA THEORY AND IT’S TYPES
0 1 ε
q0 {q0} {q0,q1} ∅
q2 {q3} {q3} ∅
q3 ∅ ∅ ∅
➢ Implementation Of NFA
There are many ways to implement a NFA:
❖ Convert to the equivalent DFA. In some case’s this may cause exponential blowup in
the number of states.
❖ Keep a set data structure of all states which the NFA might currently be in. On the
consumption of an input symbol, unite the results of the transition function applied to
all current states to get the set of next states; if ε-moves are allowed, include all states
reachable by such a move (ε-closure). Each step requires at most s2 computations,
where s is the number of states of the NFA. On the consumption of the last input
symbol, if one of the current states is a final state, the machine accepts the string. A
string of length n can be processed in time O(ns2) and space O(s).
❖ Create multiple copies. For each n way decision, the NFA creates up to n−1 copies of
the machine. Each will enter a separate state. If, upon consuming the last input
9
AUTOMATA THEORY AND IT’S TYPES
symbol, at least one copy of the NFA is in the accepting state, the NFA will accept.
(This, too, requires linear storage with respect to the number of NFA states, as there
can be one machine for every NFA state.)
❖ Explicitly propagate tokens through the transition structure of the NFA and match
whenever a token reaches the final state. This is sometimes useful when the NFA
should encode additional context about the events that triggered the transition. (For an
implementation that uses this technique to keep track of object references have a look
at Trace matches)
10