Mar 3
VTM : a Virtual Turing Machine
There's a command line program "vtm" on cs; look
here.
The transition table is stored in a file *.vtm,
with 5 items per line including either R or L as the last one.
Lines that start with "#" are ignored comments.
For example, if this is file "even.vtm"
#
# in_state read_symbol out_state write_symbol move_direction
# -------- ----------- --------- ------------ --------------
Even, 1, Odd, a, R
Even, 0, Even, b, R
Odd, 1, Even, a, R
Odd, 0, Odd, b, R
Even, _, Accept, X, R
Odd, _, Reject, X, R
then this command
$ vtm -b_ -sEven -t111 even.vtm
produces
<1>1 1 : Even
a<1>1 : Odd
a a<1>: Even
a a a<_>: Odd
a a a X<_>: Reject
The angle brackets show the current position of the read head,
and the current state is listed at the right.
By default the tape is infinite, which in this simulation means
that if the head moves to the left or right past the current
string, a blank symbol is added to that end. (Note that means
that when the tape moves on the end to the left, the printed
string is shifted relative to the strings above.)
Documentation, examples, and a .tar.gz archive are here:
vtm .
You can install and run this yourself (it's a perl script with
some installation complications), or run it at the command line on cs.
Usually I turn the .vtm file into an executable,
with a typical start state and options in the shebang line
(the first invocation line in the file). You can override
these from the command line.
For example, see
even.vtm which can be
run for example in any one of these ways :
$ ./even.vtm # default tape start
$ ./even.vtm -t # prompt user for tape start
$ ./even.vtm -t1011 # tape start is 1011
$ ./even.vtm -0 -t111110110101 # only show final result
calculating things
Discuss these types of machines :
- recognizer
- decider
- enumerator
- calculator, e.g. start with tape "4 + 5" ; end with tape "9"
Argue that calculator implies recognizer of the form "in: 4 + 5 ; out: 9"; therefore, we don't have to talk about machines that do things - only recognizer/decider types.
busy beaver game
Discuss the busy beaver; see for example
From wikipedia's article on March 2 2011:
The function values for Σ(n) and S(n) are only known exactly for n < 5. The current 5-state busy beaver champion produces 4,098 1s, using 47,176,870 steps (discovered by Heiner Marxen and Jürgen Buntrock in 1989), but there remain about 40 machines with non-regular behavior which are believed to never halt, but which have not yet been proven to run infinitely. At the moment the record 6-state busy beaver produces over 1018267 1s, using over 1036534 steps (found by Pavel Kropitz in 2010). As noted above, these busy beavers are 2-symbol Turing machines.