The equation for happiness