See: http://www-cs-faculty.stanford.edu/~knuth/