The Complexity of Songs

1977 scholarly article by Donald Knuth

"The Complexity of Songs" is a scholarly article by computer scientist Donald Knuth published in 1977[1] as an in-joke about computational complexity theory. The article capitalizes on what it argues is the tendency of popular songs to devolve from long and content-rich ballads to highly repetitive texts with little or no meaningful content.[2] The article states that a song of length N words may be produced remembering, e.g., only O(log N) words ("space complexity" of the song) or even less.

## Article summary

[edit]

Knuth writes that "our ancient ancestors invented the concept of refrain" to reduce the space complexity of songs, which becomes crucial when a large number of songs is to be committed to one's memory. Knuth's Lemma 1 states that if N is the length of a song, then the refrain decreases the song complexity to cN, where the factor c < 1.[1]

Knuth further demonstrates a way of producing songs with O(√N) complexity, an approach "further improved by a Scottish farmer named O. MacDonald".[1]

More ingenious approaches yield songs of complexity  O ( log ⁡ N ) {\displaystyle O(\log N)} , a class known as "m bottles of beer on the wall".

Finally, the progress during the 20th century—stimulated by the fact that "the advent of modern drugs has led to demands for still less memory"—leads to the ultimate improvement: Arbitrarily long songs with space complexity ⁠ O ( 1 ) {\displaystyle O(1)} ⁠ exist, e.g. a song defined by the recurrence relation[1]

S 0 = ϵ , S k = V k S k − 1 , k ≥ 1 , {\displaystyle S_{0}=\epsilon ,S_{k}=V_{k}S_{k-1},\,k\geq 1,}
Vk = 'That's the way,' U 'I like it,' U, for all k ≥ 1
U = 'uh huh,' 'uh huh'

## Further developments

[edit]

Prof. Kurt Eisemann of San Diego State University in his letter to the Communications of the ACM[3] further improves the latter seemingly unbeatable estimate. He begins with an observation that for practical applications the value of the "hidden constant" c in the big O notation may be crucial in making the difference between the feasibility and unfeasibility: for example a constant value of 1080 would exceed the capacity of any known device. He further notices that a technique has already been known in Mediaeval Europe whereby textual content of an arbitrary tune can be recorded basing on the recurrence relation  S k = C 2 S k − 1 {\displaystyle S_{k}=C_{2}S_{k-1}} , where  C 2 = 'la' {\displaystyle C_{2}={\texttt {'la'}}} , yielding the value of the big-O constant c equal to 2. However it turns out that another culture achieved the absolute lower bound of O(0). As Prof. Eisemann puts it:

> When the Mayflower voyagers first descended on these shores, the native Americans proud of their achievement in the theory of information storage and retrieval, at first welcomed the strangers with the complete silence. This was meant to convey their peak achievement in the complexity of songs, namely the demonstration that a limit as low as c = 0 is indeed obtainable.

It is then claimed that the Europeans were unprepared to grasp this notion, and the chiefs, in order to establish a common ground to convey their achievements later proceeded to demonstrate an approach described by the recurrent relation  S k = C 1 S k − 1 {\displaystyle S_{k}=C_{1}S_{k-1}} , where  C 1 = 'i' {\displaystyle C_{1}={\texttt {'i'}}} , with a suboptimal complexity given by c = 1.[2][3]

The O(1) space complexity result was also implemented by Guy L. Steele, Jr., "perhaps challenged by Knuth's [article]."[4] Dr. Steele's TELNET Song used a completely different algorithm based on exponential recursion, a parody on some implementations of TELNET.[5][6][7]

Darrah Chavey suggested that the complexity analysis of human songs can be a useful pedagogic device for teaching students complexity theory.[8]

The article "On Superpolylogarithmic Subexponential Functions" by Prof. Alan Sherman[9] writes that Knuth's article was seminal for analysis of a special class of functions.

## References

[edit]

1. ^ a b c d Knuth, Donald (Summer 1977). "The Complexity of Songs". ACM SIGACT News. 9 (2): 17–24\. doi:10.1145/1008354.1008355. S2CID 17533775.17-24&rft.date=1977&rft_id=info:doi/10.1145/1008354.1008355&rft_id=https://api.semanticscholar.org/CorpusID:17533775#id-name=S2CID&rft.aulast=Knuth&rft.aufirst=Donald&rft_id=https://doi.org/10.1145%2F1008354.1008355&rfr_id=info:sid/en.wikipedia.org:The+Complexity+of+Songs" class="Z3988"> Reprinted in: Knuth, Donald (1984). "The Complexity of Songs". Communications of the ACM. 27 (4): 344–346\. doi:10.1145/358027.358042. MR 0784131.344-346&rft.date=1984&rft_id=info:doi/10.1145/358027.358042&rft_id=https://mathscinet.ams.org/mathscinet-getitem?mr=784131#id-name=MR&rft.aulast=Knuth&rft.aufirst=Donald&rft_id=https://doi.org/10.1145%2F358027.358042&rfr_id=info:sid/en.wikipedia.org:The+Complexity+of+Songs" class="Z3988">
2. ^ a b Steven Krantz (2005) "Mathematical Apocrypha Redux", ISBN 0-88385-554-2, pp.2, 3.
3. ^ a b Ashenhurst, Robert L. (1985). "ACM forum". Communications of the ACM. 28 (3): 235–240\. doi:10.1145/3166.315004.235-240&rft.date=1985&rft_id=info:doi/10.1145/3166.315004&rft.aulast=Ashenhurst&rft.aufirst=Robert+L.&rfr_id=info:sid/en.wikipedia.org:The+Complexity+of+Songs" class="Z3988">
4. ^ Neumann, Peter G. (1984). "A further view of the first quarter century". Communications of the ACM. 27 (4): 343. doi:10.1145/358027.358040.
5. ^ Steele, Guy L. (1984). "THE TELNET SONG: ("Control-Uparrow Q.")". Communications of the ACM. 27 (4): 347–348\. doi:10.1145/358027.1035691.347-348&rft.date=1984&rft_id=info:doi/10.1145/358027.1035691&rft.aulast=Steele&rft.aufirst=Guy+L.&rfr_id=info:sid/en.wikipedia.org:The+Complexity+of+Songs" class="Z3988">
6. ^ Text of the TELNET Song (retrieved January 5, 2012).
7. ^ Telnet song in MIDI format.
8. ^ Chavey, Darrah (1996). "Songs and the analysis of algorithms". Proceedings of the twenty-seventh SIGCSE technical symposium on Computer science education. pp. 4–8\. doi:10.1145/236452.236475. ISBN 089791757X. S2CID 148247. Retrieved 7 January 2013.4-8&rft.date=1996&rft_id=https://api.semanticscholar.org/CorpusID:148247#id-name=S2CID&rft_id=info:doi/10.1145/236452.236475&rft.isbn=089791757X&rft.aulast=Chavey&rft.aufirst=Darrah&rft_id=http://dl2.acm.org/citation.cfm?id=236475&CFID;=248220371&CFTOKEN;=72224448&rfr_id=info:sid/en.wikipedia.org:The+Complexity+of+Songs" class="Z3988">
9. ^ Sherman, Alan T. (1991). "On Superpolylogarithlnic Subexponential Functions (Part I)". ACM SIGACT News. 22: 65. doi:10.1145/122413.990652.

## External links

[edit]

* "The Complexity of Songs", Knuth, Donald E. (1984).

* v
* t
* e

Donald Knuth

Publications|

* The Art of Computer Programming
* "The Complexity of Songs"
* Computers and Typesetting
* Concrete Mathematics
* Surreal Numbers
* Things a Computer Scientist Rarely Talks About
* Selected papers series

Software|

* TeX
* Metafont
* MIXAL (MIX
* MMIX)

Fonts|

* AMS Euler
* Computer Modern
* Concrete Roman

Literate programming|

* WEB
* CWEB

Algorithms|

* Knuth's Algorithm X
* Knuth–Bendix completion algorithm
* Knuth–Morris–Pratt algorithm
* Knuth shuffle
* Robinson–Schensted–Knuth correspondence
* Trabb Pardo–Knuth algorithm
* Generalization of Dijkstra's algorithm
* Knuth's Simpath algorithm

Other|

* Dancing Links
* Knuth reward check
* Knuth Prize
* Knuth's up-arrow notation
* Man or boy test
* Quater-imaginary base
* -yllion
* Potrzebie system of weights and measures

*[v]: View this template
*[t]: Discuss this template
*[e]: Edit this template