<?xml version="1.0" encoding="UTF-8"?>

<record version="3" id="6985">
 <title>weight (strings)</title>
 <name>WeightStrings</name>
 <created>2005-04-30 08:39:48</created>
 <modified>2005-05-01 15:00:02</modified>
 <type>Definition</type>
 <creator id="9234" name="GrafZahl"/>
 <author id="9234" name="GrafZahl"/>
 <classification>
	<category scheme="msc" code="94A55"/>
 </classification>
 <defines>
	<concept>Hamming weight</concept>
 </defines>
 <synonyms>
	<synonym concept="weight (strings)" alias="weight"/>
 </synonyms>
 <related>
	<object name="KleeneStar"/>
 </related>
 <preamble>% this is the default PlanetMath preamble.  as your knowledge
% of TeX increases, you will probably want to edit this, but
% it should be fine as is for beginners.

% almost certainly you want these
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

% used for TeXing text within eps files
%\usepackage{psfrag}
% need this for including graphics (\includegraphics)
%\usepackage{graphicx}
% for neatly defining theorems and propositions
%\usepackage{amsthm}
% making logically defined graphics
%\usepackage{xypic}

% there are many more packages, add them here as you need them

% define commands here
\newcommand{\mbb}{\mathbb}
\newcommand{\mbf}{\mathbf}
\newcommand{\mc}{\mathcal}

% mathematical operators
\DeclareMathOperator{\wt}{wt}</preamble>
 <content>\PMlinkescapeword{times}
Let $A$ be an alphabet, $a\in A$ a letter from $A$ and $c\in A^*$ a
string over $a$. Then the $a$-\emph{weight} of $c$, denoted by
$\wt_a(c)$, is the number of times $a$ occurs in $c$.

If $A$ is an abelian group, the \emph{Hamming weight} $\wt(c)$ of $c$ (no \PMlinkescapetext{index}),
often simply referred to as ``weight'', is the number of nonzero letters in $c$.

\subsubsection*{Examples}

\begin{itemize}
\item Let $A=\{x,y,z\}$. In the string $c:=yxxzyyzxyzzyx$, $y$ occurs $5$
  times, so the $y$-weight $\wt_y(c)=5$.
\item Let $A=\mbb{Z}_3=\{0,1,2\}$ (an abelian group) and
  $c:=002001200$. Then $\wt_0(c)=6$, $\wt_1(c)=1$, $\wt_2(c)=2$ and
  $\wt(c)=\wt_1(c)+\wt_2(c)=3$.
\end{itemize}</content>
</record>
