Hello World! An Invitation to Computer Science
Lecture Slides
Models of Computation
Thursday May 1, 2008
Recapping the Big Picture
- phrasing problems in way that computers can solve
- fundamental elements of algorithmic problem solving
- key concepts:
- algorithms
- bits
- Boolean expressions and circuits (hardware realization)
- low-level software realization
- high-level software realization
- abstraction!
algorithms & programming
circuit construction
operating systems & networks
- we conclude by considering limits of computers
and consider whether those limits apply to human brain
Models in general
- models are simplifications
- easier to reason about
- safety & ethical considerations
- ease/cost of modification/rerunning
- hard part: deciding what factors are important
Computing agents
- input and output
- storage and retrieval from memory (state)
- carry out instructions according to memory and current input
models of computation
allows us to ignore limits of computer hardware
such as memory, numeric precision
Some historical background
- computer science before modern computers
- mathematicians searching for completeness
- Gödel's Incompleteness Theorem
- Turing machines and halting
Turing machines
- simple abstract model
could almost build one (except infinite tape!)
- deterministic
- each machine "hardwired" to solve single problem
- tape head: read, write, move left/right
- fixed finite number of internal states
independent of input
- unbounded input/output tape consisting of discrete cells
- each cell contains one of a finite set of symbols
("blanks" and at a least one-blank symbol)
Turing machine as computing agent
- Tm's follow criteria for algorithms
- halting only guaranteed when input appropriate
- (in some sense ability to fail to halt is good!)
- meta machines: executing Tm is algorithmic
Simple example
current current value direction new
state cell content to write to move state
=====================================================
START * 0 right A
A 0 * no move HALT
A 1 * no move HALT
A * * no move HALT
What does this Turing machine do?
Another example
state content write move next state
=====================================================
START * * left A
A 0 1 right B
A 1 0 left A
A * 1 left C
B 0 0 right B
B 1 1 right B
B * * no move HALT
C 0 * right B
C 1 * right B
C * * right B
What does this Turing machine do?