# Find the probability of a measurement outcome in terms of the coefficients of the state

Suppose we have a quantum state $$|\psi \rangle$$ of $$n$$ qubits, where $$|\psi\rangle=\sum_{x∈\{0,1\}^n}\alpha_x |x\rangle$$,and we measure the first qubit of $$|\psi\rangle$$ in the computational basis. What is the probability that the measurement outcome is $$1$$, in terms of the $$\alpha_x$$ coefficients?

I'm not quite sure how to approach this. Usually the computational basis is $$\{|0\rangle,|1\rangle\}$$ and I'm not sure what ket I am meant to apply to the $$|\psi\rangle$$.

I'm also not sure what matrix I need to use to do the measurement.

$$x \in \{0, 1\}^n$$ means that in the sum we have all possible bitstrings with length $$n$$. Let's take $$n = 3$$:

$$|\psi\rangle = \sum_{x \in \{0, 1\}^n} \alpha_x |x\rangle= \alpha_{000} |000\rangle + \alpha_{001} |001\rangle + \alpha_{010} |010\rangle + \\ + \alpha_{011} |011\rangle + \alpha_{100} |100\rangle + \alpha_{101} |101\rangle + \alpha_{110} |110\rangle + \alpha_{111} |111\rangle$$

If we use projecter $$P = |1\rangle \langle 1 | \otimes I \otimes I$$ then the probability of measuring first qubit $$|1\rangle$$ will be equal to:

$$p = \langle \psi | P | \psi \rangle = |a_{100}|^2 + |a_{101}|^2 + |a_{110}|^2 + |a_{111}|^2$$

More about projective measurements can be found in M. Nielsen and I. Chuang's textbook pages 87-88 (for $$M$$ in the textbook one can take $$Z \otimes I \otimes I$$ operator).

The probability that the measurement outcome is 1 in the first qubit is $$\sum|\alpha_x|^2$$ for all $$x$$ whose first bit is 1.