# How can I compute $P_{|b\rangle}(|0\rangle)$?

I've just started to learn Quantum Computing and, to do it, I'm reading the course "Introduction from Quantum Computing" by IBM.

Now, I'm reading the chapter "Entangled states", section "Product states" where they show how to compute the probability of measuring the state $$|a\rangle$$ as $$|0\rangle$$:

$$P_{|a\rangle}(|0\rangle) = (b_0a_0)^2+(b_1a_0)^2 \\ \begin{gather} = b_0^2a_0^2+b_1^2a_0^2 \\ = (b_0^2+b_1^2)a_0^2 \\ = a_0^2 \end{gather}$$

And they say that I can compute $$P_{|b\rangle}(|0\rangle)$$ but, how? Changing the order of the amplitudes like this:

$$P_{|b\rangle}(|0\rangle) = (a_0b_0)^2+(a_1b_0)^2 ...$$

But, if so, I don't understand why. I think that, in both cases, we are working on the same state vector $$|ba\rangle$$, and if I change the amplitude order, I change the state vector to $$|ab\rangle$$.

How can I compute $$P_{|b\rangle}(|0\rangle)$$?

Think of it as the following. The state you are working with is: $$b_0a_0|00\rangle+b_0a_1|01\rangle+b_1a_0|10\rangle+b_1a_1|11\rangle$$ If we were to measure both qubits, the probability of measuring the state $$|BA\rangle$$ would be given by $$\left(b_Ba_A\right)^2$$. In order to compute the probability that the second qubit is in state $$|0\rangle$$, you simply have to sum up all the probabilities that this qubit is in state $$|0\rangle$$, had you measured both qubits. In this case, this gives us: $$p_{|a\rangle}(|0\rangle)=p_{|ba\rangle}(|00\rangle)+p_{|ba\rangle}(|10\rangle)=\left(b_0a_0\right)^2+\left(b_1a_0\right)^2=a_0^2$$. Similarly, the probability to measure $$|0\rangle$$ on $$|b\rangle$$ is given by: $$p_{|b\rangle}(|0\rangle)=p_{|ba\rangle}(|00\rangle)+p_{|ba\rangle}(|01\rangle)=\left(b_0a_0\right)^2+\left(b_0a_1\right)^2=b_0^2$$ What is important to note is that since $$|ba\rangle$$ si the product state of $$|b\rangle$$ and $$|a\rangle$$ these probabilities are the same as if we were not considering the product state but the states $$|a\rangle$$ and $$|b\rangle$$ independently.