
In
combinatorics
Combinatorics is an area of mathematics primarily concerned with counting, both as a means and as an end to obtaining results, and certain properties of finite structures. It is closely related to many other areas of mathematics and has many ...
, a ''k''-ary necklace of length ''n'' is an
equivalence class
In mathematics, when the elements of some set S have a notion of equivalence (formalized as an equivalence relation), then one may naturally split the set S into equivalence classes. These equivalence classes are constructed so that elements ...
of ''n''-character
string
String or strings may refer to:
*String (structure), a long flexible structure made from threads twisted together, which is used to tie, bind, or hang other objects
Arts, entertainment, and media Films
* ''Strings'' (1991 film), a Canadian anim ...
s over an
alphabet
An alphabet is a standard set of letter (alphabet), letters written to represent particular sounds in a spoken language. Specifically, letters largely correspond to phonemes as the smallest sound segments that can distinguish one word from a ...
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
In celestial mechanics, an orbit (also known as orbital revolution) is the curved trajectory of an object such as the trajectory of a planet around a star, or of a natural satellite around a planet, or of an artificial satellite around an ...
of the
cyclic group
In abstract algebra, a cyclic group or monogenous group is a Group (mathematics), group, denoted C_n (also frequently \Z_n or Z_n, not to be confused with the commutative ring of P-adic number, -adic numbers), that is Generating set of a group, ge ...
acting
Acting is an activity in which a story is told by means of its enactment by an actor who adopts a character—in theatre, television, film, radio, or any other medium that makes use of the mimetic mode.
Acting involves a broad range of sk ...
on ''n''-character strings over an alphabet of size ''k'', and a bracelet as an orbit of the
dihedral group
In mathematics, a dihedral group is the group (mathematics), group of symmetry, symmetries of a regular polygon, which includes rotational symmetry, rotations and reflection symmetry, reflections. Dihedral groups are among the simplest example ...
. One can count these orbits, and thus necklaces and bracelets, using
Pólya's enumeration theorem.
Equivalence classes
Number of necklaces
There are
:
different ''k''-ary necklaces of length ''n'', where
is
Euler's totient function
In number theory, Euler's totient function counts the positive integers up to a given integer that are relatively prime to . It is written using the Greek letter phi as \varphi(n) or \phi(n), and may also be called Euler's phi function. In ot ...
.
When the beads are restricted to particular color
multiset
In mathematics, a multiset (or bag, or mset) is a modification of the concept of a set that, unlike a set, allows for multiple instances for each of its elements. The number of instances given for each element is called the ''multiplicity'' of ...
, where
is the number of beads of color
, there are
:
different necklaces made of all the beads of
.
Here
and
is the
multinomial coefficient
In mathematics, the multinomial theorem describes how to expand a power of a sum in terms of powers of the terms in that sum. It is the generalization of the binomial theorem from binomials to multinomials.
Theorem
For any positive integer ...
.
These two formulas follow directly from
Pólya's enumeration theorem applied to the action of the cyclic group
acting on the set of all functions
.
If all ''k'' colors must be used, the count is
:
where
are the
Stirling number of the second kind
In mathematics, particularly in combinatorics, a Stirling number of the second kind (or Stirling partition number) is the number of ways to partition a set of ''n'' objects into ''k'' non-empty subsets and is denoted by S(n,k) or \textstyle \lef ...
.
and
are related via the
Binomial coefficients
In mathematics, the binomial coefficients are the positive integers that occur as coefficients in the binomial theorem. Commonly, a binomial coefficient is indexed by a pair of integers and is written \tbinom. It is the coefficient of the te ...
:
:
and
:
Number of bracelets
The number of different ''k''-ary bracelets of length ''n'' is
:
where ''N''
''k''(''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
In mathematics, a dihedral group is the group (mathematics), group of symmetry, symmetries of a regular polygon, which includes rotational symmetry, rotations and reflection symmetry, reflections. Dihedral groups are among the simplest example ...
.
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
multiset
In mathematics, a multiset (or bag, or mset) is a modification of the concept of a set that, unlike a set, allows for multiple instances for each of its elements. The number of instances given for each element is called the ''multiplicity'' of ...
s 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
In mathematics, when the elements of some set S have a notion of equivalence (formalized as an equivalence relation), then one may naturally split the set S into equivalence classes. These equivalence classes are constructed so that elements ...
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
:
different ''k''-ary aperiodic necklaces of length ''n'', where ''μ'' is the
Möbius function
The Möbius function \mu(n) is a multiplicative function in number theory introduced by the German mathematician August Ferdinand Möbius (also transliterated ''Moebius'') in 1832. It is ubiquitous in elementary and analytic number theory and m ...
. The two necklace-counting functions are related by:
where the sum is over all divisors of ''n'', which is equivalent by
Möbius inversion
Moebius, Mœbius, Möbius or Mobius may refer to:
People
* August Ferdinand Möbius (1790–1868), German mathematician and astronomer
* Friedrich Möbius (art historian) (1928–2024), German art historian and architectural historian
* Theodor ...
to
Each aperiodic necklace contains a single
Lyndon word
In mathematics, in the areas of combinatorics and computer science, a Lyndon word is a nonempty string that is strictly smaller in lexicographic order than all of its rotations. Lyndon words are named after mathematician Roger Lyndon, who investi ...
so that Lyndon words form
representatives of aperiodic necklaces.
See also
*
Lyndon word
In mathematics, in the areas of combinatorics and computer science, a Lyndon word is a nonempty string that is strictly smaller in lexicographic order than all of its rotations. Lyndon words are named after mathematician Roger Lyndon, who investi ...
*
Inversion (discrete mathematics)
In computer science and discrete mathematics, an inversion in a sequence is a pair of elements that are out of their natural total order, order.
Definitions
Inversion
Let \pi be a permutation.
There is an inversion of \pi between i and j if ...
*
Necklace problem
The necklace problem is a problem in recreational mathematics concerning the reconstruction of necklaces (cyclic arrangements of binary values) from partial information.
Formulation
The necklace problem involves the reconstruction of a neckla ...
*
Necklace splitting problem
Necklace splitting is a picturesque name given to several related problems in combinatorics and measure theory. Its name and solutions are due to mathematicians Noga Alon and Douglas B. West.
The basic setting involves a necklace with beads of ...
*
Permutation
In mathematics, a permutation of a set can mean one of two different things:
* an arrangement of its members in a sequence or linear order, or
* the act or process of changing the linear order of an ordered set.
An example of the first mean ...
*
Proofs of Fermat's little theorem#Proof by counting necklaces
*
Forte number, a representation of binary bracelets of length 12 used in
atonal music
Atonality in its broadest sense is music that lacks a tonal center, or key. ''Atonality'', in this sense, usually describes compositions written from about the early 20th-century to the present day, where a hierarchy of harmonies focusing on a ...
.
References
External links
*
* {{cite journal , first=Frank , last=Ruskey , first2=Carla , last2=Savage , first3=Terry Min Yih , last3=Wang , title=Generating necklaces , journal=Journal of Algorithms , volume=13 , issue=3 , pages=414–430 , date=1992 , doi=10.1016/0196-6774(92)90047-G , url=
Combinatorics on words
Enumerative combinatorics