The math behind the knotty question