Puneet Varma (Editor)

Weight (strings)

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit

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 A a letter of A , and c 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 w t 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 w t ( c ) of c , often simply referred to as "weight", is the number of nonzero letters in c .

Examples

  • Let A = { x , y , z } . In the string c = y x x z y y z x y z z y x , y occurs 5 times, so the y -weight of c is w t y ( c ) = 5 .
  • Let A = Z 3 = { 0 , 1 , 2 } (an abelian group) and c = 002001200 . Then w t 0 ( c ) = 6 , w t 1 ( c ) = 1 , w t 2 ( c ) = 2 and w t ( c ) = w t 1 ( c ) + w t 2 ( c ) = 3 .
  • This article incorporates material from Weight (strings) on PlanetMath, which is licensed under the Creative Commons Attribution/Share-Alike License.

    References

    Weight (strings) Wikipedia


    Similar Topics