A good item must exist, so assume ; if , the requested search is impossible, while makes every output good. Put and . Normalize the good and bad components of the uniform superposition state as
The Boolean phase oracle negates and fixes . The Grover diffusion operator is . Its implementation is independent of : conjugate the reflection about by Hadamard gates. One Grover search algorithm iteration is
Hence, by the Grover rotation angle formula,
Choose the nonnegative integer nearest to . Its final angle differs from by at most , so a computational-basis measurement succeeds with probability at least . The allowed small-density regime includes , giving the requested bound. Each iteration uses one Boolean phase oracle query, and .
For , and one iteration reaches exactly. Thus one query gives a good outcome with certainty:
This is exact Grover search on four entries applied to a marked fraction of one quarter, not only to a four-element register.
The marked-state phase oracle changes only the amplitude of . Since that amplitude in is ,
Also,
It follows that and , so
The global minus sign has no observable effect. Prepare , query once, apply the fixed operator , and perform a quantum measurement in the computational basis. The outcome is with probability one. This is exact Grover search on four entries.
Choose to prepare the uniform superposition, so the marked-state probability is . Apply the marked-state phase oracle , followed by the reflection about the prepared state. Part (iii) shows that this single Grover iteration produces . A projective measurement in the four-item basis therefore returns the marked element with probability one. This is exact Grover search on four entries.