How Knuth Brushes His Teeth

A premature optimization?

Q: Do you have any other insights to offer into how you use maths in your work?

A: For instance, when I brush my teeth I’ve got eight areas to cover, namely Left and right, upper and lower, inside and outside. It’s most efficient to follow a “Hamiltonian path” or “Gray code”:

  • left upper outside
  • right upper outside
  • right upper inside
  • left upper inside
  • left lower inside
  • right lower inside
  • right lower outside
  • left lower outside

(source)