  We present a formalism for performance forecasting and optimization of future
cosmic microwave background (CMB) experiments. We implement it in the context
of nearly full sky, multifrequency, B-mode polarization observations,
incorporating statistical uncertainties due to the CMB sky statistics,
instrumental noise, as well as the presence of the foreground signals. We model
the effects of a subtraction of these using a parametric maximum likelihood
technique and optimize the instrumental configuration with predefined or
arbitrary observational frequency channels, constraining either a total number
of detectors or a focal plane area. We showcase the proposed formalism by
applying it to two cases of experimental setups based on the CMBpol and COrE
mission concepts looked at as dedicated B-mode experiments. We find that, if
the models of the foregrounds available at the time of the optimization are
sufficiently precise, the procedure can help to either improve the potential
scientific outcome of the experiment by a factor of a few, while allowing one
to avoid excessive hardware complexity, or simplify the instrument design
without compromising its science goals. However, our analysis also shows that
even if the available foreground models are not considered to be sufficiently
reliable, the proposed procedure can guide a design of more robust experimental
setups. While better suited to cope with a plausible, greater complexity of the
foregrounds than that foreseen by the models, these setups could ensure science
results close to the best achievable, should the models be found to be correct.
