Weight (strings)

-weight of a string, for a letter

, is the number of times that letter occurs in the string.

be a finite set (called the alphabet),

is the free monoid generated by the elements of

, equivalently the set of strings, including the empty string, whose letters are from

, denoted by

, is the number of times the generator

occurs in the unique expression for

as a product (concatenation) of letters in

is an abelian group, the Hamming weight

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

This article incorporates material from Weight (strings) on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.