I'm looking at some examples, but I cannot get the expected result when it comes down to making the measurement on the following state where we measure the first qubit which is the ancilla state.
Here is $|\psi\rangle = \frac{1}{2} |{0}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle + |\psi_b\rangle |\psi_a\rangle) + \frac{1}{2} |{1}\rangle \otimes (|\psi_a\rangle |\psi_b\rangle - |\psi_b\rangle |\psi_a\rangle)$
My calculation suggests that the probability of the ancilla being in the state $|0\rangle$ is:
$p_{0} =\frac{1}{2} + \frac{1}{2}|\langle\psi_a | \psi_b \rangle|^2 $
However the text suggests that there is a minus in place of the plus. I'm not sure if I'm doing anything wrong here or this is a typo.