Weight (strings)

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

If A is an abelian group, the Hamming weight \mathrm{wt}(c) of c, often simply referred to as "weight", is the number of nonzero letters in c.

Examples

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

This article is issued from Wikipedia - version of the 4/14/2012. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.