Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2009/iii/paper-51/1/c/solution

All four promised functions have . Use quadratic Boolean phase cancellation: apply a Controlled-Z gate to remove the phase , then apply the Walsh-Hadamard transform. With the rightmost gate acting first, choose
Because and the Controlled-Z gate commutes with the Pauli Z gates,
The quantum measurement in the computational basis consequently produces
Each answer occurs with probability one for its promised Boolean quantum oracle.

New to topics? Read the docs here!