# Finding the measurement basis for single qubit with given probability of outcome $0$

I have the general state of a single qubit $$|\psi \rangle = \alpha|0\rangle + \beta|1\rangle$$. Assume I am given a probability $$p$$ such that $$0 < p <1$$. Now I need to find the basis in which the measurement of the qubit $$|\psi \rangle$$ gives outcome $$0$$ with probability $$p$$.

I understand that the required basis $$B$$ will have $$2$$ states, so assume the basis is $$B =\{|a\rangle, |b\rangle \}$$. Also that, probability of outcome $$0$$, when measured in basis $$B$$, is $$|\langle a |\psi\rangle|^2$$ which should equal $$p$$. At the same time, probability of outcome $$1$$ in basis $$B$$ is $$|\langle b |\psi\rangle|^2$$ and should equal $$1-p$$.

I do not understand how to solve the above two inner-product equations to obtain states $$|a\rangle$$ and $$|b\rangle$$?

You have state $$|\psi\rangle=\alpha|0\rangle+\beta|1\rangle,$$ where $$|\alpha|^2+|\beta|^2=1$$. You want to convert to the basis $$B=[|a\rangle,|b\rangle]$$.

One way to change the basis is by following:

Let $$|\psi\rangle=\sqrt{p}|a\rangle+\sqrt{1-p}|b\rangle$$. Where, $$|a\rangle=m|0\rangle+n|1\rangle$$ and $$|b\rangle=-m^*|1\rangle+n^*|0\rangle$$, because new basis should be orthonormal.

After putting $$|a\rangle$$ and $$|b\rangle$$ into $$|\psi\rangle$$, you get the following: $$|\psi\rangle=(m\sqrt{p}+n^*\sqrt{1-p})|0\rangle+(n\sqrt{p}-m^*\sqrt{1-p})|1\rangle$$=$$\alpha|0\rangle+\beta|1\rangle$$.

Comparing the coefficients and after solving for $$m$$ and $$n$$,

$$m=\alpha \sqrt{p}^*-\beta^*\sqrt{1-p}$$

$$n=\beta \sqrt{p}^*-\alpha^*\sqrt{1-p}$$.