1: \begin{abstract}
2: We consider several related problems of estimating the `sparsity' or number of nonzero elements $d$ in a length $n$ vector $\bfx$ by observing only $\bfb = M \odot \bfx$, where $M$ is a predesigned test matrix independent of $\bfx$, and the operation $\odot$ varies between problems. We aim to provide a $\Delta$-approximation of sparsity for some constant $\Delta$ with a minimal number of measurements (rows of $M$). This framework generalizes multiple problems, such as estimation of sparsity in group testing and compressed sensing. We use techniques from coding theory as well as probabilistic methods to show that $O(D \log D \log n)$ rows are sufficient when the operation $\odot$ is logical OR (i.e., group testing), and nearly this many are necessary, where $D$ is a known upper bound on $d$. When instead the operation $\odot$ is multiplication over $\real$ or a finite field $\F_q$, we show that respectively $\Theta(D)$ and $\Theta(D \log_q \frac{n}{D})$ measurements are necessary and sufficient.
3: \end{abstract}
4: