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 then 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, 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.
Number of necklaces
different k-ary necklaces of length n, where is Euler's totient function. This follows directly from Pólya's enumeration theorem applied to the action of the cyclic group acting on the set of all functions .
Number of bracelets
different k-ary bracelets of length n, 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 .
If there are n beads, all distinct, on a necklace joined at the ends, then the number of distinct orderings on the necklace, after allowing for rotations, is n!/, for n > 0. This may also be expressed as (n − 1)!. This number is less than the general case, which lacks the requirement that each bead must be distinct.
An intuitive justification for this can be given. If there is a line of n distinct objects ("beads"), the number of combinations would be n!. If the ends are joined together, the number of combinations are divided by n, as it is possible to rotate the string of n beads into n positions.
If there are n beads, all distinct, on a bracelet joined at the ends, then the number of distinct orderings on the bracelet, after allowing for rotations and reflection, is n!/, for n > 2. Note that this number is less than the general case of Bn(n), which lacks the requirement that each bead must be distinct.
To explain this, one may begin with the count for a necklace. This number can be further divided by 2, because it is also possible to flip the bracelet over.
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 equivlent by Möbius inversion to
- Lyndon word
- Inversion (discrete mathematics)
- Necklace problem
- Necklace splitting problem
- Proofs of Fermat's little theorem#Proof by counting necklaces
- Forte number, a representation of binary bracelets of length 12 used in atonal music.