Weight (strings)
Encyclopedia
The -weight of a string, for a letter, is the number of times that letter occurs in the string. More precisely, let be a finite set (called the alphabet), a letter of , and a
string (where is the free monoid generated by the elements of , equivalently the set of strings, including the empty string, whose letters are from ). Then the -weight of , denoted by , is the number of times the generator occurs in the unique expression for as a product (concatenation) of letters in .

If is an abelian group
Abelian group
In abstract algebra, an abelian group, also called a commutative group, is a group in which the result of applying the group operation to two group elements does not depend on their order . Abelian groups generalize the arithmetic of addition of integers...

, the Hamming weight
Hamming weight
The Hamming weight of a string is the number of symbols that are different from the zero-symbol of the alphabet used. It is thus equivalent to the Hamming distance from the all-zero string of the same length. For the most typical case, a string of bits, this is the number of 1's in the string...

of ,
often simply referred to as "weight", is the number of nonzero letters in .

Examples

  • Let . In the string , occurs 5 times, so the -weight of is .
  • Let (an abelian group) and . Then , , and .


----
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK