3

In exercise 1.1.9 of volume 1 of The Art of Computer Programming, the reader is asked to

formulate a set-theoretic definition for the concept "$C_2$ is a representation of $C_1$"

where $C_1$ and $C_2$ are computational methods described in the previous few pages (reproduced here so the question can be answered without needing the book).

Let us formally define a computational method to be a quadruple $(Q,I,\Omega,f)$, in which $Q$ is a set containing subsets $I$ and $Ω$, and $f$ is a function from $Q$ into itself. [...] The four quantities $Q$, $I$, $\Omega$, $f$ are intended to represent repectively the state of the computation, the input, the output, and the computational rule.

When I looked at the answer in the back, this definition was proposed:

For example we can say $C_2$ represents $C_1$ if there is a function $g$ from $I_1$ into $I_2$, a function $h$ from $Q_2$ into $Q_1$, and a function $j$ from $Q_2$ into the positive integers, satisfying the following conditions:

  • a) If $x$ is in $I_1$ then $h(g(x)) = x$
  • b) If $q$ is in $Q_2$ then $f_1(h(q)) = h(f_2^{[j(q)]}(q))$, where $f_2^{[j(q)]}$ means that the function $f_2$ is to be iterated $j(q)$ times.
  • c) If $q$ is in $Q_2$ then $h(q)$ is in $\Omega_1$ if and only if $q$ is in $\Omega_2$

Later on, discussing this definition, Knuth writes (emphasis mine):

The relation "$C_2$ represents $C_1$" generates an equivalence relation in which two computational methods apparently are equivalent if and only if they compute isomorphic functions of their inputs ...

To be an equivalence relation, a relation must be symmetric. That is, for a relation $R$, $(a, b) \in R$ implies $(b, a) \in R$. I don't believe this is true of the given definition.

Consider the computational methods $C_1$ and $C_2$, where

\begin{align*} C_2 &= \{Q_2, I_2, \Omega_2, f_2\}\\ C_1 &= \{Q_1, I_1, \Omega_1, f_1\}\\\\ I_2 &= \{a_1, a_2\}\\ \Omega_2 &= \{b_1, b_2\}\\ Q_2 &= I_2 \cup \Omega_2\\ f_2 &= \{(a_1, b_1), (a_2, b_2), (b_1, b_1), (b_2, b_2)\}\\\\ I_1 &= \{c\}\\ \Omega_1 &= \{d\}\\ Q_1 &= I_1 \cup \Omega_1\\ f_1 &= \{(c, d), (d, d)\} \end{align*}

It can be shown that $C_2$ represents $C_1$ by $g(q) = a_1$, $h = \{(a_1, c), (a_2, c), (b_1, d), (b_2, d)\}$, and $j(q) = 1$.

However, $C_1$ cannot represent $C_2$, because for any proposed $g: I_2 \rightarrow I_1$ it must be the case that $g(a_1) = g(a_2) = c$. But $h(c)$ can only be either $a_1$ or $a_2$. If $h(c) = a_1$, then $h(g(a_2)) = a_1 \neq a_2$, but if $h(c) = a_2$, then $h(g(a_1)) = a_2 \neq a_1$. So in either case, the first requirement cannot be satisfied.

Has this been discussed elsewhere? So far my online searches haven't revealed any answers on the subject. To the best of my knowledge, this hasn't been errata'd (checked here).

Am I understanding the definition properly?

I'm uncertain about my result because of the specific wording "from $Q_2$ into $Q_1$", which seems to have varying meanings depending on where you ask (if it means "injection", it adds different inconsistencies). It also seems strange to me that this property would be overlooked, since Knuth also specifically mentions that "represents" is transitive, and a counterexample like this is quite easily constructed.

In summary: is it not symmetric? Has this been addressed somewhere? Am I owed 0x$1.00?

Reepca
  • 181
  • 3

1 Answers1

3

I slept on it and remembered there was another wording issue that was bugging me: "generates an equivalence relation". I wasn't familiar with it and assumed it just meant "is an equivalence relation". Turns out I was wrong. It has a very specific meaning that Wikipedia describes thusly:

Given any binary relation $A \subset X \times X$ on $X$, the equivalence relation generated by $A$ is the intersection of the equivalence relations on $X$ that contain $A$.

In short, no, "represents" isn't a symmetric relation, nor did Knuth claim it is; he claimed that an equivalence relation could be constructed from it, which is true. Apparently my "knowledge of high school algebra", listed as the primary prerequisite to reading, is lacking.

Reepca
  • 181
  • 3
  • Although this does call into question the usefulness of the generated equivalence relation $B$, since a similar argument to the one in the question could easily be made with any $C_2$ that always halts and has disjoint $I_2$ and $\Omega_2$ like so: For some arbitrary $v \in I_2$, let $g(x) = v$, $h(q) = d$ if $q \in \Omega_2, c$ otherwise, and $j(q) =$ the smallest $k \in \mathbb{N}$ such that $f_2^k(q) \in \Omega_2$. Since $(C_2, C_1) \in B, (C_1, C_2) \in B$. By the transitive property, all halting $C_2$ with disjoint $I_2$ and $\Omega_2$ are equivalent according to $B$... – Reepca Oct 16 '19 at 12:35