= Solution
Choose $0<\theta<\pi/2$ with $\sin\theta=\sqrt p$. Then $1-2p=\cos2\theta$ and $2\sqrt{p(1-p)}=\sin2\theta$. The <matrix> found in part 2 is a rotation by $2\theta$ in the ordered good-bad plane, with the bad coordinate listed first. The initial coordinate vector is $(\cos\theta,\sin\theta)^T$.
After $r$ rotations its angle from the bad axis is $(2r+1)\theta$. Equivalently, multiplication of the displayed <matrix> and the addition formulas for sine and cosine prove the assertion by induction from $r=0$. Hence
$$
\boxed{Q^r|\Psi\rangle=\cos((2r+1)\theta)|b\rangle+\sin((2r+1)\theta)|g\rangle.}
$$
The <Born rule> therefore gives good-output probability $\sin^2((2r+1)\theta)$. This is the geometric mechanism of <amplitude amplification>: each coherent iteration rotates the already existing good amplitude toward the good axis.
Back to article page