1

I suspect that the answer to my question might be trivially found in the Wikipedia page for the combinatorial concept of a necklace, but I'm finding that page very hard to understand.

Suppose I have $N$ beads in $k$ available colors, where I've fixed the number of beads of each color. That is, I specify a particular $k$-tuple of nonnegative integers $(n_1, n_2, \dots, n_k)$ such that $\sum \limits_{i=1}^k n_i = N$, where $n_i$ ($i = 1, \dots, k$) is the number of beads of the $i$th color. Then how many (fixed) necklaces can be made from these beads? I.e. how many length-$n$ strings are there over an alphabet of size $k$ if we fix the total number of appearances of each character in the alphabet and we identify strings that are related by circular shifts?

If I understand the Wikipedia article correctly, the first equation gives the total number of necklaces if we only fix the number $k$ of available colors, but sum over all possible specific $k$-tuples that represent a particular partition of the beads into the different colors. But what if we know the exact partition? I don't understand the second equation on the Wikipedia page, because I don't understand what they mean by a "necklace of length $n$ with exactly $k$ different colored beads", or how this is different from the situation that the previous equation considers.

(If it makes things easier, you can feel free to assume that the $n_i$ are all positive rather than nonnegative, so that $k$ represents the number of colors that actually appear rather than the number of colors that are available. This changes the number of valid $k$-tuples, but I don't think it really matters much if we're specifying a particular $k$-tuple.)

tparker
  • 6,756
  • I am unsure what the relationship is between a necklace and a circular arrangement. I will offer the following example for a circular arrangement. Suppose that $~n_1, ~n_2, ~n_3, ~n_4 \in \Bbb{Z^+},$ with $n_1 + n_2 + n_3 + n_4 = N.$ Further suppose that you start with the simple problem of how many ways of arranging the items in a row. The enumeration is $$\binom{N}{n_1} \times \binom{N - n_1}{n_2} \times \binom{N - n_1 - n_2}{n_3} .$$ ...see next comment – user2661923 Nov 30 '21 at 04:38
  • Then, the question is : how to adjust for the items being placed in a circle, rather than a row? Answer: simply multipy by $~\displaystyle \frac{1}{N},~$ which reflects that there are $N$ places that may be indistinguishably designated as the head of the circle. – user2661923 Nov 30 '21 at 04:41
  • You may be interested in a similar question: https://math.stackexchange.com/questions/4213424/number-of-ways-to-arrange-objects-in-a-circle-some-of-which-may-be-identical/4213683#4213683 – awkward Nov 30 '21 at 16:20
  • @awkward That question is a duplicate, but I am hesitant to close it as a duplicate, since the accepted answer you gave is needlessly complicated. Sure, you can apply the full Polya theory, but in the end the answer is a simple summation, without need for taking coefficients of any multivariate generating functions. Would you allow me to add my formula to your answer, so I can close as duplicate? – Mike Earnest Nov 30 '21 at 17:05
  • @MikeEarnest Certainly, if you would like to add a formula to that answer, go ahead. – awkward Nov 30 '21 at 23:53

1 Answers1

2

The number of linear arrangements of beads in $k$ colors distributed like $(n_1,\dots,n_k)$ is simply the multinomial coefficient $$\binom{n}{n_1,\dots,n_k},$$ where $n=n_1+\dots+n_k$. For circular arrangements, the answer is instead $$ \boxed{\frac1{n}\sum_{d|\gcd(n_1,\dots,n_k)}\varphi(d)\binom{n/d}{n_1/d,\dots,n_k/d},} $$ where $\varphi$ is the totient function.

This can be proven using Burnside's lemma. Namely, when enumerating necklaces that have rotational symmetry by $(360/d)^\circ$ degrees, we see they must consist of $d$ identical linear sections of beads of length $n/d$, which can be chosen in $\binom{n/d}{n_1/d,\dots,n_k/d}$ ways. For this to be possible, all of the bead counts must be divisible by $d$, hence the $d\mid \gcd(n_1,\dots,n_k)$ condition. Finally, for each divisor $d$ of $\gcd(n_1,\dots,n_k)$, there are $\varphi(d)$ rotations with the same number of symmetries as rotation $(360/d)^\circ$. For example, when $d=12$, the equivalent symmetries are $30^\circ,150^\circ,210^\circ,$ and $330^\circ$.

Mike Earnest
  • 84,902