  Although some non-trivial photon number resolving detectors exist, it may
still be convenient to discriminate photon number states with the method of
multiplexed detection. Multiplexing can be performed with paths in real space,
with paths in time, and in principle with any degree of freedom that has a
sufficient number of eigenstates and that can be coupled to the photon number.
Previous works have addressed the probabilities involved in these measurements
with Monte Carlo simulations, or by restricting the number of detectors to
powers of 2, or without including quantum efficiency or noise. In this work we
find an analytical expression of the detection probabilities for any number of
input photons and any number of on/off photon detectors with a quantum
efficiency $0\%\leq\eta\leq100\%$ and a false count probability
$\varepsilon\geq0$. This allows us to retrodict the number of photons that we
had at the input in the least unbiased way possible. We conclude our work with
some examples.
