For known , use nearest-integer stopping for amplitude amplification. Set
Writing , the difference between and has absolute value at most . Thus . The Born rule and part 3 give
Count the initial once and the and occurring inside each of the amplification iterates. The number of applications of either preparation unitary is therefore
The counts separately are applications of and applications of , in addition to applications each of and . This is a quadratic improvement over the mean number of unamplified trials. At an exact rounding tie either nearest iterate meets the probability bound. Knowledge of is used in selecting the stopping time; repeatedly applying without a suitable stopping rule can rotate the state past the good axis and reduce success again. The fact that answers lie in NP supplies verification, but by itself gives no claim that is polynomial in input length.