Suppose I have a state $|\psi\rangle$ and I want to estimate the probability of obtaining a computational basis state $|x\rangle$. Then by the Born rule: $$ p(x) = |\langle x|\psi\rangle|^2 = {\rm tr}[|x\rangle \langle x|\psi\rangle \langle \psi|]. $$ However, I could alternatively achieve the same by defining an observable $O = |x\rangle\langle x|$. This satisfies the definition of an observable:
- $O$ is Hermitian
- $(|x\rangle\langle x|)^2 = |x\rangle\langle x|$
So now I can calculate expectation value of the observable:
$$ \langle O \rangle = {\rm tr}[O|\psi \rangle \langle \psi|] = {\rm tr}[|x\rangle \langle x|\psi\rangle \langle \psi|] = p(x). $$
Is this reasoning correct?