theory of computation
TRANSCRIPT
Courtesy: Costas Busch / Jeff Ullman 1
CS-208Theory of Computation
Slides have been modified by Shaukat Wasi – CS@DSU
Human• A machine that
– recognizes one/multiple languages
– performs useful work when given instructions in the recognized language (s)
– has a capability of processing the instructions/input to• Solve a set of problems [NOT ALL Problems]
Courtesy: Costas Busch / Jeff Ullman 2
Human Capabilities• To judge the capabilities of humans (in
general) with respect to:– What problems can be solved by humans?
• Can’t experiments with all humans…
• We would like to develop an abstract model of humans– Processing Model (Abstract Machine) [IPO]– A set of problems
Courtesy: Costas Busch / Jeff Ullman 3
Problems solvable by Humans
• Recognition of a Language– A Problem (itself)
• Hence– Language = Problem
• Is language ‘x’ recognizable by the machine?• Is problem ‘x’ solvable by the machine?
• We (in this course) will focus mainly on this simple Problem (w.r.t Computers)
Courtesy: Costas Busch / Jeff Ullman 4
Theory of Computation• Theory of computation is the branch that
deals with how efficiently problems can be solved on a Model of Computation, using an Algorithm.
• The field is divided into three major branches: – Automata Theory and language , – Computability Theory,– Computational Complexity Theory [Efficiency],
• Which are linked by the question: "What are the fundamental capabilities and limitations of computers?" Courtesy: Costas Busch / Jeff Ullman 5
Theory of Computation - Terms• A model of computation is the
definition of the set of allowable operations used in computation and their respective costs.
• What is Algorithm????
• Automata Theory is the study of Abstract Machines and Automata [Self Acting Machine]
• Formal Language: recognized by an automaton
Courtesy: Costas Busch / Jeff Ullman 6
Courtesy: Costas Busch / Jeff Ullman 7
CPU memory
A widely accepted model of computation
Courtesy: Costas Busch / Jeff Ullman 8
CPUinput
output
Program memory
temporary memory
The different components
Courtesy: Costas Busch / Jeff Ullman 9
CPUinput
outputProgram memory
temporary memory
3)( xxf
Pseudo code for f(x) or Sequence of Steps????
Example:
Courtesy: Costas Busch / Jeff Ullman 10
CPUinput
outputProgram memory
temporary memory
3)( xxf
compute xx
compute xx 2
Example:
Courtesy: Costas Busch / Jeff Ullman 11
CPU
input
outputProgram memory
temporary memory
3)( xxf
compute xx
compute xx 2
2x
Courtesy: Costas Busch / Jeff Ullman 12
CPU
input
outputProgram memory
temporary memory 3)( xxf
compute xx
compute xx 2
2x
42*2 z82*)( zxf
Courtesy: Costas Busch / Jeff Ullman 13
CPU
input
outputProgram memory
temporary memory 3)( xxf
compute xx
compute xx 2
2x
42*2 z82*)( zxf
8)( xf
Courtesy: Costas Busch / Jeff Ullman 14
Automaton [IPO]
CPUinput
output
Program memory
temporary memory
Automaton
Courtesy: Costas Busch / Jeff Ullman 15
Automaton [Representation]
input
output
temporary memory
Automaton
statetransition
CPU + ProgramMem = States + Transitions
Courtesy: Costas Busch / Jeff Ullman 16
Different Kinds of AutomataAutomata are distinguished by the temporary memory
• Finite Automata: no temporary memory
• Pushdown Automata: stack
• Turing Machines: random access memory
Courtesy: Costas Busch / Jeff Ullman 17
Memory affects computational power:
More flexible memoryresults to
The solution of more computationalproblems
Courtesy: Costas Busch / Jeff Ullman 18
input
output
temporary memory
Finite Automaton
Finite Automaton
Example: Elevators, Vending Machines, Lexical Analyzers (small computing power)
Courtesy: Costas Busch / Jeff Ullman 19
input
output
Stack
PushdownAutomaton
Pushdown Automaton
Example: Parsers for Programming Languages (medium computing power)
Push, PopTemp.memory
Courtesy: Costas Busch / Jeff Ullman 20
input
output
Random Access Memory
TuringMachine
Turing Machine
Examples: Any Algorithm (highest known computing power)
Temp.memory
Courtesy: Costas Busch / Jeff Ullman 21
Finite Automata
PushdownAutomata
TuringMachine
Power of Automata
Less power More powerSolve more computational problems
Simple problems
More complexproblems
Hardestproblems
Courtesy: Costas Busch / Jeff Ullman 22
Turing Machine is the most powerful known computational model
Question: can Turing Machines solve all computational problems?
Answer: NO(there are unsolvable problems)
QUERIES!!!
Courtesy: Costas Busch / Jeff Ullman 23