- Source: Necklace (combinatorics)
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
=There are
N
k
(
n
)
=
1
n
∑
d
∣
n
φ
(
d
)
k
n
/
d
=
1
n
∑
i
=
1
n
k
g
c
d
(
i
,
n
)
{\displaystyle N_{k}(n)={\frac {1}{n}}\sum _{d\mid n}\varphi (d)k^{n/d}={\frac {1}{n}}\sum _{i=1}^{n}k^{\,{\rm {gcd}}(i,n)}}
different k-ary necklaces of length n, where
φ
{\displaystyle \varphi }
is Euler's totient function.
When the beads are restricted to particular color multiset
B
=
{
1
n
1
,
…
,
k
n
k
}
{\displaystyle {\mathcal {B}}=\{1^{n_{1}},\ldots ,k^{n_{k}}\}}
, where
n
i
{\displaystyle n_{i}}
is the number of beads of color
i
∈
{
1
,
…
,
k
}
{\displaystyle i\in \{1,\ldots ,k\}}
, there are
N
(
B
)
=
1
|
B
|
∑
d
|
g
c
d
(
n
1
,
…
,
n
k
)
(
|
B
|
/
d
n
1
/
d
,
…
,
n
k
/
d
)
ϕ
(
d
)
{\displaystyle N({\mathcal {B}})={\frac {1}{|{\mathcal {B}}|}}\sum _{d|{\rm {gcd}}(n_{1},\ldots ,n_{k})}{|{\mathcal {B}}|/d \choose n_{1}/d,\ldots ,n_{k}/d}\phi (d)}
different necklaces made of all the beads of
B
{\displaystyle {\mathcal {B}}}
.
Here
|
B
|
:=
∑
i
=
1
k
n
i
{\displaystyle |{\mathcal {B}}|:=\sum \limits _{i=1}^{k}n_{i}}
and
(
m
m
1
,
…
,
m
k
)
:=
m
!
m
1
!
⋯
m
k
!
{\displaystyle {m \choose m_{1},\ldots ,m_{k}}:={\frac {m!}{m_{1}!\cdots m_{k}!}}}
is the multinomial coefficient.
These two formulas follow directly from Pólya's enumeration theorem applied to the action of the cyclic group
C
n
{\displaystyle C_{n}}
acting on the set of all functions
f
:
{
1
,
…
,
n
}
→
{
1
,
…
,
k
}
{\displaystyle f:\{1,\ldots ,n\}\to \{1,\ldots ,k\}}
.
If all k colors must be used, the count is
L
k
(
n
)
=
k
!
n
∑
d
∣
n
φ
(
d
)
S
(
n
d
,
k
)
,
{\displaystyle L_{k}(n)={\frac {k!}{n}}\sum _{d\mid n}\varphi (d)S\left({\frac {n}{d}},k\right)\;,}
where
S
(
n
,
k
)
{\displaystyle S(n,k)}
are the Stirling number of the second kind.
N
k
(
n
)
{\displaystyle N_{k}(n)}
(sequence A054631 in the OEIS) and
L
k
(
n
)
{\displaystyle L_{k}(n)}
(sequence A087854 in the OEIS) are related via the Binomial coefficients:
N
k
(
n
)
=
∑
j
=
1
k
(
k
j
)
L
j
(
n
)
{\displaystyle N_{k}(n)=\sum _{j=1}^{k}{\binom {k}{j}}L_{j}(n)}
and
L
k
(
n
)
=
∑
j
=
1
k
(
−
1
)
k
−
j
(
k
j
)
N
j
(
n
)
{\displaystyle L_{k}(n)=\sum _{j=1}^{k}(-1)^{k-j}{\binom {k}{j}}N_{j}(n)}
= Number of bracelets
=The number of different k-ary bracelets of length n (sequence A081720 in the OEIS) is
B
k
(
n
)
=
{
1
2
N
k
(
n
)
+
1
4
(
k
+
1
)
k
n
/
2
if
n
is even
1
2
N
k
(
n
)
+
1
2
k
(
n
+
1
)
/
2
if
n
is odd
,
{\displaystyle B_{k}(n)={\begin{cases}{\tfrac {1}{2}}N_{k}(n)+{\tfrac {1}{4}}(k+1)k^{n/2}&{\text{if }}n{\text{ is even}}\\[10px]{\tfrac {1}{2}}N_{k}(n)+{\tfrac {1}{2}}k^{(n+1)/2}&{\text{if }}n{\text{ is odd}}\end{cases}}\quad ,}
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
D
n
{\displaystyle D_{n}}
.
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!/n = (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 n!/2n, 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
∑
d
∣
n
μ
(
d
)
k
n
/
d
{\displaystyle M_{k}(n)={\frac {1}{n}}\sum _{d\mid n}\mu (d)k^{n/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
)
=
∑
d
|
n
M
k
(
d
)
,
{\textstyle N_{k}(n)=\sum _{d|n}M_{k}(d),}
where the sum is over all divisors of n, which is equivalent by Möbius inversion to
M
k
(
n
)
=
∑
d
|
n
N
k
(
d
)
μ
(
n
d
)
.
{\textstyle M_{k}(n)=\sum _{d|n}N_{k}(d)\,\mu {\bigl (}{\tfrac {n}{d}}{\bigr )}.}
Each aperiodic necklace contains a single Lyndon word so that Lyndon words form representatives of aperiodic necklaces.
See also
Lyndon word
Inversion (discrete mathematics)
Necklace problem
Necklace splitting problem
Permutation
Proofs of Fermat's little theorem#Proof by counting necklaces
Forte number, a representation of binary bracelets of length 12 used in atonal music.
References
External links
Polya, Georg; Read, R.C.; Aeppli, Dorothee (1987). Combinatorial enumeration of groups, graphs, and chemical compounds. Springer-Verlag. ISBN 9780387964133.
Ruskey, Frank; Savage, Carla; Wang, Terry Min Yih (1992). "Generating necklaces". Journal of Algorithms. 13 (3): 414–430. doi:10.1016/0196-6774(92)90047-G.
Kata Kunci Pencarian:
- Necklace (combinatorics)
- Necklace problem
- Combinatorics
- Necklace polynomial
- Necklace (disambiguation)
- Cycle
- Index of combinatorics articles
- Necklace splitting problem
- Topological combinatorics
- Combinatorics on words