The [math]\displaystyle{ a }[/math]-weight of a string, for a letter [math]\displaystyle{ a }[/math], is the number of times that letter occurs in the string. More precisely, let [math]\displaystyle{ A }[/math] be a finite set (called the alphabet), [math]\displaystyle{ a\in A }[/math] a letter of [math]\displaystyle{ A }[/math], and [math]\displaystyle{ c\in A^* }[/math] a string (where [math]\displaystyle{ A^* }[/math] is the free monoid generated by the elements of [math]\displaystyle{ A }[/math], equivalently the set of strings, including the empty string, whose letters are from [math]\displaystyle{ A }[/math]). Then the [math]\displaystyle{ a }[/math]-weight of [math]\displaystyle{ c }[/math], denoted by [math]\displaystyle{ \mathrm{wt}_a(c) }[/math], is the number of times the generator [math]\displaystyle{ a }[/math] occurs in the unique expression for [math]\displaystyle{ c }[/math] as a product (concatenation) of letters in [math]\displaystyle{ A }[/math].
If [math]\displaystyle{ A }[/math] is an abelian group, the Hamming weight [math]\displaystyle{ \mathrm{wt}(c) }[/math] of [math]\displaystyle{ c }[/math], often simply referred to as "weight", is the number of nonzero letters in [math]\displaystyle{ c }[/math].
This article does not cite any external source. HandWiki requires at least one external source. See citing external sources. (2021) (Learn how and when to remove this template message) |
Original source: https://en.wikipedia.org/wiki/Weight (strings).
Read more |