For the analysis of codon usage tables we developed a special similarity measure which has been derived from the well-known chi-square test for the comparison of two distributions. Unlike the classical chi-square test we do not decide whether two distributions are equal or not, but instead we only use the corresponding P-values to compute a similarity measure for the underlying codon usage tables. For each pair of genes we compare the corresponding codon distributions on the basis of the codon frequencies in the two genes. For a suitable similarity score we average the P-values of the amino acid specific chi-square tests. We start with the counts for codon of amino acid ai in the j-th gene. These counts sum up to over the number Li of different codons for amino acid ai. Note that nij corresponds to the number of occurrences of amino acid ai in gene j. With these counts we compute the chi-square statistic for each pair (j, k) of genes: