  Consider the Gaussian vector model with mean value {\theta}. We study the
twin problems of estimating the number |{\theta}|_0 of non-zero components of
{\theta} and testing whether |{\theta}|_0 is smaller than some value. For
testing, we establish the minimax separation distances for this model and
introduce a minimax adaptive test. Extensions to the case of unknown variance
are also discussed. Rewriting the estimation of |{\theta}|_0 as a multiple
testing problem of all hypotheses {|{\theta}|_0 <= q}, we both derive a new way
of assessing the optimality of a sparsity estimator and we exhibit such an
optimal procedure. This general approach provides a roadmap for estimating the
complexity of the signal in various statistical models.
