Weight (strings)

The formula_1-weight of a string, for a letter formula_1, is the number of times that letter occurs in the string. More precisely, let formula_3 be a finite set (called the "alphabet"), formula_4 a "letter" of formula_3, and formula_6 a
"string" (where formula_7 is the free monoid generated by the elements of formula_3, equivalently the set of strings, including the empty string, whose letters are from formula_3). Then the formula_1-"weight" of formula_11, denoted by formula_12, is the number of times the generator formula_1 occurs in the unique expression for formula_11 as a product (concatenation) of letters in formula_3.
If formula_3 is an abelian group, the Hamming weight formula_17 of formula_11,
often simply referred to as "weight", is the number of nonzero letters in formula_11.