To achieve efficient coding of odor information in an array of nonlinear olfactory receptors, the odor-receptor sensitivity matrix must be sparse. This sparsity depends on the statistics of environmental odors. We used analytical calclation and extensive numerical simulation to study the optimal sensitivity matrix for recptors with and without spontaneous (background) activity.