Necklace (combinatorics)#Aperiodic necklaces
File:Bracelets33.svg, so there are 4 necklaces.
Compare box(6,9) in the triangle.]]
File:Tantrix tiles ryg.svg, corresponding to the 16 necklaces with 2 red, 2 yellow and 2 green beads.]]
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 =
{{main | Necklace polynomial }}
There are
:
different k-ary necklaces of length n, where is Euler's totient function.{{MathWorld|id=Necklace|title=Necklace}}
When the beads are restricted to particular color multiset , where is the number of beads of color , there are
:
different necklaces made of all the beads of . {{cite web |first=Frank |last=Ruskey |url=http://www.theory.csc.uvic.ca/~cos/inf/neck/NecklaceInfo.html |archive-url=https://web.archive.org/web/20061002130346/http://www.theory.csc.uvic.ca/~cos/inf/neck/NecklaceInfo.html |archive-date=2006-10-02 |title=Info on necklaces, Lyndon words, De Bruijn sequences |date=2006 }}
Here and
:= \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 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.
{{OEIS|A054631}} and {{OEIS|A087854}} are related via the Binomial coefficients:
:
and
:
= Number of bracelets =
The number of different k-ary bracelets of length n {{OEIS|A081720}} is
:
\tfrac12 N_k(n) + \tfrac14 (k+1)k^{n/2} & \text{if }n\text{ is even} \\[10px]
\tfrac12 N_k(n) + \tfrac12 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 .
Case of distinct beads
File:Partition necklaces by integer partition.svg
(set partitions up to rotation and reflection)]]
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 {{sfrac|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 {{sfrac|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
:
different k-ary aperiodic necklaces of length n, where μ is the Möbius function. The two necklace-counting functions are related by: where the sum is over all divisors of n, which is equivalent by Möbius inversion to
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
{{reflist}}
External links
- {{Cite book |last1=Polya |first1=Georg |last2=Read |first2=R.C. |last3=Aeppli |first3=Dorothee |title=Combinatorial enumeration of groups, graphs, and chemical compounds |publisher=Springer-Verlag |year=1987 |isbn=9780387964133}}
- {{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=}}