\documentstyle{article} \input{mac} \begin{document} \section{Honors Theory: Hints for HW1} All machines here are deterministic. \paragraph{(1) Using PM to simulate TM.} This is relatively easy. Let M be any k-tape TM. We construct a PM P to simulate M. Let $$\Delta=\{c, q, \wh{q}, t_0,t_1\dd t_k, h_0\dd h_k,\ldots\}.$$ The meanings of these labels will be explained. If $w\in\Delta^*$, then let $[w]$ denote the node pointed to by $w$ in the current $\Delta$-structure. The contiguous cells containing non-blank symbols on the $i$th tape of M corresponds to the nodes $[t_i^+]$. (Note: $t_i^+$ is the set $\{t_i, t_i^2, t_i^3 ,\ldots\}$ and $[t_i^+]$ is the set of nodes $\{[t_i], [t_i^2], [t_i^3] ,\ldots\}$.) If M has $m$ tape symbols, then these are represented by the nodes in the set $[c^+]$. This set has exactly $m$ nodes (we arrange these nodes in a linear list with the last node have its $c$-edge pointing back to itself). The symbol stored in cell $[t_i^m]$ is given by $[t_i^m c]$. The cell being scanned by the $i$th tape head is given by $[h_i]$. It is assume that P is initialized with the correct input tape contents. The work tapes are initially empty: that is, for $i=1\dd k$, we have $$[t_i^+]=[\ess]$$ (where $[\ess]$ is the center. If M has $n$ states, then $[q^+]$ will have $n$ nodes arranged in a linear list, as usual. The label $\wh{q}$ indicates the current state of M: if the current state is $[q^m]$, then we have $[\wh{q}]=[q^m]$. Note: the first thing that P does is to initialize $[q^+]$ and $[\wh{q}]$ correctly. We leave the rest of the details to the student. \paragraph{(2) Using a TM to simulate a DPM.} This is harder. Let P be any PM and M be a TM we will construct to simulate P. We assume the input to P follows the convention in part (1) above. Thus, we initially have the input symbols $[c^+]$ and the input word $[t_0^+]$. Moreover, we assume that P never modify the initial input (to conform to our conventions for TMs). That is, assignments of the form $$t_0^m \leftarrow w, t_0^m c \leftarrow w, c^m \leftarrow w$$ is illegal for all $m\in\NN$. The machine M has several tapes with the following functions. Basically, we need to store some representation of the $\Delta$-structure used by P. Assume $|\Delta|=d$. Tape 1: stores in binary notation the value $n$ equal to current number of nodes in the current $\Delta$-structure. The length of $n$ is $\floor{\log_2 n}+1$ is denoted by $s$. NOTE: it is assume that the last bit in the binary notation has some additional mark to indicate that it is the last bit. This self-limiting notation is assumed in all our binary notations. Tape 2: stores a representation of all the nodes in the $\Delta$-structure. If $u$ is the $i$th node represented on tape 2, let $#(u)$ be the binary notation for $i$ (padded out to exactly $s$ bits). If the $d$ successors of a node $u$ are $u_1\dd u_d$, then the node $u$ is represented by the binary sequence $$#(u_1), #(u_2) \dd #(u_d).$$ This sequence can be stored using exactly $ds$ cells. There are $n$ nodes, and hence the space used in tape 2 is $nds$. Tape 3: There are finitely many words that are referenced in the instruction set of P. Note: in the instructions $$w.i\leftarrow w', w.i\leftarow \NEW, \IF\ (w=w') \THEN\ \GOTO\ L$$ the words $w$ and $w'$ are said to be referenced. Suppose $w_1\dd w_\ell$ are referenced in P. Then in tape 3, we store the sequence $$#([w_1]), #([w_2])\dd #([w_\ell]).$$ This takes space $\ell s$. Tape 4, 5: This provides scratch space in our computation. Our machine M has various states, but certain states are called DISTINGUISHED. There is a 1-1 correspondence between the distinguished states and the instructions of P. Whenever we enter a DISTINGUISHED state, the contents of tapes 1,2 and 3 will conform to the specifications above. In the non-distinguished states, the tape contents are in transition and may not conform to the specifications. Each time a new node is created in the $\Delta$-structure, we need to increment the value $n$ on tape 1. If this causes the value $s$ to increase, then we must first update the contents of tapes 2 and 3 in the natural way before proceeding. We leave the remaining details to the reader. \end{document}