Tool for calculating the circular permutations of a set of elements, and for generating and visualizing the possible circular arrangements.
Circular Permutations - dCode
Tag(s) : Combinatorics
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
A circular permutation is an arrangement of $ n $ elements around a circle, in which there is no distinguished starting position. Two arrangements are considered identical if one can be obtained from the other by rotating the circle.
Example: ABC, BCA and CAB represent the same circular permutation
Mathematically, circular permutations correspond to equivalence classes of linear permutations under the action of the cyclic group $ C_n $
A classical (linear) permutation has a starting position and an ending position. In a circular permutation, no starting position is distinguished.
To visualise this difference, imagine a circle: cutting the circle at different points produces several different linear lists, but only one circular arrangement.
For $ n $ distinct elements, the number of circular permutations is: $ (n-1)! $
Indeed, by fixing one element arbitrarily, the remaining $ n-1 $ elements can be permuted freely. There are therefore $ (n-1)! $ arrangements.
Example: For $ n = 4 $, there are $ 4! = 24 $ linear permutations, but only $ 3! = 6 $ circular permutations
For distinct elements, it is possible to choose a starting point for each rotation class.
1 - fix one element
2 - generate all permutations of the remaining $ n-1 $ elements using backtracking
3 - add the fixed element at the beginning of each generated permutation
Each resulting permutation then represents a different circular permutation, without duplicates.
Circular permutations arise in many problems where no starting position is distinguished.
— seating guests around a round table
— arranging cyclic sequences or patterns
— counting necklaces of beads or coloured objects
— studying circular biological sequences (some bacterial genomes)
— combinatorial problems involving cycles or periodic configurations
dCode retains ownership of the "Circular Permutations" source code. Any algorithm for the "Circular Permutations" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Circular Permutations" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Circular Permutations" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Circular Permutations" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Circular Permutations on dCode.fr [online website], retrieved on 2026-09-29,