Code for Allen Downey's book Think Complexity, published by O'Reilly Media.