This page is about the success probability of Shor's algorithm and the success probability of Grover's algorithm. For the Shor's algorithm the final measurement has to be less than N and a multiple of Q/r. For the Grover's algorithm, the final measurement after t iterations is for certain the state that is being searched for.