Word metric ball (source code)

= Word metric ball
{title2=$B_S(g,r)$}

= Ball in a word metric
{synonym}

The closed <word metric ball> of radius $r\geq0$ centred at a <group element> $g$ is
$$
B_S(g,r)=\{h\in G:d_S(g,h)\leq r\}=g\{u\in G:|u|_S\leq r\}.
$$
This is a <closed ball> for the <word metric>. A finite <generating set of a group> gives a finite <word metric ball>, because at most $\sum_{k=0}^{\lfloor r\rfloor}|S|^k$ <words over an alphabet> can represent its elements. Different <words over an alphabet> may represent the same element, so this is an upper bound. <Word metric balls in the integer lattice> give exact counts for two choices of moves.