Weight (strings)

The a-weight of a string, for a letter a, 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 wta(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 wt(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=yxxzyyzxyzzyx, y occurs 5 times, so the y-weight of c is 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.

This article does not cite any external source. HandWiki requires at least one external source. See citing external sources. Please help improve this article. Unsourced material may be removed in future.
Find sources: "Weight" strings – news · newspapers · books · scholar · JSTOR (2021) (Learn how and when to remove this template message)

|

0.00

(0 votes)

Original source: https://en.wikipedia.org/wiki/Weight (strings). Read more

|

Retrieved from "https://handwiki.org/wiki/index.php?title=Weight_(strings)&oldid=217205"