You are on page 1of 17

Models of Computation

01 INTRODUCTION – A2

Presented by
Krishna Das
Faculty, CSE Dept, IUBAT
Models of Computation

Computation

CPU memory

02/08/21 CSC 397 2


Models of Computation

temporary memory

input
CPU
output

Program memory

02/08/21 CSC 397 3


3
Example: f ( x)  x

temporary memory

input
CPU
output
Program memory
compute xx
2
compute x x
02/08/21 CSC 397 4
3
f ( x)  x

temporary memory
input
x2
CPU
output
Program memory
compute xx
2
compute x x
02/08/21 CSC 397 5
3
temporary memory f ( x)  x
z  2*2  4
f ( x)  z * 2  8
input
x2
CPU
output
Program memory
compute xx
2
compute x x
02/08/21 CSC 397 6
3
temporary memory f ( x)  x
z  2*2  4
f ( x)  z * 2  8
input
x2
CPU
f ( x)  8
Program memory output
compute xx
2
compute x x
02/08/21 CSC 397 7
Problem:
Show in diagram The Execution
of a Function –

like f(x) = (x3 + 2x)

in a Model of Computation

02/08/21 CSC 397 8


Automaton
temporary memory

Automaton
input
CPU
output

Program memory

02/08/21 CSC 397 9


Automaton
temporary memory

Automaton
input

output
transition

state

02/08/21 CSC 397 10


Different Kinds of Automata
Automata are distinguished by the temporary memory

• Finite Automata: no temporary memory

• Pushdown Automata: stack

• Turing Machines: random access memory

02/08/21 CSC 397 11


Finite Automaton

temporary memory

input
Finite
Automaton
output

Example: Elevators, Vending Machines


(small computing power)
02/08/21 CSC 397 12
Pushdown Automaton
Temp.
memory Stack Push, Pop

Pushdown input

Automaton
output

Example: Compilers for Programming Languages


(medium computing power)
02/08/21 CSC 397 13
Turing Machine

Temp.
memory Random Access Memory

input
Turing
Machine
output

Examples: Any Algorithm


(highest computing power)
02/08/21 CSC 397 14
Power of Automata
Simple More complex Hardest
problems problems problems

Finite Pushdown Turing


Automata Automata Machine

Less power More power


Solve more
computational problems
02/08/21 CSC 397 15
Turing Machine is the most powerful
computational model known

Question: Are there computational


problems that a Turing Machine
cannot solve?

Answer: Yes (unsolvable problems)

02/08/21 CSC 397 16


Time Complexity of Computational Problems:

NP-complete problems
Believed to take exponential
time to be solved

P problems
Solved in polynomial time

02/08/21 CSC 397 17

You might also like