Exercise (Due May 2 ): Build a Turing Machine that interchanges the position of two strings of $\QTR{Large}{1}$ s and $\QTR{Large}{0}$ s that a separated by a single blank and with the tape blank elsewhere.

That is, starting with a tape that contains MATH with the Head positioned over the cell containing the initial $\QTR{Large}{x}$ , halts when the tape contains

MATHwith the Head positioned over the cell containing the initial $\QTR{Large}{y}$ .

Hints:

  1. MATH

  2. MATH

A little care has to be taken because one of the two strings may be empty (or both, the tape could be blank)

Answer:

Machine 1.

Machine 2. We need to consider the possibility that the tape is empty, the tape contains 1 string, or the tape contains 3 strings.

_

Exercise (Due May 2 ): (Informal, again Kolmogorov Complexity ) Given Turing Machines MATHand MATH , and descriptions MATH, MATH .$\QTR{Large}{>}$ realizing functions MATH what would a description for a Turing Machine realizing MATH look like. You answer should, again informally, list a series of general steps creating the description from any MATHand MATH .$\QTR{Large}{>,}$ (Hint: How would you do this using Java, or C, or javascript)

Answer:

Using the example above create a joined Machine as follows:

  1. Rename all of the states, except $\QTR{Large}{q_{A}}$ on Machine 2 so that they do not conflict with Machine 1 For example MATHis renamed MATH and MATHis renamed MATH

  2. Replace occurences of MATH on Machine 1 with the new MATH( MATH) from Machine 2.

  3. The joined Machine's Transition Function is the union of that of the modified Machine 1 and the modified Machine 2.

In particular, on the joined Machine, if you start "Machine 1" instead of halting at the old MATH it starts "Machine 2."

Exercise (Due May 2 ) Verify that the "standard" or simpler short prefix encoding is indeed a prefix encoding.

Answer:

Let $\QTR{Large}{x}$ $\QTR{Large}{\neq }$ $\QTR{Large}{y}$ be two strings $\QTR{Large}{x}$ may indeed be a prefix of $\QTR{Large}{y}$ but, using the "standard," they are prefix encoded as MATH and MATH

where $\QTR{Large}{c(x)}$ and $\QTR{Large}{c(y)}$ are encodings of the lengths of $\QTR{Large}{x\ }$ and $\QTR{Large}{y\ .}$Since MATH and MATH. , MATH is not a prefix of MATH . If MATH since $\QTR{Large}{x}$ $\QTR{Large}{\neq }$ $\QTR{Large}{y}$ , MATH MATH



.(Exercise Due May 2) NOT Corollary 6.

$\QTR{Large}{S}$ $\QTR{Large}{=}$ $\QTR{Large}{T=N}$ and MATHare the constant functions These are even primitive recursively enumerable .MATH

Moreover if MATH is any function and MATH $\QTR{Large}{M}$ so is MATH, $\QTR{Large}{\in }$ $\QTR{Large}{M}$ Yet the Theorem itself does not apply. Why?

Answer:

MATH is not a constant function