Working through D&D.Sci, problem 3 (solution)

Link post