From Genome Analysis Wiki
→Getting the index of a genotype in an enumerated list given a ploidy and alleles
where P is the number of ploidy, <math>a_1</math>, <math>a_2</math> .. <math>a_P</math> are the alleles in numeric encoding (0 to A-1) and are ordered (e.g. AB and ABCCCC are ordered but ACB is not ordered.
This is well defined because: