Necklace (combinatorics) explained

In combinatorics, a k-ary necklace of length n is an equivalence class of n-character strings over an alphabet of size k, taking all rotations as equivalent. It represents a structure with n circularly connected beads which have k available colors.

A k-ary bracelet, also referred to as a turnover (or free) necklace, is a necklace such that strings may also be equivalent under reflection. That is, given two strings, if each is the reverse of the other, they belong to the same equivalence class. For this reason, a necklace might also be called a fixed necklace to distinguish it from a turnover necklace.

Formally, one may represent a necklace as an orbit of the cyclic group acting on n-character strings over an alphabet of size k, and a bracelet as an orbit of the dihedral group. One can count these orbits, and thus necklaces and bracelets, using Pólya's enumeration theorem.

Equivalence classes

Number of necklaces

See main article: Necklace polynomial. There are

N
k(n)=1
n

\sumd\mid\varphi(d)kn/d=

1
n
n
\sum
i=1

k(i,n)}

different k-ary necklaces of length n, where

\varphi

is Euler's totient function. When the beads are restricted to particular color multiset

l{B}=

n1
\{1
nk
,\ldots,k

\}

, where

ni

is the number of beads of color

i\in\{1,\ldots,k\}

, there are

N(l{B})=

1
|l{B

|}\sumd(n1,\ldots,nk)}{|l{B}|/d\choosen1/d,\ldots,nk/d}\phi(d)

different necklaces made of all the beads of

l{B}

. [1] Here

|l{B}|:=

k
\sum\limits
i=1

ni

and

{m\choosem1,\ldots,mk} :=

m!
m1!mk!

is the multinomial coefficient.These two formulas follow directly from Pólya's enumeration theorem applied to the action of the cyclic group

Cn

acting on the set of all functions

f:\{1,\ldots,n\}\to\{1,\ldots,k\}

.If all k colors must be used, the count is
L
k(n)=k!
n

\sumd\mid\varphi(d)S\left(

n
d

,k\right),

where

S(n,k)

are the Stirling number of the second kind.

Nk(n)

and

Lk(n)

are related via the Binomial coefficients:

Nk(n)=\sum

k\binom{k}{j}
j=1

Lj(n)

and

Lk(n)=\sum

k(-1)
j=1

k-j\binom{k}{j}Nj(n)

Number of bracelets

The number of different k-ary bracelets of length n is

Bk(n)=\begin{cases} \tfrac12Nk(n)+\tfrac14(k+1)kn/2&ifniseven\\[10px] \tfrac12Nk(n)+\tfrac12k(n+1)/2&ifnisodd \end{cases},

where Nk(n) is the number of k-ary necklaces of length n. This follows from Pólya's method applied to the action of the dihedral group

Dn

.

Case of distinct beads

For a given set of n beads, all distinct, the number of distinct necklaces made from these beads, counting rotated necklaces as the same, is = (n − 1)!. This is because the beads can be linearly ordered in n! ways, and the n circular shifts of such an ordering all give the same necklace. Similarly, the number of distinct bracelets, counting rotated and reflected bracelets as the same, is, for n ≥ 3.

If the beads are not all distinct, having repeated colors, then there are fewer necklaces (and bracelets). The above necklace-counting polynomials give the number necklaces made from all possible multisets of beads. Polya's pattern inventory polynomial refines the counting polynomial, using variable for each bead color, so that the coefficient of each monomial counts the number of necklaces on a given multiset of beads.

Aperiodic necklaces

An aperiodic necklace of length n is a rotation equivalence class having size n, i.e., no two distinct rotations of a necklace from such class are equal.

According to Moreau's necklace-counting function, there are

M
k(n)=1
n

\sumd\mid\mu(d)kn/d

different k-ary aperiodic necklaces of length n, where μ is the Möbius function. The two necklace-counting functions are related by: N_k(n) = \sum_ M_k(d), where the sum is over all divisors of n, which is equivalent by Möbius inversion to M_k(n) = \sum_ N_k(d)\,\mu\bigl(\tfrac\bigr).

Each aperiodic necklace contains a single Lyndon word so that Lyndon words form representatives of aperiodic necklaces.

See also

External links

Notes and References

  1. Web site: Frank . Ruskey . Info on necklaces, Lyndon words, De Bruijn sequences . https://web.archive.org/web/20061002130346/http://www.theory.csc.uvic.ca/~cos/inf/neck/NecklaceInfo.html . 2006-10-02 . 2006 .