Translating “b is a power of 2″ into TNT

November 15th, 2009

TNT does not, as one unfamiliar with Douglas R. Hofstadter’s Gödel, Escher, Bach might assume, refer to the highly explosive substance trinitrotoluene. In this case, TNT stands for Typographical Number Theory, a formal system created by Hofstadter in order to illustrate many different concepts to his readers.

Not having had any previous knowledge of number theory nor of formal systems, I am most definitely a novice when it comes to the type of mathematical problems found in the book. So far, however, I have been able to solve each of the presented puzzles, albeit with some difficulty. The one which I have just come across has the most difficult thus far, and after solving it I found myself compelled to share my success with the rest of the world.

IMG_0185

In chapter VIII, entitled Typographical Number Theory, Hofstadter presents a few statements (above), asking the reader to translate them into his simple (yet somewhat difficult to understand) system of variables and logic, TNT. He also teases with an “almost impossible” puzzle, “b is a power of 10″, saying even the most experienced of mathematicians would need hours and hours to figure it out. The first four were easy, and my solutions to them are as follows.

  1. ∀a: a = SSSS0 [For all a, a is equal to four.]
  2. ~∃a: a = (a⋅a) [There does not exist a such that a is equal to a times a.]
  3. ∀a:∀b: <~a = b ⊂ ~Sa = Sb> [For all a and for all b, if a is not equal to b then the successor of a is not equal to the successor of b.]
  4. <S0 = 0 ⊂ ∀a:~∃b: a = (SS0⋅b)> [If one is equal to zero, then for all a there does not exist b such that a is equal to two times b.]

Number five, the subject and this post and the cause of all my troubles during the last hour or so, was not quite so easy. I expect for that anyone with any previous experience with similar systems it would not have presented such a challenge, but for such an inexperienced person as myself it was quite difficult indeed.

First, I tried prying it apart mathematically, rewriting it ways like b = 2n or b = 21 × 22 × 23 … × 2n, etc. This didn’t help me at all, because my math skills aren’t that strong and there was nowhere I could take it from there. So I looked at its possible English translations next.

It seemed to me that there were a few simple things that can be done in TNT with relative ease, but as you move up the line of complexity it becomes exponentially harder to express something in such a simple language. I knew for sure I could express a few basic things in TNT, such as “a is a factor of b” or “if something then something else”.

I eventually figured that if all factors of b are multiples of two then b is most certainly a power of two. This is because this power’s only prime factor would be two, with a multiplicity of the given exponent. Think about it, its powers will have no other factors than itself and other powers of 2. You can only divide 32 by 16, 8, 4, and 2. Hence, the stubborn statement can be written in English as “all factors of b are multiples of 2″. In TNT, that would be the following.

  1. ∀a: <∃c: (SSa⋅c) = b ⊂ ∃d: (SS0⋅d) = SSa> [For all a > 1, if there exists c such that a times c is equal to b, then there exists d such that d times 2 is equal to a.]

Edit: Because this confused people, I’d like to clear a few things up. Basically, all this says is the following. For all a, if a is a factor of b then it is also a multiple of 2. If this statement is true for each and every single value of a, then b is a power of two. If there are any exceptions, such as b = 12 and a = 3, then b is not a power of 2. If there is one true case, such as b = 12 and a = 4, then it does not necessarily mean that b is a power of 2.

Edit #2: The difference is that every case of a is necessary for b to be a power of 2, but not sufficient. The overall statement, however, with the “for all a” included, is both necessary AND sufficient.

And there we go. I’m not quite sure whether this is too dissimilar to be considered a translation, but I do believe that the set of all powers of two is equal to the set of numbers for which this TNT statement comes out true. At first I thought the exact same technique would work for powers of 10 just as well. But how could it be that easy? Of course, it wasn’t. I was actually quite bewildered, until I realized my error.

Obviously, this translation is only valid when b is a power of a prime number. If it is a power of a composite number, like 10 in the final challenge, then it will have many factors that do not comply with the above theorem of TNT. For example, 100 has factors 2, 5, 20, and 50 (as well as 10), where both 2 and 5 are not divisible by 10. On the other hand, 32 is only divisible by 16, 8, 4, and 2; all divisible by 2.

Since I’m dealing with things I don’t know much about here, I probably screwed up pretty badly at least once. Please let me know if I’m an idiot and this is totally wrong. Thanks! Anyways, back to being totally bewildered and awed by GEB and its amazingness.

Tags: , , , , , , , , , , , ,

  • ∀a: <∃c: (SSa⋅c) = b ⊂ ∃d: (SS0⋅d) = SSa>

    Two minor quibbles:

    1/ You should not have the <> around the 'exists c' part, but rather around the sentence itself.
    2/ You need to quality the d, ie. there exists d

    your statement becomes
    ∀a: ∃c: ∃d: <(SSa⋅c) = b ⊂ ∃d: (SS0⋅d) = SSa>

    But what about the case where SSa = 6? <SS0.d = SSa> holds true ( d = 3), and <(SSa.c) = b> gives b to be any multiple of 6; i.e. 6, 12, 18, 24. Clearly these are not powers of 2!

    Your logic
    if all factors of b are multiples of two then b is most certainly a power of two.
    is sound but you haven't followed it! Just because there 'exist' factors which are multiples of 2, does not follow that 'all' factors are multples of 2.
  • Thanks for the input, but I think you might be confused...

    1) The statement is not "there exists c..." but rather "IF there exists c then...".
    2) I do qualify the d, in the "if ∃c: (SSa⋅c) = b, then exists d such that", etc.

    Basically, what I'm saying is that if, for any a, if a is a factor of b (that is, if there exists a c such that a * c = b), then a is a factor of 2 (there exists d such that 2 * d = a).

    These things are so easily confused, but you'll find its quite alright the way it is.
  • Hi! I don't think our solutions are totally different. On the contrary, I think they are very similar. A very sloppy translation of my solution is "b has no odd factors" and I'd translate your solution to "all factors of b are even". This looks just like a double negative for me.

    And by the way, if you replace "SS0.d" with "d+d" in your statement, it is 30 characters long, just as long as mine. I'm wondering if there exists a shorter solution of Hofstadter's exercise...
  • Ben
    Oh crap it's not watertight (i'm sorry i made such a claim). You need to worry about factors b and 1. Otherwise if a = 1 and c = 8 then the left hand side is true and the right is false. It shouldn't be too hard to make this amendment.
  • This might make you feel like an idiot, but that's exactly what the SSa's are for. Since a + 2 can never equal 1, it works out quite nicely in the end.

    But don't worry, I only know that 'cause I wrote it. I can understand why it might look like they weren't necessary at first.
  • Ben
    I'd hang my head lower in shame but I'd have to dig a hole.

    Kudos.
  • Ben
    What you're saying is exactly right but I want to explain why your formula is not quite right.

    "if there exists c such that a times c"

    The SSa * c in your formula isn't what you are trying to say. This says "the successor of the successor of a times c" or (a+2) * c. You should just have it (a*c).

    "d times 2 is equal to a"

    The (SS0 * d) = SSa has the same issue. This says 2 * d = the successor of the successor of a (or a + 2).

    Now if we take your formula and change the SSa's into a's we get:

    ∀a: <∃c: (a⋅c) = b ⊂ ∃d: (SS0⋅d) = a>

    This is watertight. My example before about b = 12 was trying to hint that your formula wasn't quite there.
  • Felix
    I don't know this notation well, I just read about it on the Wikipedia article, and I came up with the same solution for 5:
    $$\forall a \forall c:<(a\cdot c)=b\subset (~a=1 \subset \exists d: a = SS0\cdot d)>$$, which means: if a*c = b, i.e. if a is a factor of b, and if a is not 1, then it is divisible by 2. I see that you worked around the problem of 1 being a factor of b by using SSa instead of just a. however I am not sure how to tackle the last problem. My first idea was to check that the number of divisors of b which are itself divisible by 2 is the same as the number of divisors that are divisible by 5 (if b = 10^n, this number is (n-1)*n). Not sure how to implement this in TNT yet, though :)
  • I don't understand the language in which that is expressed, but the way you translated it into English works very well. And yes, since 5 is prime you can easily use the same basic principle to express it.

    In TNT, "b is a power of 5" could be expressed as the following:

    ∀a: <∃c: (SSa⋅c) = b ⊂ ∃d: (SSSSS0⋅d) = SSa>

    Which basically says that if a is a factor of b then it is also a multiple of 5.