Bookmarks    
nPr and nCr    
Random Number    
SD Calculator    
Sample Size    
Percent Error    
Density    
Molarity    
Molar Mass    
Ohm's Law    
Watts to Amps    
Voltage Drop    
Long Division    
Mixed Numbers    
Rounding    
Nth Root    
Exponents    
Half-Life    
Polar Form    
De Moivre    
3D Distance    
Point to Line    
Cross Product    
Determinant    
Sin Cos Tan    
Triangle Area    
Scale Factor    
Sector Area    
Ellipse Area    
Cube Volume    
Box Volume    
Sphere Volume    
Cone Volume    
Pipe Volume    
Time Duration    
Time Card    
Present Value    
Future Value    
Churn Rate    
A/B Test Calc    
SEO Traffic    
Ideal Weight    
Fat Intake    
Child Height    
Golf Handicap    
Heat Index    
Wind Chill    
Dew Point    
Download Time    
kWh to Cost    
AC Size (BTU)    
Heating Costs    
LED Savings    
Trip Gas Cost    
Tire Size    
Solar Output    
Solar Payback    
Battery Size    
Wall Area    
Gravel Needed    
Mortar Mix    
Slope Grade    
Curtain Size    
Soil Needed    
Sod Needed    
Ramp Length    
Blind Size    
Drain Slope    
Board Feet    
Heat Loss    
Furniture Fit    
Moving Boxes    
Plywood Cuts    
Shelf Sag    
   Add
Probability and random number calculators
Independent Events
Independent Events
Two Events Solver
Two Events Solver
Repeated Trials
Repeated Trials
Bayes' Theorem
Bayes' Theorem
Expected Value
Expected Value
Binomial Distribution
Binomial Distribution
nPr and nCr
nPr and nCr
Circular Permutation
Circular Permutation
With Repetition
With Repetition
Random Number
Random Number
Averages and statistics calculators
Average Calculator
Average Calculator
Mean Median Mode
Mean Median Mode
SD Calculator
SD Calculator
Quartiles & IQR
Quartiles & IQR
Frequency Table
Frequency Table
Correlation (r)
Correlation (r)
Normal Probability
Normal Probability
Z-Score Calculator
Z-Score Calculator
Confidence Interval
Confidence Interval
Sample Size
Sample Size
Mark & Recapture
Mark & Recapture
P-Value Calculator
P-Value Calculator
Percentage and ratio calculators
Percentage Calc
Percentage Calc
Percent Change
Percent Change
Percent Difference
Percent Difference
Percent Error
Percent Error
Ratio Calculator
Ratio Calculator
Discount Calculator
Discount Calculator
Sales Tax Calculator
Sales Tax Calculator
Margin Calculator
Margin Calculator
Speed calculators
Speed Calculator
Speed Calculator
Density and concentration calculators
Density
Density
Molarity
Molarity
Molar Mass
Molar Mass
Physics and electricity calculators
Ohm's Law
Ohm's Law
Watts to Amps
Watts to Amps
Resistor Colors
Resistor Colors
Voltage Drop
Voltage Drop
Unit conversion calculators
Weight Converter
Weight Converter
Shoe Size Converter
Shoe Size Converter
Integer and signed number calculators
Long Division
Long Division
LCM Calculator
LCM Calculator
GCF Calculator
GCF Calculator
Integer Calculator
Integer Calculator
Prime Factorization
Prime Factorization
Diophantine Solver
Diophantine Solver
Modulo Calculator
Modulo Calculator
Factor Calculator
Factor Calculator
Roman Numerals
Roman Numerals
Fraction, decimal and rounding calculators
Fraction Calculator
Fraction Calculator
Mixed Numbers
Mixed Numbers
Simplify Fractions
Simplify Fractions
Fraction to Decimal
Fraction to Decimal
Decimal to Fraction
Decimal to Fraction
Rounding
Rounding
Equation and inequality calculators
Linear Equation
Linear Equation
Linear Systems
Linear Systems
Quadratic Formula
Quadratic Formula
Absolute Value
Absolute Value
Quadratic Inequality
Quadratic Inequality
Polynomial calculators
Binomial Theorem
Binomial Theorem
Square root and nth root calculators
Simplify Radicals
Simplify Radicals
Nth Root
Nth Root
Exponent and logarithm calculators
Exponents
Exponents
Log Calculator
Log Calculator
Number of Digits
Number of Digits
Scientific Notation
Scientific Notation
Sci. Notation Math
Sci. Notation Math
Half-Life
Half-Life
Complex number calculators
Complex Numbers
Complex Numbers
Polar Form
Polar Form
De Moivre
De Moivre
Function and graph calculators
Slope Calculator
Slope Calculator
Linear Function
Linear Function
Direct & Inverse Variation
Direct & Inverse Variation
y = ax² Calculator
y = ax² Calculator
Distance Formula
Distance Formula
3D Distance
3D Distance
Section Formula
Section Formula
Point to Line
Point to Line
Lat/Long Distance
Lat/Long Distance
Complete the Square
Complete the Square
Circle Equation
Circle Equation
Conic Sections
Conic Sections
Polar Coordinates
Polar Coordinates
Sequence calculators
Arithmetic Sequence
Arithmetic Sequence
Geometric Sequence
Geometric Sequence
Fibonacci Sequence
Fibonacci Sequence
Recurrence Relation
Recurrence Relation
Vector calculators
Vector Calculator
Vector Calculator
Cross Product
Cross Product
Matrix calculators
Matrix Calculator
Matrix Calculator
Determinant
Determinant
Inverse Matrix
Inverse Matrix
Plane geometry calculators
Sin Cos Tan
Sin Cos Tan
Degrees ⇔ Radians
Degrees ⇔ Radians
a sin θ + b cos θ
a sin θ + b cos θ
Triangle Solver
Triangle Solver
Triangle Area
Triangle Area
Right Triangle
Right Triangle
Pythagorean Theorem
Pythagorean Theorem
Polygon Angles
Polygon Angles
Scale Factor
Scale Factor
Parallel Lines
Parallel Lines
Rectangle Area
Rectangle Area
Parallelogram Area
Parallelogram Area
Trapezoid Area
Trapezoid Area
Circle Calculator
Circle Calculator
Sector Area
Sector Area
Inscribed Angle
Inscribed Angle
Ellipse Area
Ellipse Area
Solid geometry calculators
Cube Volume
Cube Volume
Cube Surface Area
Cube Surface Area
Box Volume
Box Volume
Box Surface Area
Box Surface Area
Cylinder Volume
Cylinder Volume
Cylinder Surface
Cylinder Surface
Sphere Volume
Sphere Volume
Sphere Surface
Sphere Surface
Spherical Cap Volume
Spherical Cap Volume
Cap Surface Area
Cap Surface Area
Ellipsoid Volume
Ellipsoid Volume
Ellipsoid Surface
Ellipsoid Surface
Pyramid Volume
Pyramid Volume
Pyramid Surface
Pyramid Surface
Cone Volume
Cone Volume
Cone Surface Area
Cone Surface Area
Frustum Volume
Frustum Volume
Frustum Surface Area
Frustum Surface Area
Pipe Volume
Pipe Volume
Capsule Volume
Capsule Volume
Capsule Surface Area
Capsule Surface Area
Date and time calculators
Age Calculator
Age Calculator
Days Between Dates
Days Between Dates
Date Calculator
Date Calculator
Hours From Now
Hours From Now
Day of the Week
Day of the Week
Time Calculator
Time Calculator
Time Zone Converter
Time Zone Converter
Hours Calculator
Hours Calculator
Time Duration
Time Duration
Time Card
Time Card
Finance and economics calculators
Compound Interest
Compound Interest
Simple Interest
Simple Interest
Interest Calculator
Interest Calculator
TVM Calculator
TVM Calculator
Present Value
Present Value
Future Value
Future Value
ROI Calculator
ROI Calculator
IRR Calculator
IRR Calculator
Payback Period
Payback Period
Average Return
Average Return
GDP Calculator
GDP Calculator
Web marketing and ad metric calculators
CTR Calculator
CTR Calculator
Conversion Rate
Conversion Rate
CPC, CPM & CPA
CPC, CPM & CPA
ROAS Calculator
ROAS Calculator
Break-Even CPA
Break-Even CPA
LTV Calculator
LTV Calculator
CAC Calculator
CAC Calculator
Churn Rate
Churn Rate
A/B Test Calc
A/B Test Calc
A/B Sample Size
A/B Sample Size
SEO Traffic
SEO Traffic
Break-Even Point
Break-Even Point
Markup vs. Margin
Markup vs. Margin
CAGR Calculator
CAGR Calculator
Health and fitness calculators
BMI Calculator
BMI Calculator
Sleep Calculator
Sleep Calculator
Calorie Calculator
Calorie Calculator
BMR Calculator
BMR Calculator
TDEE Calculator
TDEE Calculator
Ideal Weight
Ideal Weight
Body Fat Calculator
Body Fat Calculator
Lean Body Mass
Lean Body Mass
Calories Burned
Calories Burned
Protein Intake
Protein Intake
Macro Calculator
Macro Calculator
Carb Calculator
Carb Calculator
Fat Intake
Fat Intake
Child Height
Child Height
Sports calculators
Golf Handicap
Golf Handicap
Pace Calculator
Pace Calculator
1RM Calculator
1RM Calculator
Target Heart Rate
Target Heart Rate
Weather calculators
Heat Index
Heat Index
Wind Chill
Wind Chill
Dew Point
Dew Point
Computer calculators
Base Converter
Base Converter
Subnet Calculator
Subnet Calculator
Download Time
Download Time
Household energy and budget calculators
Electricity Cost
Electricity Cost
kWh to Cost
kWh to Cost
Yearly kWh to Cost
Yearly kWh to Cost
AC Size (BTU)
AC Size (BTU)
AC Running Cost
AC Running Cost
Heating Costs
Heating Costs
Gas vs Electric
Gas vs Electric
LED Savings
LED Savings
Salary Calculator
Salary Calculator
Budget Calculator
Budget Calculator
Car calculators
Trip Gas Cost
Trip Gas Cost
EV Charging Cost
EV Charging Cost
EV vs Gas Cost
EV vs Gas Cost
MPG Calculator
MPG Calculator
Tire Size
Tire Size
Solar power and battery calculators
Solar Output
Solar Output
Solar Panel Count
Solar Panel Count
Solar Payback
Solar Payback
Battery Size
Battery Size
Home and DIY calculators
Tile Calculator
Tile Calculator
Stair Calculator
Stair Calculator
Concrete Volume
Concrete Volume
Wall Area
Wall Area
Wallpaper Rolls
Wallpaper Rolls
Paint Calculator
Paint Calculator
Flooring Needed
Flooring Needed
Exterior Walls
Exterior Walls
Gravel Needed
Gravel Needed
Mortar Mix
Mortar Mix
Slope Grade
Slope Grade
Lumber Cut List
Lumber Cut List
Lot Coverage/FAR
Lot Coverage/FAR
Sheet Vinyl Roll
Sheet Vinyl Roll
Insulation Needed
Insulation Needed
Curtain Size
Curtain Size
TV Size & Distance
TV Size & Distance
Soil Needed
Soil Needed
Sod Needed
Sod Needed
Block Calculator
Block Calculator
Brick Calculator
Brick Calculator
Deck Materials
Deck Materials
Ramp Length
Ramp Length
Pilot Hole Size
Pilot Hole Size
Room Ventilation
Room Ventilation
Paint Thinning
Paint Thinning
Baseboard & Trim
Baseboard & Trim
Blind Size
Blind Size
Picture Hanging
Picture Hanging
Drain Slope
Drain Slope
Screw Calculator
Screw Calculator
Board Feet
Board Feet
Fence Calculator
Fence Calculator
Wood Shrinkage
Wood Shrinkage
Caulk Calculator
Caulk Calculator
Heat Loss
Heat Loss
Furniture Fit
Furniture Fit
Moving Boxes
Moving Boxes
Storage Capacity
Storage Capacity
Plywood Cuts
Plywood Cuts
Shelf Sag
Shelf Sag

Circular Permutation Calculator (Round Table and Necklace)

Choose the type of arrangement and enter the number of items n. The calculator counts the ways to arrange them in a circle, with steps and a figure.

Enter n as a whole number from 1 to 1000. The r field is used only when you choose "r of n items in a circle". Answers are shown with every digit, no rounding.
Result and figure
Choose the type of arrangement and enter the number of items in the fields on the left, then press "Calculate". The result and a figure will appear here.

What you can do on this page

  • Enter the number of people to find how many ways \(n\) people can sit around a round table (circular permutations), \((n-1)!\)
  • It also handles choosing only \(r\) of \(n\) items and arranging them in a circle, \(\dfrac{{}_{n}\mathrm{P}_{r}}{r}\)
  • It finds necklace arrangements \(\dfrac{(n-1)!}{2}\), where arrangements that match when flipped over count as the same, as with a necklace (it also correctly handles \(n = 1,\ 2\), where simply dividing gives a wrong answer)
  • It counts seatings where 2 given people sit next to each other, or not, with steps that treat the 2 as one block
  • Answers are shown with every digit, no rounding. For long answers, an approximate value such as \(1.23\times10^{35}\) is added so you can see the size at a glance
  • Figures of rotating circles show why \(n!\) is divided by \(n\). Copy-and-paste formulas for Excel, Google Sheets and Python are also on this page
This page assumes all the items are different from each other (no identical items). For the permutations \({}_{n}\mathrm{P}_{r}\) and combinations \({}_{n}\mathrm{C}_{r}\) of items in a row, see the related pages at the bottom.

What is this calculation used for?

Planning seating at round tables (dinners, meetings and weddings)

At a round table, turning the whole table does not change who sits next to whom. So the number of seating plans is not the \(n!\) of a row but the circular permutations \((n-1)!\). That is 120 ways for 6 people and 5,040 ways for 8 people.
Requests like "seat these 2 together (or apart)" change the count a lot. With 6 people, there are 48 ways with 2 given people side by side and 72 ways with them apart. Instead of guessing, you can know exactly how many seating plans an event planner has to choose from.

Estimating the number of delivery routes (logistics and the traveling salesman problem)

Think of a route that visits \(n\) places once each and returns to the start, counting the depot as one of the stops. The same route is the same ring no matter where you start (rotation), and if each road is the same distance in both directions, driving it the other way gives the same distance (flipping). So the number of different routes is the same as the necklace arrangements, \(\dfrac{(n-1)!}{2}\).
With 10 stops including the depot, there are 181,440 routes, and with 15 stops, about \(4.36\times10^{10}\). Trying them all to find the shortest is not realistic, so route planning software uses clever shortcuts (optimization methods). This count is the reason why "just check every route" does not work.

Designing bracelets and necklaces (jewelry)

The number of designs for stringing \(n\) beads of different colors or shapes into a loop is the necklace arrangements, \(\dfrac{(n-1)!}{2}\). A loop is the same piece whether you turn it or flip it, so the circular permutations are divided by \(2\) again. That is 12 designs for 5 beads and 60 designs for 6 beads.
But if the piece has a front and a back that can be told apart and cannot be worn flipped, for example beads with a pattern on one side only, flips cannot count as the same. Then you do not divide by \(2\) and count the circular permutations \((n-1)!\) instead (120 for 6 beads). Whether it can be flipped alone doubles the number of designs.

The order of turns in board and card games

In many games, turns go around the table in one direction. The pattern of "who plays after whom" does not change if you rotate all the seats, so it is a circular permutation, \((n-1)!\). That is 6 patterns for 4 players and 24 for 5 players.
In games where going first is an advantage, you may also want to tell apart who starts. Then multiply the \((n-1)!\) turn patterns by the \(n\) choices of first player to get \(n!\) (24 for 4 players). Keeping "just the seating order" and "including the first player" separate makes it easier to think about fair ways to decide.

Setting up rotations for chores and shifts (school and work)

A rotation that goes through the list in order and returns to the top at the end is the same cycle no matter who starts, so it is counted as a circular permutation. A rotation of 5 people has \((5-1)! = 24\) possibilities.
Add the condition "these 2 must not be back to back (side by side)", and you subtract the cases where they are side by side from the total: \((n-1)! - 2 \times (n-2)!\). For 5 people, this narrows it down to 24 − 12 = 12. The formula shows clearly how adding a single condition cuts the choices in half.

Formulas and figures

Circular permutations \((n-1)!\) (all \(n\) items in a circle)
Figure
Standard notation (the usual math form)
\(N\) \(=\) \(\dfrac{n!}{n}\) \(=\) \((n-1)!\)
In words (symbols replaced with words)
③ \(N\): number of circular permutations \(=\) ① \(\dfrac{\text{ways to arrange }n\text{ items in a row, }n!}{\text{arrangements that match by rotation, }n}\) \(=\) ② \((n-1)!\): factorial of \(n-1\), one fewer
The formula in words
① The ways to arrange \(n\) items in a row, \(n!\), divided by the \(n\) arrangements that match by rotation is equal to the
② \((n-1)!\): factorial of \(n-1\), one fewer
③ and this gives the \(N\): number of circular permutations
Quick example
The number of ways \(4\) people can sit around a round table is
circular permutations of 4 people \(=\) \(\dfrac{\text{4 people in a row, }24\text{ ways}}{\text{match by rotation, }4\text{ ways}}\) \(=\) factorial of \(3\), \(3!\)
\(4! = 4 \times 3 \times 2 \times 1 = 24\)
\(\dfrac{24}{4} = 6\)
\((4-1)! = 3! = 3 \times 2 \times 1 = 6\)
Key idea
When you arrange things in a circle, the rule is that arrangements that match after a rotation count as the same 1 way. If you spin a round table with everyone seated, who sits next to whom does not change at all. The quickest way to see why we divide by \(n\) is to try it with \(4\) people A, B, C and D. The rows ABCD, BCDA, CDAB and DABC are all different as strings of letters. But put each one in a circle and read clockwise from the top, and they all make exactly the same ring: "B is to the right of A, C to the right of B, D to the right of C and A to the right of D". Each one just moves the first letter to the end. So each ring matches exactly \(n\) rows (you can shift \(n\) times in one full turn, no more and no fewer). The \(n!\) rows count each ring \(n\) times, so dividing by \(n\) removes the repeats and leaves the number of different rings. Another way to think about it is to fix one item. Once you decide one person's seat first, you can no longer rotate the arrangement into another one. The remaining \(n-1\) people are simply arranged, giving \((n-1)!\) ways. You reach the same answer without dividing.
Circular permutations \(\dfrac{{}_{n}\mathrm{P}_{r}}{r}\) (\(r\) of \(n\) items in a circle)
Figure
Standard notation (the usual math form)
\(N\) \(=\) \(\dfrac{{}_{n}\mathrm{P}_{r}}{r}\)
In words (symbols replaced with words)
② \(N\): number of ways to arrange in a circle \(=\) ① \(\dfrac{r\text{ of }n\text{ items in a row, }{}_{n}\mathrm{P}_{r}}{\text{arrangements that match by rotation, }r}\)
The formula in words
① The ways to arrange \(r\) of \(n\) items in a row, \({}_{n}\mathrm{P}_{r}\), divided by the \(r\) arrangements that match by rotation is the
② \(N\): number of ways to arrange in a circle
Quick example
The number of ways to choose \(3\) of \(8\) people and seat them at a round table for 3 is
circular permutations of 3 of 8 people \(=\) \(\dfrac{\text{3 of 8 people in a row, }336\text{ ways}}{\text{match by rotation, }3\text{ ways}}\)
\({}_{8}\mathrm{P}_{3} = 8 \times 7 \times 6 = 336\)
\(\dfrac{336}{3} = 112\)
Key idea
Picture a round table with only \(r\) seats, filled with people chosen from \(n\) candidates. Only \(r\) things are in the circle, so the arrangements that match by rotation come in groups of \(r\). Be careful not to divide by \(n\) by mistake. When \(r = n\), \({}_{n}\mathrm{P}_{n} = n!\), so \(\dfrac{n!}{n} = (n-1)!\), which matches the previous formula exactly. In other words, this is the general form, and \((n-1)!\) is a special case of it.
Necklace arrangements \(\dfrac{(n-1)!}{2}\) (flips count as the same)
Figure
Standard notation (the usual math form)
\(M\) \(=\) \(\dfrac{(n-1)!}{2}\)
In words (symbols replaced with words)
② \(M\): number of necklace arrangements \(=\) ① \(\dfrac{\text{circular permutations, }(n-1)!}{\text{arrangements that match by flipping, }2}\)
The formula in words
① The number of circular permutations \((n-1)!\), divided by the \(2\) arrangements that match by flipping is the
② \(M\): number of necklace arrangements (when \(n\) is \(3\) or more)
Quick example
The number of ways to string \(5\) beads of different colors into a bracelet is
necklace arrangements of 5 beads \(=\) \(\dfrac{\text{circular, 5 beads, }24\text{ ways}}{\text{match by flipping, }2\text{ ways}}\)
\((5-1)! = 4! = 24\)
\(\dfrac{24}{2} = 12\)
Key idea
Flip a necklace or bracelet over on a table, and left and right swap. Whether you rotate the ring or flip it, it is still the same piece of jewelry, so we divide the circular permutations by \(2\) once more. You can also think of it as "\(n\) matches by rotation and \(2\) by flipping, so the arrangements come in groups of \(2n\)", and write \(\dfrac{n!}{2n}\). It is the same thing. What separates circular permutations from necklace arrangements is whether you can pick the ring up and turn it over. You cannot turn a round table over with people sitting at it, so seating is a circular permutation. You can pick up a bracelet and flip it, so it is a necklace arrangement. If a problem mentions a ring, necklace, bracelet, key ring or garland, check whether flips count. That habit keeps you from mixing them up. Watch out for \(n = 1\) and \(n = 2\). A ring of 1 or 2 beads looks exactly the same when flipped. The arrangements do not come in pairs, so using the formula as is gives \(\dfrac{1}{2}\) way. The correct answer is \(1\) way in both cases (this calculator handles these cases automatically). For \(n = 3\) or more, every arrangement always pairs up with its flipped version, so dividing by \(2\) counts them correctly.
Circular permutations with 2 given items side by side, \(2 \times (n-2)!\)
Figure
Standard notation (the usual math form)
\(A\) \(=\) \((n-2)!\) \(\times\) \(2\)
In words (symbols replaced with words)
③ \(A\): arrangements with the 2 side by side \(=\) ① \((n-2)!\): circular permutations of \(n-1\) things, with the block as one \(\times\) ② \(2\): orders of the 2 inside the block
The formula in words
① Take the \((n-2)!\): circular permutations of \(n-1\) things, treating the 2 that must be together as one block
② multiply by the \(2\): orders of the 2 inside the block
③ and you get the \(A\): arrangements with the 2 side by side
Quick example
When \(6\) people sit around a round table, the number of ways Alex and Sam sit next to each other is
ways with the 2 side by side \(=\) circular, 5 things with the 2 as a block, \(4!\) \(\times\) orders of the 2 in the block, \(2\)
\((6-2)! = 4! = 24\)
\(24 \times 2 = 48\)
Key idea
For the condition "must be side by side", the standard move is to tie the 2 together into one block. If 2 of 6 people become one block, there are 5 things to arrange in the circle, "the block plus the other 4 people". That is a circular permutation of 5 things, so \((5-1)! = 4!\) ways. Finally, multiply by the \(2\) orders inside the block, "Alex then Sam" or "Sam then Alex". The biggest pitfall is forgetting to multiply by the order inside the block once you make it. \(n = 2\) is the only exception. With only 2 people, they are always next to each other, so the answer is \(1\) way. But the block formula as is gives \(2 \times 0! = 2\) ways (this calculator handles this case automatically).
Circular permutations with 2 given items apart, \((n-1)! - 2 \times (n-2)!\)
Figure
Standard notation (the usual math form)
\(B\) \(=\) \((n-1)!\) \(-\) \((n-2)!\) \(\times\) \(2\)
In words (symbols replaced with words)
④ \(B\): arrangements with the 2 apart \(=\) ① \((n-1)!\): circular permutations with no condition \(-\) ② \((n-2)!\): circular permutations of \(n-1\) things, with the block as one \(\times\) ③ \(2\): orders of the 2 inside the block
The formula in words
① From the \((n-1)!\): circular permutations with no condition
② subtract the \((n-2)!\): circular permutations of \(n-1\) things, treating the 2 as one block
③ times the \(2\): orders of the 2 inside the block (this product is the number of arrangements with the 2 side by side)
④ and you get the \(B\): arrangements with the 2 apart
Quick example
When \(6\) people sit around a round table, the number of ways Alex and Sam do not sit next to each other is
ways with the 2 apart \(=\) circular, 6 people, \(5!\) \(-\) circular, 5 things with the 2 as a block, \(4!\) \(\times\) orders of the 2 in the block, \(2\)
\((6-1)! = 5! = 120\)
\(2 \times (6-2)! = 2 \times 24 = 48\)
\(120 - 48 = 72\)
Key idea
Counting "not side by side" head-on means lots of cases for where each person can go. Instead, subtract "the arrangements where they are side by side" from "all arrangements". Counting the opposite of what you want (the complement) and subtracting it from the total is a standard technique. Simplifying, you can also write it as \((n-1)! - 2(n-2)! = (n-1)(n-2)! - 2(n-2)! = (n-3) \times (n-2)!\). With \(n = 3\), this gives \(0 \times 1! = 0\) ways. At a round table for 3, every pair is always side by side, so \(0\) ways is indeed correct.
In a circle, arrangements that match after a rotation count as the same 1 way, so the \(n!\) ways in a row are divided by \(n\), giving \((n-1)!\) ways. If flipping over also counts as the same, as with a necklace (necklace arrangements), divide by \(2\) once more to get \(\dfrac{(n-1)!}{2}\) ways (the only exception is \(n \le 2\), which gives \(1\) way).

Symbols and terms

Symbols

\(n\) en The total number of items to arrange. It comes from "number" and is widely used for counts. On this page it is the number of people at a round table or the number of beads on a ring.
\(r\) ar The number of items chosen from the \(n\) and actually arranged. It is used together with \(n\), as in \({}_{n}\mathrm{P}_{r}\), read "\(r\) of \(n\)".
\(n!\) n factorial The factorial, \(n! = n \times (n-1) \times \cdots \times 2 \times 1\), the number of ways to arrange all \(n\) items in a row. The exclamation mark notation is said to have been introduced in 1808 by the French mathematician Christian Kramp. By definition, \(0! = 1\).
\({}_{n}\mathrm{P}_{r}\) n P r Permutations. The number of ways to choose \(r\) of \(n\) items and arrange them in a row, calculated as \({}_{n}\mathrm{P}_{r} = n \times (n-1) \times \cdots \times (n-r+1)\). \(\mathrm{P}\) stands for "permutation". It is also written \(P(n, r)\).
\(N\) capital N The letter used on this page for the number of circular permutations. It is the capital first letter of "number" and is often used for a count you want to find.
\(M\) em The letter used on this page for the number of necklace arrangements. It is the letter next to \(N\), used when you need another count separate from \(N\).
\(A,\ B\) A, B On this page, \(A\) is the number of arrangements with 2 given items side by side, and \(B\) is the number with them apart. Letters from the start of the alphabet are customarily used for fixed quantities you want to find.
\((n-1)!\) n minus 1 factorial The expression for the number of circular permutations. It is what remains after removing the \(n\)-fold repeats from rotations when \(n\) items are arranged in a circle. Thinking "fix one item and arrange the other \(n-1\)" gives the same expression.

Terms

number of ways How many different ways there are in total to do something that meets a condition. Any question that asks "how many ways?" is asking for the number of ways (counting).
permutation An arrangement of items where order matters, or the number of such arrangements. Arranging in a row is called a linear permutation and is counted with \({}_{n}\mathrm{P}_{r}\).
linear permutation An ordinary permutation in a straight row, called this to set it apart from a circular permutation. A row has ends, so shifting it gives a different arrangement.
circular permutation An arrangement of items in a circle (a ring). By rule, arrangements that match after a rotation count as the same 1 way, so \(n\) items give \((n-1)!\) ways.
necklace arrangement A circular permutation where arrangements that match after a flip also count as the same 1 way. It is used for rings you can turn over, such as necklaces and bracelets, and gives \(\dfrac{(n-1)!}{2}\) ways when \(n\) is \(3\) or more. (In advanced combinatorics, this case is also called a bracelet.)
factorial The product of all the whole numbers from \(1\) to \(n\) (written \(n!\)). It equals the number of ways to arrange \(n\) items in a row, and it grows explosively as \(n\) increases (\(10! = 3{,}628{,}800\)).
match by rotation When turning a ring as it is makes it exactly the same as another arrangement. In circular permutations, such arrangements are not told apart and count as the same 1 way. One full turn gives \(n\) matching arrangements.
match by flipping When turning a ring over (reversing left and right, as in a mirror) makes it the same as another arrangement. In necklace arrangements, these also count as the same 1 way.
treat as a block Tying together the items that must be side by side and handling them as a single item. The total count goes down by 1, and at the end you multiply by the number of orders inside the block.
complement All the cases where a condition does not happen, written \(A^c\). A condition that is hard to count directly, such as "not side by side", is found by subtracting the "side by side" cases from the total.
overcounting Counting the same thing two or more times. In circular permutations, each ring is counted \(n\) times, so you divide by \(n\) at the end to remove the repeats.
fix one item A standard way to think about circular permutations. Once one person's position is decided first, the arrangement can no longer be rotated into another one, so it is the same as arranging the other \(n-1\) items in a row.
multiplication principle The counting rule that if there are \(a\) ways to decide A, and for each of them \(b\) ways to decide B, then there are \(a \times b\) ways in total. It is also called the fundamental counting principle. Multiplying the circular permutations of the block by the \(2\) orders uses this rule.

Good to know before you start

Here is what helps you use the calculation on this page with real understanding, not just by pressing the button.
If you get stuck, going back over the topics in this table is the fastest way forward.

Basic counting (Grade 7 to high school)
  • Being able to use the multiplication principle (if there are \(a\) ways to decide A, and for each of them \(b\) ways to decide B, there are \(a \times b\) ways in total)
  • Being able to draw a tree diagram and list every case for small numbers (a way to check for yourself that a formula is right)
Permutations and factorials (high school, Algebra 2 or Statistics)
  • Knowing that \(n!\) (factorial) is the number of ways to arrange all \(n\) items in a row (example - \(4! = 24\))
  • Being able to calculate \({}_{n}\mathrm{P}_{r} = n \times (n-1) \times \cdots \times (n-r+1)\) (example - \({}_{8}\mathrm{P}_{3} = 8 \times 7 \times 6 = 336\))
  • Knowing that \(0! = 1\) by definition
Using division to remove repeats (Grades 3–5)
  • Having a feel for the idea that if each thing was counted \(n\) times, dividing by \(n\) gives the real count (example - 24 gloves make 24 ÷ 2 = 12 pairs, since 2 gloves make 1 pair)
  • Knowing that division finds how many groups of a given size there are
Rotations and symmetry of shapes (Grades 4–8)
  • Being able to see shapes that match after a rotation as "the same shape" (this is the "rotation" in circular permutations)
  • Being able to picture a shape with left and right reversed, as in a mirror (a reflection) (this is the "flip" in necklace arrangements)
The complement (high school, Statistics)
  • Knowing that the number of cases where something is "not" true can be found by subtracting the cases where it is true from the total
  • Being able to plan to count the opposite condition first when a condition such as "not side by side" is hard to count directly

How to calculate it in Excel

Copy the whole table below and paste it into cell A1 in Excel. It works as is.
Table to find the circular permutations (n−1)!
Number of items n 8
Circular permutations (n−1)! =FACT(B1-1)
Table to find the circular permutations of r of n items
Total items n 8
Number in the circle r 3
Ways in a row nPr =PERMUT(B1,B2)
Circular permutations nPr÷r =B3/B2
Table to find the necklace arrangements (n−1)!÷2
Number of items n 5
Necklace count =IF(B1<=2,1,FACT(B1-1)/2)
Table to find circular permutations with 2 given items side by side or apart
Number of items n 6
No condition (n−1)! =FACT(B1-1)
2 side by side 2×(n−2)! =2*FACT(B1-2)
2 apart =B2-B3
After pasting, the upper rows (the counts) are your inputs and the lower rows are calculated automatically.
FACT calculates the factorial (n!) and PERMUT calculates the permutations (nPr).
The first table is 8 people at a round table, and the answer is 5040.
The second table seats 3 of 8 people at a round table: nPr is 336, and dividing by r gives 112.
The IF in the third table handles the case where n is 2 or less, when you must not divide by 2. Enter 5 for n and you get 12.
The fourth table is the example of 6 people at a round table: 120 with no condition, 48 side by side and 72 apart.

How to calculate it in Google Sheets

Copy the whole table below and paste it into cell A1 in Google Sheets. It works as is.
Table to find the circular permutations (n−1)!
Number of items n 8
Circular permutations (n−1)! =FACT(B1-1)
Table to find the circular permutations of r of n items
Total items n 8
Number in the circle r 3
Ways in a row nPr =PERMUT(B1,B2)
Circular permutations nPr÷r =B3/B2
Table to find the necklace arrangements (n−1)!÷2
Number of items n 5
Necklace count =IF(B1<=2,1,FACT(B1-1)/2)
Table to find circular permutations with 2 given items side by side or apart
Number of items n 6
No condition (n−1)! =FACT(B1-1)
2 side by side 2×(n−2)! =2*FACT(B1-2)
2 apart =B2-B3
The same formulas as in Excel (FACT, PERMUT and IF) work as is. Copy the whole table, paste it into cell A1, and replace the counts with your own numbers.

How to calculate it in Python

from math import factorial, perm

n = 8   # number of items
r = 3   # number to arrange in the circle (when choosing from n)

# circular permutations: all n items in a circle
circular = factorial(n - 1)

# circular permutations: r of n items in a circle
circular_select = perm(n, r) // r

# necklace arrangements: flips count as the same
# when n is 1 or 2, flipping does not change the arrangement, so it is 1 way without dividing by 2
necklace = 1 if n <= 2 else factorial(n - 1) // 2

# circular permutations with 2 given items side by side / apart (for n of 3 or more)
adjacent = 2 * factorial(n - 2)
not_adjacent = factorial(n - 1) - adjacent

print(f"Circular permutations: {circular}")
print(f"Circular permutations of {r} of {n}: {circular_select}")
print(f"Necklace arrangements: {necklace}")
print(f"Side by side: {adjacent}  Apart: {not_adjacent}")
Runs with just the standard math module (perm needs Python 3.8 or later). For dividing whole numbers, use "//", which does not turn the result into a decimal. Running this example shows circular permutations 5040, circular permutations of 3 of 8 = 112, necklace arrangements 2520, side by side 1440 and apart 3600. Change n and r and run it.

How to write it in LaTeX and other math languages (copy and paste)

Circular permutations \((n-1)!\) (all \(n\) items in a circle)
N = n! ÷ n = (n−1)!
N = \frac{n!}{n} = (n-1)!
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mi>n</mi><mo>!</mo></mrow>
      <mi>n</mi>
    </mfrac>
    <mo>=</mo>
    <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo><mo>!</mo>
  </mrow>
</math>
N = (n!)/n = (n-1)!
N = (n - 1)!
N := (n-1)!;
N = factorial(n-1);
N = n!/n = (n-1)!
Circular permutations \(\dfrac{{}_{n}\mathrm{P}_{r}}{r}\) (\(r\) of \(n\) items in a circle)
N = ₙPᵣ ÷ r
N = \frac{{}_{n}P_{r}}{r}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>N</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mmultiscripts><mi>P</mi><mi>r</mi><none/><mprescripts/><mi>n</mi><none/></mmultiscripts></mrow>
      <mi>r</mi>
    </mfrac>
  </mrow>
</math>
N = (nPr)/r
N = (n!/(n - r)!)/r
N := numbperm(n, r)/r;
N = nchoosek(n,r)*factorial(r)/r;
N = nPr/r
Necklace arrangements \(\dfrac{(n-1)!}{2}\) (flips count as the same)
M = (n−1)! ÷ 2
M = \frac{(n-1)!}{2}
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>M</mi>
    <mo>=</mo>
    <mfrac>
      <mrow><mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo><mo>!</mo></mrow>
      <mn>2</mn>
    </mfrac>
  </mrow>
</math>
M = ((n-1)!)/2
M = (n - 1)!/2
M := (n-1)!/2;
M = factorial(n-1)/2;
M = (n-1)!/2
Circular permutations with 2 given items side by side, \(2 \times (n-2)!\)
A = 2 × (n−2)!
A = 2 \times (n-2)!
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>A</mi>
    <mo>=</mo>
    <mn>2</mn>
    <mo>&#xD7;</mo>
    <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>2</mn><mo>)</mo><mo>!</mo>
  </mrow>
</math>
A = 2 * (n-2)!
A = 2 (n - 2)!
A := 2*(n-2)!;
A = 2*factorial(n-2);
A = 2(n-2)!
Circular permutations with 2 given items apart, \((n-1)! - 2 \times (n-2)!\)
B = (n−1)! − 2 × (n−2)!
B = (n-1)! - 2 \times (n-2)!
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mrow>
    <mi>B</mi>
    <mo>=</mo>
    <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>1</mn><mo>)</mo><mo>!</mo>
    <mo>&#x2212;</mo>
    <mn>2</mn>
    <mo>&#xD7;</mo>
    <mo>(</mo><mi>n</mi><mo>&#x2212;</mo><mn>2</mn><mo>)</mo><mo>!</mo>
  </mrow>
</math>
B = (n-1)! - 2 * (n-2)!
B = (n - 1)! - 2 (n - 2)!
B := (n-1)! - 2*(n-2)!;
B = factorial(n-1) - 2*factorial(n-2);
B = (n-1)! - 2(n-2)!

How to have ChatGPT  do the calculation

You are a calculation assistant for math (counting). Do the following calculation by actually running Python code, and base your answer only on the numbers from the execution result (do not answer by mental math or guessing).

8 people sit around a round table. Find the following 4 things:
1. The circular permutations of all 8 people (seatings that match after a rotation count as the same 1 way)
2. The number of ways to choose 3 of the 8 people and seat them at a round table for 3
3. The necklace arrangements of 8 beads strung into a ring (arrangements that match after a rotation or a flip count as 1 way)
4. At the round table of 8, the number of seatings where 2 given people sit next to each other, and where they do not

In Python, calculate exactly with the standard math module (factorial and perm), and show the formulas you used and the numbers from the execution result. Also explain why each formula has that form.

How to Use
  1. 1
    Enter your numbers
    Type the numbers you want to calculate with into the input fields
  2. 2
    Calculate
    Press the "Calculate" button
  3. 3
    Check the result
    The result appears on the spot. The same page also explains the idea behind the calculation and the formula
  DataChef Features
Easy and Free
Unlimited conversions for free.
No technical knowledge required.
Intuitive and user-friendly operation.
No Registration Required
Available immediately after access.
Can be used without registering personal information.
Safe and Secure
Fully SSL encrypted communication.
Automatic file deletion by clicking "download".
Fast
High-speed site access
and rapid file conversion.
No Watermark
No watermark.
No attribution required.
Commercial Use Available
Free for commercial use.
No need to contact us for commercial use permission.