A binary operator required for observing whether the particle is present in a given spatial region Consider the wave function $\psi(x)$, I want to define an experiment using quantum mechanical rules. The experiment is to find whether the particle is in the region of space (a,b). The observable is either 1 (meaning present) or 0 (not present). Now I want to set up a QM operator for this purpose. Is there any such operator? The operator should have two Eigen values 0 or 1, where 0 corresponds to particle not being found in (a,b) and 1 otherwise.
 A: $\newcommand{\bra}[1]{\langle #1 \rvert}\newcommand{\ket}[1]{\lvert #1 \rangle}$What you seek is, in general terms, a projector onto a subspace. Given a set of basis kets $\ket{\psi_i}$ for a subspace, the projector onto that space is simply
$$ \sum_i \ket{\psi_i}\bra{\psi_i}$$
It is easy to see that the $\ket{\psi_i}$ are eigenvectors with eigenvalue $1$ and all vectors outside the subspace are eigenvectors with eigenvalue $0$. 
For a spatial interval $[x_-,x_+]$, we evidently have the position eigenkets $$\{\ket{x_0}\vert x_0\in[x_-,x_+], \hat{x}\ket{x_0} = x_0\ket{x_0}\}$$
as a (generalized) basis for the space of states that are inside that interval, and the projector is
$$ \int_{x_-}^{x_+} \ket{x}\bra{x}\mathrm{d}x$$
A: The operator you want will be given in position space by
$$
\mathcal{O} \psi(x) = \begin{cases} \psi(x) & a < x < b \\ 0 & \text{otherwise} \end{cases}
$$
This is a linear operator on $\psi$, and the only ways to get $\mathcal{O} \psi = \lambda \psi$ is for the support of $\psi$ to be either contained entirely within $(a,b)$ (in which case $\lambda = 1$) or entirely outside $(a,b)$ (in which case $\lambda = 0$.)
