Life, the Universal Turing
Machine and Everything
Rhys Price Jones
Professor of Computer Science
the George Washington University
Internet version: I have removed pictures that may be
copyrighted. Sorry - it detracts a lot from the talk
What is this Life?
WHAT is this life if, full of care,
Leisure - William Henry Davies
Welsh “tramp” poet 1871-1940
We have no time to stand and stare.
No time to stand beneath the boughs
And stare as long as sheep or cows.
No time to see, when woods we pass,
Where squirrels hide their nuts in grass.
No time to see, in broad daylight,
Streams full of stars, like skies at night.
No time to turn at Beauty's glance,
And watch her feet, how they can dance.
No time to wait till her mouth can
Enrich that smile her eyes began.
A poor life this if, full of care,
We have no time to stand and stare.
John Horton Conway
1970 invented
Game of Life
1937 26xii born
Liverpool
(3 yrs before Lennon)
What is that life?
A dead cell with 3 live neighbors comes is born
A live cell with 2 or 3 live neighbors stays alive
Death from overcrowding
Death from loneliness
An applet
• Alan Hensel’s applet
• “stand and stare!”
• Buzzwords:
•
cellular automata
•
emergence
•
complex behavior arising from simple rules
What is Computing?
• Let’s ask some experts
• When did computing begin?
• Don’t believe any Association
for Computing Machinery
Some people
Alonzo Church
• believe in the Lambda Calculus
•
Guy Steele
aka Scheme!
• exp :== identifier
λ id. exp
exp1 exp2
•
α-reduction, β-reduction
Kent Dybvig
Some Scheme Programs
> 42
42
> (+ 2 2)
4
> (+ 2 (* 3 4))
14
> (* 1357908642 91357990864201) ; no wimpy ints/floats
124055805310255586325042
>
More Scheme
> (define fac (lambda (x) (if (zero? x) 1 (* x (fac (1- x))))))
> (fac 3)
6
> (fac 5)
120
> (fac 100)
933262154439441526816992388562667004907159682643816214685929638952175999932
2991560894146397615651828625369792082722375825118521091686400000000000000
0000000000
>
What is computing?(1)
• A computer is a device that correctly interprets
Scheme programs
C for others
Brian Kernighan
#define
DIT
(
#define
DAH
)
#define
__DAH
++
#define DITDAH
*
#define
DAHDIT
for
Dennis Ritchie
#define
DIT_DAH
malloc
#define DAH_DIT
gets
#define
_DAHDIT
char
_DAHDIT _DAH_[]=”ETIANMSURWDKGOHVFaLaPJBXCYZQb54a3d2f16g7c8a90l?
e’b.s;i,d:”
;main
DIT
DAH{_DAHDIT
DITDAH
_DIT,DITDAH
DAH_,DITDAH DIT_,
DITDAH
_DIT_,DITDAH
DIT_DAH DIT
DAH,DITDAH
DAH_DIT DIT
DAH;DAHDIT
DIT _DIT=DIT_DAH
DIT 81
DAH,DIT_=_DIT
__DAH;_DIT==DAH_DIT
DIT _DIT
DAH;__DIT
DIT’\n’DAH DAH
DAHDIT DIT
DAH_=_DIT;DITDAH
DAH_;__DIT
DIT
DITDAH
_DIT_?_DAH DIT
DITDAH
DIT_ DAH:’?’DAH,__DIT
DIT’ ‘DAH,DAH_ __DAH
DAH DAHDIT
DIT
DITDAH
DIT_=2,_DIT_=_DAH_;
DITDAH _DIT_&&DIT
DITDAH _DIT_!=DIT
DITDAH DAH_>=’a’?
DITDAH
DAH_&223:DITDAH
DAH_ DAH DAH;
DIT
DITDAH
DIT_ DAH __DAH,_DIT_
__DAH DAH
DITDAH DIT_+=
DIT DITDAH _DIT_>=’a’?
DITDAH _DIT_-’a’:0
DAH;}_DAH DIT DIT_
DAH{
__DIT DIT
Bjarne Stroustrup
DIT_>3?_DAH
DIT
DIT_>>1 DAH:’\0’DAH;return
DIT_&1?’-’:’.’;}__DIT DIT
DIT_ DAH _DAHDIT
DIT_;{DIT void DAH write DIT
1,&DIT_,1 DAH;}
What is computing? (2)
Segmentation
fault
for(i=0;i<n;i++)
{...
• A computer is a device that correctly interprets C
programs
Yet Others
John von Neumann
Eckert and Mauchly
• could work in assembly language
• MOV R3,R4
What is computing? (3)
• A computer is a device that correctly interprets
Assembly Language programs
Computing is
•
Tom Kilburn
Alan Turing
An accumulator, a program counter, a memory, and an ALU
that can correctly interpret
•
BR op
; branch to operand+1
•
BRREL op ; branch to PC+op+1
•
LNEG op
•
STORE op ; store contents of accumulator at op
•
SUB op
•
SKIPNEG ; if (accumulator < 0) PC++
•
HALT
Fred Williams
; load negated contents of op into accumulator
; subtract contents of op from accumulator
Manchester Mark I, 1949
Computing is
•a finite number of NAND gates
connected together reasonably cleverly
•and some interface devices.
Last year I couldn’t spell engineer
Now I is one
Computing is
Turing machine simulation
•a finite number of states, a one-
way infinite tape, a read-write
head, a transition table
specifying for some state/tapesymbol pairs a new state, a new
symbol and a move L or R.
Derek Jacobi as
Alan Turing
“Mathematical”
Specification
•
Finite set of states
•
•
•
q0, q1, ..., qn
one-way infinite tape
•
Xa00YXBB...
•
symbols in Γ
•
head position in red
transitions with tape updates
•
δ : Q × Γ → Q × Γ × {L,R}
Encoding a Turing Machine
• Name the states
•
q0, q1, ..., qn
• encode the
transitions
in a table
• store tape cells in a linked list
•
indicate head position by an int
CS41
Michael Feldman, professor of engineering and applied
science, will be presented with the 2003 Trachtenberg
Teaching Award
• Computing is what you can do in Java
• Can you simulate the action of a Turing machine?
Shakespeare
• Can we write a Java program
•
to analyze Shakespeare?
• be more precise please!
•
say, count the occurrences of each unique word
in the “Complete Works”
• sure...
Turing Machines
• Can we write a Scheme program to simulate a
Turing machine?
• Sure...
• Can we write a java Program to simulate a Turing
machine?
• sure...
input: description of a
TM and its starting tape
output: show the
sequence of states and
tape contents
Universal Turing Machine
•
Can we create a Turing machine U to simulate a Turing machine
java:
input: description of a
TM and its starting tape
output: show the
sequence of states and
tape contents
start with: encoding of a
TM and its starting tape
on U’s tape
output: show the
sequence of states and
tape contents
Turing’s Thesis
• The processes which could
naturally be called algorithms
are precisely those which can
be carried out on Turing
machines
Church’s Thesis
• All formalizations of algorithms will yield the
same class of computable functions.
Theorem
• The
preceding definitions of “computer’’ and
“computing” are all equivalent. Each definition
specifies exactly the same set of computable
functions.
Universal Computing Device
• Any device that can do everything any Universal
Computing Device can do!
• Examples:
• this Mac, any PC, any Java interpreter, any
Scheme interpreter, any C machine, Manchester
Mark I, ENIAC, ...
Prove it!!!
• How would you set about
proving claims like this?
Simulate
• Simulate Scheme in Java:
•
write Scheme interpreter in Java
• Simulate TM in C...
And a Whole Lot More
• Post Machine
Emil Post
• Conway’s Game of Life
cells with < 2 living neighbors die of loneliness
cells with > 3 living neighbors die of overcrowding
dead cells with 3 living neighbors come alive
John Horton
Conway
What!!!!!
This is a TM
designed by
Paul Rendell
in 2002
Some amazing facts
• There is a Life configuration that implements the
JVM
• There is a TM that implements Microsoft’s Word
program
• GoogleEarth can be implemented on Manchester
Mark I
Programming Languages
• Any algorithm expressible in one language can be
equivalently expressed in another
• So it doesn’t matter
• What can be computed by Turing Machine can be
computed in Java
• and vice versa
Constructive Proof
• Computer scientists are good at these
• To prove something is possible, write a program
to do it!
Existence Proofs
René Descartes (1596–1650)
Non-existence proofs
Back to the real world
• We saw a Java program to “analyze” Shakespeare.
• Can we write Java programs to “analyze” Java
programs?
• Tailor the CountWords program to do just that:
•
count the individual words in a Java program
and their frequency
Other Program Analysis
• Balanced Parens?
• Are all the parens balanced?
boolean balancedParens(Program p) {
// use a stack;
try {
while (c = nextChar()) {
if (c == ‘(‘)) push
if (c == ‘)‘)) pop;
}
}catch(StackProb e) {return false;}
return stack.empty();
}
Proper declarations?
• Do all uses of a variable come after the in-scope
declaration of that variable?
boolean properDeclarations(Program p) {
// use a linked list
for each variable scope {
ll = new LinkedList() {
if isDeclaration(thisStatement){
ll.add(thisStatement.getVars());
else {
for (var : thisStatement.getVars()) {
if (var not in ll) return false;
}
}
}
} return true;
Are there strings?
• Are there any String constants in the program?
• Search for “
• is that enough?
Are there loops?
• Are there any loops in the program?
• search for “while” and “for”
• Is that enough?
More Problems
• Will the program run on my
Mac with input HaHaHa for at
least 1 second?
• Will the program run on my
Mac with input BlahBlahBlah
terminate within 1 hour?
• Will the program run on my
Mac with input BlahBlahBlah
terminate within 423 years?
Switch to Scheme
• Easier to pass
programs to each
other
• don’t need a compile
stage
• can treat programs
both as data and as
program
•
same as a Turing
Machine
A fundamental problem
• The halting problem
• Can you write
boolean halts(Program p, Data x) {
// return true if p run on x halts
// return false otherwise
}
Suppose you could
• You have written
•
boolean halts(Program p, Data x)
• You guarantee to give me the
correct answer in a finite time
•
true or false
• I’m holding you to it!
(define halt?
(lambda (p x)
(printf "Does program ~s halt on input ~s? " p x)
(member (read) '(yes y Y))))
Gotcha!
(define foo
(lambda (x)
(cond
((halt? foo foo) (loop)
(else (stop)))))
Logical Impossibility
Contradiction
What’s wrong?
• Am I allowed to write programs
in Scheme?
• Are there infinite loops?
• Are there terminating programs?
• Are there boolean functions?
• Can I pass programs to programs?
• ...
So if ..
• if program halt? says (foo foo) runs
forever
•
it halts
• if it says (foo foo) halts
•
it runs forever
• What’s the explanation?
halt? does not exist!
• neither does program-correct?
• neither does programs-equivalent?
• neither does ...
Humility!
That’s the big picture
© Copyright 2026 Paperzz