The mathematics of weight loss