There is a mistake on the right side of the equation.              (-p+1) should be in the denominator.
