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

Toc 1

Uploaded by

gebode6537
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views

Toc 1

Uploaded by

gebode6537
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Theory of Computation or Automata

theory

• 'Theory of Computation' is a study of abstract


Theory of Automata & Formal concepts.
Languages – But these abstract concepts are really very
important for better understanding of the field of
Computing, as most of the concepts we deal with
Lecture-1 have lot of abstract and logical under pinning's.
• TOC teaches you about the elementary ways in
which a computer/machine can be made to
think.

Theory of Computation or Automata theory


Theory of Computation or Automata
theory • Theory of Computation is the core area of computer
science that attempts to achieve deep understanding
of computational processes by means of mathematical
• Automata theory is the study of abstract
models, tools, and techniques.
machines and automata, as well as the
computational problems that can be solved
using them. • This understanding is important for its applications
that include algorithm, compiler and VLSI design
• Automaton: A machine which performs a range
of functions according to a predetermined set
of coded instructions.

Theory of Computation or Automata


theory The Chomsky Hierachy
• A containment hierarchy of classes of formal languages
• Some concepts are just universal and you will
encounter them again and again in other courses.
– E.g. finite state machines, you need to know them when you
are learning string matching algorithms, and compilers.
Regular Context-
(DFA) Context- Recursively-
free
• Another example, you will learn some reduction sensitive enumerable
(PDA)
algorithms (transforming from one model to another (LBA)
(TM)
model) in computation theory, these things teach you
how to think abstractly and algorithmically.

6
Theory of Computation or Automata
Some devices we will see
theory
finite automata Devices with a finite amount of memory. • In addition to the usefulness of various tools (regular
Used to model “small” computers. expressions, context free grammars, state machines
etc.) in your daily life as a programmer,
push-down Devices with infinite memory that can be
– a good theoretical computer science course will have taught
automata accessed in a restricted way. you how to model certain problems in a way that you can tackle
Used to model parsers, etc. effectively.
• For example, you may be tempted to parse some
Turing Machines Devices with infinite memory. programming language as input to your program with
Used to model any computer. Regular Expressions.
– CS Theory proves why this is a bad idea (most programming
time-bounded Infinite memory, but bounded running time. language syntaxes are not Regular), and can never be
Turing Machines overcome no matter how much you'd like to try.
Used to model any computer program that
runs in a “reasonable” amount of time.

Theory of Computation or Automata theory Theory of Computation or Automata theory

• In theoretical computer science and formal language • Computer language syntax is generally
theory, a regular expression (sometimes called a
rational expression) is a sequence of characters that distinguished into three levels:
define a search pattern, – Words – the lexical level, determining how
– mainly for use in pattern matching with strings, or string matching, characters form tokens;
i.e. "find and replace"-like operations.

– Phrases – the grammar level, narrowly speaking,


• In computer science, the syntax of a computer determining how tokens form phrases;
language is the set of rules that defines the
combinations of symbols that are considered to be a – Context – determining what objects or variables
correctly structured document or fragment in that names refer to, if types are valid, etc.
language.

Theory of Computation or Automata theory Theory of Computation or Automata theory


• Distinguishing in this way yields modularity, allowing • The levels generally correspond to levels in the
each level to be described and processed separately, Chomsky hierarchy.
and often independently.
– First a lexer turns the linear sequence of characters into a
linear sequence of tokens; this is known as "lexical analysis" or • Words are in a regular language, specified in the
"lexing". lexical grammar, which is a Type-3 grammar, generally
– Second the parser turns the linear sequence of tokens into a given as regular expressions.
hierarchical syntax tree; this is known as "parsing" narrowly
speaking.
– Thirdly the contextual analysis resolves names and checks • Phrases are in a context-free language (CFL), generally
types. This modularity is sometimes possible, but in many real-
a deterministic context-free language (DCFL),
world languages an earlier step depends on a later step –
specified in a phrase structure grammar, which is a
• for example, the lexer hack in C is because tokenization
depends on context. Even in these cases, syntactical Type-2 grammar, generally given as production rules in
analysis is often seen as approximating this ideal model. Backus–Naur Form (BNF).
Theory of Computation or Automata theory
Theory of Computation or Automata
• Phrase grammars are often specified in much more
constrained grammars than full context-free grammars, in
theory
order to make them easier to parse;
• While the LR (bottom up) parser can parse any DCFL in linear • Before spending a lot of time on a problem
time, the simple LALR (look ahead LR, canonical parser) parser you'll want to know:
and even simpler LL (top down parser) parser are more
– If the problem can't be solved.
efficient, but can only parse grammars whose production rules
are constrained. – If there is a "good" (polynomial) solution, as some
• Contextual structure can in principle be described by a
problems may don't have good" solutions (or at
context-sensitive grammar, and automatically analysed by least, not ones we currently know of ;))
means such as attribute grammars, – (A bit less practical) you'll want to know if a
– though in general this step is done manually, via name resolution rules and problem is "harder" than other, that is, takes more
type checking, and implemented via a symbol table which stores names
and types for each scope. time/space.

Theory of Computation or Automata Theory of Computation or Automata


theory theory
• Processing that involved building Finite State machines 1. Computer
also known as Finite State Automata. - It is nothing but Turing Machine with limited memory.

2. Programming Languages/ Compilers


• Regular expressions can be beautifully represented
using Non-deterministic Finite Automata. - Finite Automata / Regular Language (for scanning-look at all parts of
(something) carefully in order to detect some feature.)
- Push Down Automata/ Context Free Language (for parsing-resolve (a
• Any algorithm can be expressed in the form of a finite sentence) into its component parts and describe their syntactic roles)
state machine and can serve as a really helpful visual • Apart from this, Theory of Computation is the base for Complexity Theory
representation of the same. Sometimes, the finite which discuss what computer can do , How much efficient etc.
state machines are easier to understand thus helping • A computer science engineer generally come across lot many NP Hard
the cause furthermore. problems.
• So knowing that whether a problem is efficiently solvable or not is also an
practical application derived from Theory of Computation.

What is automata theory Purpose and motivation

• Automata theory is the study of abstract computational • What are the mathematical properties of computer hardware
devices and software?
• What is a computation and what is an algorithm? Can we give
• Abstract devices are (simplified) models of real rigorous mathematical definitions of these notions?
computations
• What are the limitations of computers? Can “everything” be
• Computations happen everywhere: On your laptop, computed? (As we will see, the answer to this question is
on your cell phone, in nature, … “no”.)

• Purpose of the Theory of Computation: Develop formal


mathematical models of computation that reflect real-world
computers.
Purpose and motivation

• Nowadays, the Theory of Computation can be divided into the What is Automata Theory?
following three areas: Complexity Theory, Computability
Theory, and Automata Theory.  Study of abstract computing devices, or
• Complexity theory: Classify problems according to their “machines”
degree of “difficulty”. Give a rigorous proof that problems that  Automaton = an abstract computing device
seem to be “hard” are really “hard”.  Note: A “device” need not even be a physical
• Computability Theory: Classify problems as being solvable or hardware!
unsolvable.  A fundamental question in computer science:
• Automata Theory: Do these models have the same power, or  Find out what different models of machines can do
and cannot do
can one model solve more problems than the other?
 The theory of computation

20

Model of Computation

Model of Computation Computation

CPU memory

21 22

Model of Computation Model of Computation


3
memory memory Example: f ( x)  x

input input
CPU CPU
output output
Program
Program compute xx
compute x2  x
23 24
memory f ( x)  x3
Model of Computation
z  2*2  4
3
f ( x)  x f ( x)  z * 2  8
memory
input input
x2 x2
CPU CPU
output output
Program Program

compute xx compute xx


compute x2  x compute x2  x
25 26

memory f ( x)  x3 Automaton
z  2*2  4
memory
f ( x)  z * 2  8
input
Automaton
x2 input
CPU CPU
f ( x)  8 output
Program output
compute xx Program

compute x2  x
27 28

Automaton
memory need abstract
Automaton
input
models?
Why do we need abstract
output models?
transition

state

29 30
A design problem Preliminaries of automata theory
• Can you design a circuit where the light is on if and • How do we formalize the question
only if all the switches were flipped exactly the same
number of times ? Can device A solve problem B?
• Such devices are difficult to reason about, because
they can be designed in an infinite number of ways • First, we need a formal way of describing the
• By representing them as abstract computational problems that we are interested in solving
devices, or automata, we will learn how to answer
such questions

A simple computer A simple “computer”

BATTERY BATTERY start off on

Can you define this process


input: switch input: switch by giving a language ?
output: light bulb output: light bulb
actions: flip switch actions: f for “flip switch”
bulb is on if and only if
states: on, off states: on, off there was an odd number
of flips

Another “computer” A design problem


1
1 4
1 start off off
1
5
2 2 2 2
BATTERY BATTERY

1
2 2
off on
1 3

inputs: switches 1 and 2


actions: 1 for “flip switch 1” bulb is on if and only if
both switches were flipped Can you design a circuit where the light is on if and only
actions: 2 for “flip switch 2” if all the switches were flipped exactly the same number
an odd number of times
states: on, off of times?
Problems Alphabets and strings
• Examples of problems we will consider • A common way to talk about words, number, pairs of
– Given a word s, does it contain the subword “pool”? words, etc. is by representing them as strings
– Given a number n, is it divisible by 7? • To define strings, we start with an alphabet
– Given a pair of words s and t, are they the same?
– Given an expression with brackets, e.g. (()()), does every An alphabet is a finite set of symbols.
left bracket match with a subsequent right bracket?
• Examples
• All of these have “yes/no” answers.
1 = {a, b, c, d, …, z}: the set of letters in English
• There are other types of problems, that ask “Find 2 = {0, 1, …, 9}: the set of (base 10) digits
this” or “How many of that” but we won’t look at 3 = {a, b, …, z, #}: the set of letters plus the
those. special symbol #
4 = {(, )}: the set of open and closed brackets

Alphabets and Strings


An alphabet is a set of symbols
Alphabet
Example Alphabet:   a, b
An alphabet is a finite, non-empty set of
A string is a sequence of symbols
 We use the symbol ∑ (sigma) to denote an
symbols from the alphabet alphabet
a  Examples:
Example Strings u  ab Binary: ∑ = {0,1}
ab

All lower case letters: ∑ = {a,b,c,..z}


v  bbbaaa

abba  Alphanumeric: ∑ = {a-z, A-Z, 0-9}


w  abba  DNA molecule letters: ∑ = {a,c,g,t}
aaabbbaabab  …

39 40

Strings

A string over alphabet  is a finite sequence Strings


of symbols in .
A string or word is a finite sequence of symbols
chosen from ∑
• The empty string will be denoted by   Empty string is  (or “epsilon”)

• Examples
 Length of a string w, denoted by “|w|”, is
abfbz is a string over 1 = {a, b, c, d, …, z} equal to the number of (non- ) characters in the
9021 is a string over 2 = {0, 1, …, 9} string
E.g., x = 010100 |x| = 6
ab#bc is a string over 3 = {a, b, …, z, #}

 x = 01  0  1  00  |x| = ?
))()(() is a string over 4 = {(, )}
 xy = concatentation of two strings x and y
42
The * Operation
 * : the set of all possible strings from
Powers of an alphabet alphabet 
Let ∑ be an alphabet.

  a, b
 ∑k = the set of all strings of length k

*   , a, b, aa, ab, ba, bb, aaa, aab, 


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

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

43 44

Star-Closure (Kleene *) The + Operation


All strings that can be constructed from L   : the set of all possible strings from
alphabet  except 

Definition: 0 1 2
L*  L  L  L 
  a, b
Example:
 ,  *   , a, b, aa, ab, ba, bb, aaa, aab, 
a, bb, 
 
a,bb*  
aa, abb, bba, bbbb,


    * 
aaa, aabb, abba, abbbb,    a, b, aa, ab, ba, bb, aaa, aab,
45 46

Positive Closure Languages


A language over alphabet 
Definition: L  L  L 
 1 2
is any subset of  *
Examples:
Same with L* but without the    a, b
*   , a, b, aa, ab, ba, bb, aaa, 
a, bb,  Language:  
  
a, bb  aa, abb, bba, bbbb,  Language: a, aa, aab
aaa, aabb, abba, abbbb, Language: { , abba, baba, aa, ab, aaaaaa}
 
47 48
Languages Language: a set of strings

A language is a set of strings over an alphabet.


String: a sequence of symbols
• Languages can be used to describe problems with
from some alphabet
“yes/no” answers, for example:
L1 = The set of all strings over 1 that contain
the substring “fool” Example:
L2 = The set of all strings over 2 that are divisible by 7 Strings: cat, dog, house
= {7, 14, 21, …}
L3 = The set of all strings of the form s#s where s is any Language: {cat, dog, house}
string over {a, b, …, z}
Alphabet:   a, b, c,, z
L4 = The set of all strings over 4 where every ( can be
matched with a subsequent )
50

Languages Languages & Grammars


L is a said to be a language over alphabet ∑, only if L  ∑*  Languages: “A language is a
 this is because ∑* is the set of all strings (of all possible Or “words” collection of sentences of
length including 0) over the given alphabet ∑ finite length all constructed
Examples: from a finite alphabet of
symbols”
1. Let L be the language of all strings consisting of n 0’s
followed by n 1’s:  Grammars: “A grammar can
1. L = {,01,0011,000111,…} be regarded as a device that
enumerates the sentences of
2. Let L be the language of all strings of with equal number of a language” - nothing more,
0’s and 1’s: nothing less
L = {,01,10,0011,1100,0101,1010,1001,…}
Canonical ordering of strings in the language  N. Chomsky, Information
and Control, Vol 2, 1959
Definition: Ø denotes the Empty language
 Let L = {}; Is L=Ø? NO
51 52

Introduction Introduction
What are formal languages What are formal languages

 In the study of formal languages we care about only the  a language designed for use in situations in which natural
well-formedness/membership, but not the meaning of language is unsuitable, as for example in mathematics, logic,
sentences in a language. or computer programming. The symbols and formulas of
Ex1: Our usual decimal language of positive numbers ? such languages stand in precisely specified syntactic and
semantic relations to one another.
Problem: Which of the following are well-formed
[representation of] numbers:
(1) 128 (2) 0023 (3) 44ac (4) 3327  any language of symbols and formulas developed for systems
Let L be the set of all well-formed [representations of ] which cannot work with natural language, such as computer
numbers. ==> 123, 3327 in L but 0023, 44ac not in L. programming and mathematics.
So according to the view of FL, The usual decimal language
of positive numbers (i.e., L) is just the set :
{ x | x is a finite sequence of digits w/t leading zeros }.
Note: FL don't care about that string '134' corresponds to the (abstract)
positive number whose binary representation is 10000000 –It’s the job
of semantics.
53 54
Transparency No. 1-53 Transparency No. 1-54
Introduction
Definition 2.1

 An alphabet  (or vocabulary) is a finite set.


The Membership Problem Ex: decimal_alphabet = {0,1,2,3,4,5,6,7,8,9}
binary_digit = {0,1}; Hexidecimal-alphabet = {0,..,9,A,..,F}
alphabet-of-English-sentences = {a, word, good, luckily,...}
Given a string w ∑*and a language L alphabet-of-English-words = {a,...,z,A,...,Z}
over ∑, decide whether or not w L.  Elements of an alphabet are called letters or symbols
 A string (or word or sentence) over  is a finite sequence of
elements of .
Example: Ex: if  = {a,b} then 'aabaa' is a string over  of length 5.
Note: A string x = x0 x1 … xn-1 of length n is in fact viewed as a function
Let w = 100011 x: [0..n)   such that x(k) = xk for k in [0,n).
 The length of a string x, denoted |x|, is the number of symbols
Q) Is w  the language of strings with in x. ex: |abbaa| = 5.
equal number of 0s and 1s? OR starts  there is a unique string of length 0, called the null string or
and ends with 1…….or…. empty string, and is denoted by  (or )
56
55
Transparency No. 1-56

Introduction Introduction
Definition 2.1 (cont'd) Examples of practical formal languages

 * =def the set of all strings over . Ex: Let  be the set of all ASCII codes.
a C program is simply a finite string over  satisfying all
Ex: {a,b}* = {,a,b,aa,ab,ba,bb,aaa,...}
syntax rules of C.
{a}* = {,a,aa,aaa,aaaa,...} = {an | n  0}.
C-language =def { x | x is a well-formed C program over  }.
{}* = ? ( {} or {} or  ?)
PASCAL-language = {x | x is a well-formed PASCAL
 Note the difference b/t sets and strings: program over  }.
{a,b} = {b,a} but ab  ba. Similarly, let ENG-dict = The set of all English lexicons
{a,a,b} = {a,b} but aab  ab
= { John, Mary, is, are, a, an, good, bad, boy, girl,..}
 So what's a (formal) language ? an English sentence is simply a string over ENG-DIC
 A language over  is a set of strings over  (i.e., a ==> English =def {x | x is a legal English sentence over ENG
subset of *). Ex: let  = {0,...,9} then all the followings dict} ==>
are languages over . 1.John is a good boy .  English.
1. {} 2. {} 3. {0,...,9} =  4. {x | x  * and has no leading 2. |John is a good boy . | = ?
0s} 5. 5 = {x | |x| = 5} 6. * = {x | |x| is finite }
57 58
Transparency No. 1-57 Transparency No. 1-58

Introduction Introduction
issues about formal languages How to specify a language
 Why need formal languages? principles: 1. must be precise and no ambiguity among
for specification (specifying programs, etc.) users of the language: 2. efficient for machine processing
i.e., basic tools for communications b/t people and tools:
machines. 1. traditional mathematical notations:
although FL does not provide all needed theoretical  A = {x | |x| < 3 and x  {a,b}} = {e,a,b,aa,ab,ba,bb}
framework for subsequent processing, it indeed provides a  problem: in general not machine understandable.
necessary start, w/t which subsequent processing would 2. via programs (or machines) :
be impossible -- first level of abstraction. P: a program; L(P) =def {x | P return 'ok' on input string x}
 precise, no ambiguity, machine understandable.
Many basic problems [about computation] can be
 hard to understand for human users !!
investigated at this level.
3. via grammars: (easy for human to understand)
 How to specify(or represent) a language ? Ex: noun := book | boy | jirl | John | Mary
Notes: All useful natural and programming languages  art := a | an | the ; prep := on | under | of | ...
contains infinite number of strings (or programs and  adj := good | bad | smart | ...
sentences)  NP := noun | art noun | NP PP | ...
 PP := prep NP ==> 'the man on the bridge'  PP.
59 60
Transparency No. 1-59 Transparency No. 1-60
Languages are used to describe
computation problems:
Decimal numbers alphabet   { 0,1,2, ,9}
PRIMES  {2,3,5,7,11,13,17, }
102345 567463386
EVEN  { 0,2,4,6, }
Binary numbers alphabet   { 0,1}
Alphabet:   { 0,1,2, ,9} 100010001 101101111

61 62

String Operations
Unary numbers alphabet   {1}
w  a1a2  an abba
v  b1b2 bm bbbaaa
Unary number: 1 11 111 1111 11111
Decimal number: 1 2 3 4 5
Concatenation

wv  a1a2  anb1b2 bm abbabbbaaa

63 64

String Length
w  a1a2  an
w  a1a2  an ababaaabbb
Length: w n

Reverse Examples: abba  4


w R  an  a2 a1 bbbaaababa aa  2
a 1
65 66
Length of Concatenation Empty String

uv  u  v
A string with no letters is denoted:  or 

Example: u  aab, u  3 Observations:   0


v  abaab, v  5
w  w   w

uv  aababaab  8 abba  abba  abba  abba


uv  u  v  3  5  8
67 68

Substring Prefix and Suffix


Substring of string: abbab
a subsequence of consecutive characters Prefixes Suffixes
 abbab w  uv
String Substring
a bbab
abbab ab prefix
ab bab
suffix
abbab abba ab
abb
abbab b b
abba
abbab bbab 
abbab
69 70

Another Operation More Language Examples


wn  
ww

w Alphabet   {a , b }
n
An infinite language L  {a n b n : n  0}
Example: abba 2  abbaabba

Definition: w0   ab
L abb  L
aabb
abba 0   aaaaabbbbb
71 72
Prime numbers Even and odd numbers

Alphabet   { 0,1,2, ,9} Alphabet   { 0,1,2, ,9}


Language:
EVEN  {x : x   * and x is even}
PRIMES  {x : x   * and x is prime} EVEN  { 0,2,4,6, }

PRIMES  {2,3,5,7,11,13,17, } ODD  {x : x   * and x is odd}


ODD  {1,3,5,7, }
73 74

Unary Addition Squares

Alphabet:   {1,, } Alphabet:   {1, # }


Language: Language:

ADDITION  {x  y  z : x  1n , y  1m , z  1k , SQUARES  {x # y : x  1n , y  1m , m  n 2 }
nm k}

11  111  11111  ADDITION 11#1111  SQUARES


111  111  111  ADDITION 111#1111  SQUARES
75 76

Note that: Operations on Languages


The usual set operations
Sets   { }  {} a, ab, aaaa  bb, ab  {a, ab, bb, aaaa}
a, ab, aaaa  bb, ab  {ab}
Set size {}    0 a, ab, aaaa  bb, ab  a, aaaa
Set size {}  1 Complement: L   * L

String length  0 a, ba   , b, aa, ab, bb, aaa,


77 78
Reverse Concatenation

Definition: LR  {w R : w  L} Definition: L1L2  xy : x  L1, y  L2 

Examples: ab, aab, babaR  ba, baa, abab

L  {a nb n : n  0} Example: a, ab, bab, aa

 ab, aaa, abb, abaa, bab, baaa


LR  {b n a n : n  0}
79 80

Another Operation
Definition: Ln   
LL L
n L  {a nb n : n  0}
a, b3  a, ba, ba, b 
aaa, aab, aba, abb, baa, bab, bba, bbb L'  {a nb n a mb m : n, m  0}
Special case: L0  
aabbaaabbb  L'
a , bba , aaa 0  
81 82

Some highlights of the course Some highlights of the course


• Finite automata • Turing Machines
– We will understand what kinds of things a device with finite – This is a general model of a computer, capturing anything
memory can do, and what it cannot do we could ever hope to compute
– Introduce simulation: the ability of one device to “imitate” – Surprisingly, there are many things that we cannot compute,
another device for example:
– Introduce non-determinism: the ability of a device to make
Write a program that, given the code of another
arbitrary choices
program in C, tells if this program ever outputs
• Push-down automata the word “hello”
– These devices are related to grammars, which describe the
structure of programming (and natural) languages – It seems that you should be able to tell just by looking at
the program, but it is impossible to do!
Some highlights of the course (A pioneer of automata theory)

• Time-bounded Turing Machines Alan Turing (1912-1954)


– Many problems are possible to solve on a computer in
principle, but take too much time in practice  Father of Modern Computer
Science
– Traveling salesman: Given a list of cities, find the shortest  English mathematician
way to visit them and come back home
 Studied abstract machines called
Beijing
Turing machines even before
Xian computers existed
Chengdu Shanghai
Guangzhou
Hong Kong

– Easy in principle: Try the cities in every possible order


– Hard in practice: For 100 cities, this would take 100+ years
even on the fastest computer!
86

Theory of Computation: A
Historical Perspective The Chomsky Hierachy
• A containment hierarchy of classes of formal languages
1930s • Alan Turing studies Turing machines
• Decidability
• Halting problem
1940-1950s • “Finite automata” machines studied Regular Context-
• Noam Chomsky proposes the (DFA) Context- Recursively-
free
“Chomsky Hierarchy” for formal sensitive enumerable
(PDA)
languages (LBA) (TM)
1969 Cook introduces “intractable” problems
or “NP-Hard” problems
1970- Modern computer science: compilers,
computational & complexity theory evolve
87 88

Some devices we will see Different kinds of automata


finite automata Devices with a finite amount of memory. • This was only one example of a computational device,
Used to model “small” computers.
and there are others
push-down Devices with infinite memory that can be • We will look at different devices, and look at the
automata accessed in a restricted way.
following questions:
Used to model parsers, etc. – What can a given type of device compute, and what are its
Turing Machines Devices with infinite memory. limitations?
– Is one type of device more powerful than another?
Used to model any computer.

time-bounded Infinite memory, but bounded running time.


Turing Machines Used to model any computer program that
runs in a “reasonable” amount of time.
Different Kinds of Automata Finite Automaton
Automata are distinguished by the temporary memory
temporary memory

• Finite Automata: no temporary memory

input
Finite
• Pushdown Automata: stack Automaton
output
• Turing Machines: random access memory

Example: Elevators, Vending Machines


(small computing power)
91 92

Pushdown Automaton Turing Machine


Temp.
memory Stack Push, Pop
Temp.
memory Random Access Memory

Pushdown input input


Turing
Automaton Machine
output output

Example: Compilers for Programming Languages Examples: Any Algorithm


(medium computing power) (highest computing power)
93 94

Power of Automata
Turing Machine is the most powerful
Simple More complex Hardest computational model known
problems problems problems

Finite Pushdown Turing Question: Are there computational


Automata Automata Machine problems that a Turing Machine
cannot solve?

Less power More power


Answer: Yes (unsolvable problems)
Solve more
computational problems
95 96
Time Complexity of Computational Problems:

NP-complete problems
Believed to take exponential Next Lecture
Lecture-2.ppt
time to be solved

P problems
Solved in polynomial time

97 98

You might also like