formula for Q