CS100: Theory of Computation
Fall 2010 Instructor: James MacGlashan
CS100: Theory of Computation Fall 2010 Instructor: James - - PowerPoint PPT Presentation
CS100: Theory of Computation Fall 2010 Instructor: James MacGlashan What is a function? A function is a mapping from inputs to outputs Takes a set of inputs or parameters Produces a single or set of outputs Output is generally
Fall 2010 Instructor: James MacGlashan
2
3
4
A B C 1 1 1 1 1
5
algorithms
“solve” it
6
head movement
7
8
Control Unit
Read/Write Head
9
10
Current State Current Cell Write Value Move Direction Next State START * * LEFT ADD ADD 1 RIGHT RETURN ADD 1 LEFT CARRY ADD * * RIGHT HALT CARRY 1 RIGHT RETURN CARRY 1 LEFT CARRY CARRY * 1 LEFT OVERFLOW OVERFLOW (any) * RIGHT RETURN RETURN RIGHT RETURN RETURN 1 1 RIGHT RETURN RETURN * * NO MOVE HALT
11
12
in terms of non-negative integers
13
. . . end;
14
15
16
17
18
19
20
21
program code text and string them together into a single binary value
usually many many bytes long in text
‘w’ = 01110111 ‘h’ = 01101000
22
can’t: the self-terminating input case
23
program’s encoding, program oracle returns a value 1 if it halts, 0 otherwise
24
Oracle
x = 0: P is self-terminating x = 1: P is NOT self-terminating
25
Oracle
26
Oracle
Oracle
it’s self encoding as input (self-terminating input)?
27
Oracle
Oracle
28
Oracle
Oracle
29
Oracle
Oracle
30
steps regardless of input size
logarithmic growth in terms of the size of input
31
32
increase until its feasible
problem
33
at a different point in space (geography)
city and must visit each city exactly once and return home
must find a path that is cheap enough
34
H H
executor
computers
practice appear random to us
differently
35
36
37
38
39
NP-Hard
NP-complete problem, then all NP-Complete problems can be solved in Polynomial time
have no proof
you’ll have changed everything!
40