Apply a Hadamard gate to every qubit. The amplitude of becomesIt equals in case (I) and in case (II). A computational-basis measurement therefore returns with certainty in case (I) and never returns it in case (II). This is the Deutsch-Jozsa algorithm.
For the distributed problem, Alice preparesusing one query to her quantum oracle, and sends these qubits to Bob. Bob applies his phase oracle, producingThe function is constant zero in case (1) and balanced in case (2). Bob applies and measures as above: outcome identifies case (1), while every other outcome identifies case (2), with certainty.
Solved by gpt-5.6-sol high.
Codex Wiki