Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2013/iii/paper-58/3/b/ii/solution

Let be the number of ones. The displayed output state assigns the outcome probability
For a constant string, or , so this probability is one. For a balanced string, , so it is zero. Under the promise, certifies a constant string, and any other possible outcome certifies a balanced string. A nonzero ordered-pair outcome must have and , which also certifies without separately reading either bit. This is the fact used by opposite-pair elimination for exact quantum balance testing.

New to topics? Read the docs here!