< previous page page_238 next page >

Page 238

flow is machine dependent. By this strategy, consider the universe, or, more precisely, algebra: Let X = the sum of many powers of 2 = 111111 (base 2). Now add X to itself: X + X = 111110. Thus, 2X = X - 1, so X = -1. Therefore algebra is run on a machine (the universe) that is two's-complement.
Item 174 (Bill Gosper and Stuart Nelson): 21963283741 is the only number such that if you represent it on the PDP-10 as both an integer and a floating-point number, the bit patterns of the two representations are identical.
Item 176 (Gosper): The "banana phenomenon" was encountered when processing a character string by taking the last 3 letters typed out, searching for a random occurrence of that sequence in the text, taking the letter following that occurrence, typing it out, and iterating. This ensures that every 4-letter string output occurs in the original. The program typed BANANANANANANANA . We note an ambiguity in the phrase, "the Nth occurrence of." In one sense, there are five 00's in 0000000000; in another, there are nine. The editing program TECO finds five. Thus it finds only the first ANA in BANANA, and is thus obligated to type N next. By Murphy's Law, there is but one NAN, thus forcing A, and thus a loop. An option to find overlapped instances would be useful, although it would require backing up N - 1 characters before seeking the next N-character string.
Note: This last item refers to a Dissociated Press implementation. See also banana problem.
HAKMEM also contains some rather more complicated mathematical and technical items, but these examples show some of its fun flavor.
An HTML transcription of the document is available at ftp://ftp.netcom.com/pub/hb/hbaker/hakmem/hakmem.html.
hakspek /hak'speek/ n. A shorthand method of spelling found on many British academic bulletin boards and talker systems. Syllables and whole words in a sentence are replaced by single ASCII characters the names of which are phonetically similar or equivalent, while multiple letters are usually dropped. Hence, 'for' becomes '4'; 'two', 'too', and 'to' become '2'; 'ck' becomes 'k'. "Before I see you tomorrow" becomes "b4 i c u 2moro". First appeared in London about 1986, and was probably caused by the slowness of available talker systems, which operated on archaic machines with outdated operating systems and no standard methods of communication. Has become rarer since. See also talk mode.

 
< previous page page_238 next page >

If you like this book, buy it!