Solution

ID: past-exam-of-the-mathematics-course-of-the-university-of-cambridge/2019/ii/paper-3/15d/c/solution

One classical query at any chosen returns only . Every possible slope is compatible with that answer by choosing , so no one-query classical algorithm can determine with certainty.
For the quantum algorithm, let and prepare
Part (b) shows that the single query applies quantum phase kickback:
The unknown intercept contributes only a global phase. Applying to the first register produces , whose computational-basis measurement determines with certainty after one query.

New to topics? Read the docs here!