Accounting for reflections and rotations in combinatorial strings taken from multisets

362 Views Asked by At

I have a $n$-element string taken from a $k$-element multiset. I want to treat reflections and rotations of strings as really the same string. How do I count that?

Edit: Here's an example. I have a string $(A,A,A,A,C,C,D,D,D)$ and I want to count all the permutations of it, accounting for reflections being the same, and further that if we consider the "ends" of the string as connected, each rotation of that will end up being identical as well.

1

There are 1 best solutions below

0
On BEST ANSWER

As explained in the wiki link given, your example is a size n=9 bracelet over k=4 colours. As a necklace it has $N_k(n)=\frac{\sum _d^{\text{Divisors}[n]} \phi (d) k^{n/d}}{n}$ so 29144 different constellations.
As a bracelet, it has $B_k(n)=\text{If}\left[\text{EvenQ}[n],\frac{1}{4} (k+1) k^{n/2},\frac{1}{2} k^{\frac{n}{2}+\frac{1}{2}}\right]+N_k(n)/2$
so 15084 different ones.