0% found this document useful (0 votes)
173 views18 pages

Formal Language and Automata Theory

The document provides an introduction to automata theory and its central concepts. It defines an automaton as an abstract computing device that can transform, transmit, and use energy, materials, and information without direct human participation. Automata theory studies such abstract machines and examines what tasks they can and cannot perform. The document outlines some of the pioneers of the field, such as Alan Turing, and discusses concepts like alphabets, strings, languages, and finite automata. It provides examples of how finite automata can model systems and recognize patterns.

Uploaded by

Ayan Dutta
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)
173 views18 pages

Formal Language and Automata Theory

The document provides an introduction to automata theory and its central concepts. It defines an automaton as an abstract computing device that can transform, transmit, and use energy, materials, and information without direct human participation. Automata theory studies such abstract machines and examines what tasks they can and cannot perform. The document outlines some of the pioneers of the field, such as Alan Turing, and discusses concepts like alphabets, strings, languages, and finite automata. It provides examples of how finite automata can model systems and recognize patterns.

Uploaded by

Ayan Dutta
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/ 18

FORMAL LANGUAGE

AND
AUTOMATA THEORY
MS. SUPARNA KARMAKAR
ASST. PROF.
DEPT OF IT
GNIT
INTRODUCTION TO
AUTOMATA THEORY

2
What is Automata Theory?

■ Study of abstract computing devices, or “machines”


■ Automaton = an abstract computing device
– Note: A “device” need not even be a physical hardware!
■ A fundamental question in computer science:
– Find out what different models of machines can do and cannot do
– The theory of computation
■ Computability vs. Complexity

3
(A pioneer of automata theory)
Alan Turing (1912-1954)

■ Father of Modern Computer


Science
■ English mathematician
■ Studied abstract machines called
Turing machines even before
computers existed
■ Heard of the Turing test?

4
Theory of Computation: A Historical
Perspective
1930s • Alan Turing studies Turing machines
• Decidability
• Halting problem

1940-1950s • “Finite automata” machines studied


• Noam Chomsky proposes the
“Chomsky Hierarchy” for formal
languages

1969 Cook introduces “intractable” problems


or “NP-Hard” problems

1970- Modern computer science: compilers,


computational & complexity theory evolve
5
THE CENTRAL
CONCEPTS OF
AUTOMATA THEORY

6
DEFINITION

Automaton (plural Automata):

An automaton is defined as a system where energy, materials, and


information are transformed, transmitted, and used for performing some
functions without direct participation of man. For example - Automatic
machine tool, Automatic packing machine etc. In computer science to
model the hardware of a computer, we need to introduce the notion of an
automaton (plural Automata). Basically it is the study of abstract
computing device.
In computer science the term ‘automaton’ means ‘discrete automaton’ and is defined in a more abstract way as
shown in figure 1.1.

The characteristics of automaton are now described as follows:

INPUT: At each of the discrete instant of time t1, t2,……,tn the input values I1, I2,……,Ip, each of which can
take a finite number of fixed values from the input alphabet ∑, are applied to the input side of the model shown in
fig 1.1.

OUTPUT: O1,O2,……, Oq are the output of the model each of which can take a finite number of fixed values
from an output O.

STATES: At any instant of time the automaton can be in one of the states q1, q2, q3,…, qn

STATE RELATION: The next state of an automaton at any instant of time is determined by the present state and
the present input.

OUTPUT RELATION: The output is related to either state only or to both present state and the present input.
Alphabet

An alphabet is a finite, non-empty set of symbols


■ We use the symbol ∑ (sigma) to denote an alphabet
■ Examples:
– Binary: ∑ = {0,1}
– All lower case letters: ∑ = {a,b,c,..z}
– Alphanumeric: ∑ = {a-z, A-Z, 0-9}
– DNA molecule letters: ∑ = {a,c,g,t}
– …

10
Strings

A string or word is a finite sequence of symbols chosen from ∑


■ Empty string is  (or “epsilon”)

■ Length of a string w, denoted by “|w|”, is equal to the number of


(non- ) characters in the string
– E.g., x = 010100 |x| = 6
– x = 01  0  1  00  |x| = ?

– xy = concatentation of two strings x and y

11
Powers of an alphabet

Let ∑ be an alphabet.

– ∑k = the set of all strings of length k

– ∑* = ∑0 U ∑1 U ∑2 U …

– ∑+ = ∑ 1 U ∑2 U ∑3 U …

12
Related Concept:
❑ KEEN CLOSURE OR KLEEN STAR : The Kleene star, Σ*, is a unary operator on a set of symbols or
strings, Σ, that gives the infinite set of all possible strings of all possible lengths over Σ including λ.

i.e. Σ* = Σ0 U Σ1 U Σ2 U……. where Σp is the set of all possible strings of length p.

Example: If Σ = {a, b}, Σ*= {λ, a, b, aa, ab, ba, bb,………..}

❑ POSITIVE CLOSURE:

The set Σ+ is the infinite set of all possible strings of all possible lengths over Σ excluding λ.

Representation: Σ+ = Σ* − { λ}

Example: If Σ = { a, b } , Σ+ ={ a, b, aa, ab, ba, bb,………..}


Languages
L is a said to be a language over alphabet ∑, only if L  ∑*
➔ this is because ∑* is the set of all strings (of all possible length including 0) over the
given alphabet ∑
Examples:
1. Let L be the language of all strings consisting of n 0’s followed by n 1’s:
L = {, 01, 0011, 000111,…}
2. Let L be the language of all strings of with equal number of 0’s and 1’s:
L = {, 01, 10, 0011, 1100, 0101, 1010, 1001,…}
3. If the language takes all possible strings of length 2 over Σ = {a, b}, then L = { ab, bb, ba, bb}

Definition: Ø denotes the Empty language


■ Let L = {}; Is L=Ø?
14
The Membership Problem

Given a string w ∑*and a language L over ∑, decide whether or not w L.

Example:
Let w = 100011
Q) Is w  the language of strings with equal number of 0s and 1s?

15
Finite Automata

■ Some Applications
– Software for designing and checking the behavior of digital
circuits
– Lexical analyzer of a typical compiler
– Software for scanning large bodies of text (e.g., web pages) for
pattern finding
– Software for verifying systems of all types that have a finite
number of states (e.g., stock market transaction,
communication/network protocol)

16
Finite Automata : Examples
action

■ On/Off switch state

■ Modeling recognition of the word “then”

Start state Transition Intermediate Final state


state

17
Structural expressions

■ Grammars
■ Regular expressions
– E.g., unix style to capture city names such as “Palo Alto CA”:
■ [A-Z][a-z]*([ ][A-Z][a-z]*)*[ ][A-Z][A-Z]

Start with a letter


A string of other
letters (possibly Should end w/ 2-letter state code
empty)

Other space delimited words


(part of city name) 18

You might also like