  We search for the optimal quantum pure states of identical bosonic particles
for applications in quantum metrology, in particular in the estimation of a
single parameter for the generic two-mode interferometric setup. We consider
the general case in which the total number of particles is fluctuating around
an average $N$ with variance $\Delta N^2$. By recasting the problem in the
framework of classical probability, we clarify the maximal accuracy attainable
and show that it is always larger than the one reachable with a fixed number of
particles (i.e., $\Delta N=0$). In particular, for larger fluctuations, the
error in the estimation diminishes proportionally to $1/\Delta N$, below the
Heisenberg-like scaling $1/N$. We also clarify the best input state, which is a
"quasi-NOON state" for a generic setup, and for some special cases a two-mode
"Schr\"odinger-cat state" with a vacuum component. In addition, we search for
the best state within the class of pure Gaussian states with a given average
$N$, which is revealed to be a product state (with no entanglement) with a
squeezed vacuum in one mode and the vacuum in the other.
