theory of computation

23
Courtesy: Costas Busch / Jeff Ullman 1 CS-208 Theory of Computation Slides have been modified by Shaukat Wasi – CS@DSU

Upload: shiraz316

Post on 11-Apr-2017

108 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 1

CS-208Theory of Computation

Slides have been modified by Shaukat Wasi – CS@DSU

Page 2: Theory of Computation

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

Page 3: Theory of Computation

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

Page 4: Theory of Computation

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

Page 5: Theory of Computation

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

Page 6: Theory of Computation

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

Page 7: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 7

CPU memory

A widely accepted model of computation

Page 8: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 8

CPUinput

output

Program memory

temporary memory

The different components

Page 9: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 9

CPUinput

outputProgram memory

temporary memory

3)( xxf

Pseudo code for f(x) or Sequence of Steps????

Example:

Page 10: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 10

CPUinput

outputProgram memory

temporary memory

3)( xxf

compute xx

compute xx 2

Example:

Page 11: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 11

CPU

input

outputProgram memory

temporary memory

3)( xxf

compute xx

compute xx 2

2x

Page 12: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 12

CPU

input

outputProgram memory

temporary memory 3)( xxf

compute xx

compute xx 2

2x

42*2 z82*)( zxf

Page 13: Theory of Computation

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

Page 14: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 14

Automaton [IPO]

CPUinput

output

Program memory

temporary memory

Automaton

Page 15: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 15

Automaton [Representation]

input

output

temporary memory

Automaton

statetransition

CPU + ProgramMem = States + Transitions

Page 16: Theory of Computation

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

Page 17: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 17

Memory affects computational power:

More flexible memoryresults to

The solution of more computationalproblems

Page 18: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 18

input

output

temporary memory

Finite Automaton

Finite Automaton

Example: Elevators, Vending Machines, Lexical Analyzers (small computing power)

Page 19: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 19

input

output

Stack

PushdownAutomaton

Pushdown Automaton

Example: Parsers for Programming Languages (medium computing power)

Push, PopTemp.memory

Page 20: Theory of Computation

Courtesy: Costas Busch / Jeff Ullman 20

input

output

Random Access Memory

TuringMachine

Turing Machine

Examples: Any Algorithm (highest known computing power)

Temp.memory

Page 21: Theory of Computation

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

Page 22: Theory of Computation

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)

Page 23: Theory of Computation

QUERIES!!!

Courtesy: Costas Busch / Jeff Ullman 23