weight (strings)


Let A be an alphabet, a∈A a letter from A and c∈A* a string over a. Then the a-weight of c, denoted by wta⁡(c), is the number of times a occurs in c.

If A is an abelian groupMathworldPlanetmath, the Hamming weight wt⁡(c) of c (no ), 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 wty⁡(c)=5.

  • •

    Let A=ℤ3={0,1,2} (an abelian group) and c:=002001200. Then wt0⁡(c)=6, wt1⁡(c)=1, wt2⁡(c)=2 and wt⁡(c)=wt1⁡(c)+wt2⁡(c)=3.

Title weight (strings)
Canonical name Weightstrings
Date of creation 2013-03-22 15:13:17
Last modified on 2013-03-22 15:13:17
Owner GrafZahl (9234)
Last modified by GrafZahl (9234)
Numerical id 6
Author GrafZahl (9234)
Entry type Definition
Classification msc 94A55
Synonym weight
Related topic KleeneStar
Defines Hamming weight