## 2 Theory  
Ecological surveys and microbiome analysis by amplicon sequencing yield so-called species count data, which typically populate matrices with species represented by rows and samples represented by columns. Species are taxa (e.g., genera or binomial names), nucleotide sequences (ASVs), or sets of sequences grouped by similarity (OTUs). Samples are specimens of material (e.g., water or soil) or individuals or their parts (e.g., a plant or a bird intestine) distinguished by space-time attributes or treatments. The matrices are filled with nonnegative integers, which are designated counts. Analysis of count data is also used in other research fields such as bibliographic analysis, sociology of crime, and epidemiology of rare diseases. We suggest that study areas unrelated to ecology may also benefit from concepts developed for species count data in ecology. The purpose of normalization is to convert a species count matrix into a normalized matrix, which has an equal dimension and is filled with integers such that the sum of counts of all species in each sample equals a pre-defined value, which we designate \(\mathrm{C}_{\mathrm{min}}\), and the structure of the normalized matrix approximates the structure of the original matrix. The criteria for the approximation may differ but a key principle is that relative frequencies of counts of the normalized matrix are as close as possible to the relative frequencies of counts in the original matrix. A relative frequency is obtained by dividing the count for a particular species in a particular sample by the sum of counts for all species in that sample. Different implementations of the criterion of matching relative frequencies are conceivable. The simplest option is to construct a normalization matrix minimizing the sum of absolute values of pairwise differences between the relative frequencies. This approach, however, ignores the effect of sampling error on the accuracy of relative frequencies. In the first approximation, the coefficient of variation of a count is proportional to the inverse of the square root of the count. Therefore, frequencies may be weighted by the inverse square root of counts. Depending on the purpose of the study, for instance, regarding the importance of rare species, other weighing may be more adequate. Regardless of the criterion used to minimize the differences among sets of relative frequencies of species, which are colloquially referred to as \"population structure\", the task is an optimization problem under integer constraint, which is a special kind of integer programming problem. Let assume sampling data for \(J\) species in \(K\) samples with counts collected in a \(J\times K\) matrix. Let \(C_{(j,k)}\) denote the count of species \(j\) in sample \(k\) and \(F_{(j,k)}\) the relative frequency of species \(j\) in sample \(k\):  
\[F_{(j,k)}=\frac{C_{(j,k)}}{\sum_{i=1}^{J}C_{(i,k)}}.\]  
Let \(C_{(j,k)norm}\) denote the normalized count of species \(j\) in sample \(k\). The constraint of equal total species count per sample implies  
\[\sum_{i=1}^{J}C_{(i,1)norm}=\sum_{i=1}^{J}C_{(i,2)norm}=\ldots=\sum_{i=1}^{J} C_{(i,K)norm}=\mathrm{C}_{\mathrm{min}}.\]Conversion of \(C_{(j,k)}\) into \(C_{(j,k)norm}\) satisfying this constraint and leading to frequencies derived from the normalized matrix  
\[F_{(j,k)norm}=\frac{C_{(j,k)norm}}{\sum_{i=1}^{J}C_{(i,k)norm}}\]  
as close as possible to the original frequencies \(F_{(j,k)}\) is the purpose of normalization. The normalized matrix minimizes the sum of differences between original frequencies and frequencies derived from the normalized counts, while frequencies may be weighted by factor \(r\) and the differences may be raised to power \(s\):  
\[\sum_{i=1}^{J}r\Big{|}F_{(i,k)}-F_{(i,k)norm}\Big{|}^{s}.\]  
As a weighting factor, 1 can be used for equal weights or \(\sqrt{C_{(j,k)}}\) to compensate for differences in the sampling error. As a power \(s\), 1 can be used for absolute differences or 2 in line with the least-square concept.