Advanced maths

Permutation composition calculator

Compose two permutations and find cycles, inverse, order and parity with each mapping shown.

Your numbers

List each integer from 1 through n once, for n up to 24. The first value is p(1).

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your numbers and select Calculate.

Behind the numbers

How this calculation works

Follow the selected first mapping and then the second mapping for every point. Decompose the resulting permutation into disjoint cycles, invert the mapping and compute the least common multiple of the cycle lengths. Parity is determined by the sum of cycle length minus one.

THE FORMULA(p ∘ q)(i) = p(q(i)); order = lcm(disjoint cycle lengths)

A worked example

With p = [2,3,1] and q = [2,1,3], p ∘ q has images [3,2,1], cycles (1 3)(2), order 2 and odd parity.

Good to know

One-line notation only on points 1 through n, n at most 24. Both lists must be bijections of the same set. Cycles include fixed points. No symbolic cycle-input parser or abstract permutation-group enumeration is performed.

Read each list as a function

The list 2 3 1 means that 1 maps to 2, 2 maps to 3 and 3 maps to 1. It does not mean three independent choices or a list of cycle lengths. Every point must appear once as an image because a permutation is a bijection of the specified finite set.

With p = [2,3,1] and q = [2,1,3], evaluate p ∘ q at 1 by applying q first: q sends 1 to 2 and p sends 2 to 3. The resulting image of 1 is therefore 3. Repeating for the other points gives [3,2,1].

Reversing the order gives q ∘ p = [1,3,2]. These different results demonstrate why a composition label must specify which function acts first. The intermediate-image table lets you trace each point rather than infer the convention from the final list.

Cycles explain the inverse, parity and repetition period

Start at a point, repeatedly follow its image and stop when you return. Then begin with a point not yet visited. This produces disjoint cycles. A fixed point is a cycle of length one; it is included here so every point remains visible.

A cycle of length k returns to its start after k applications. Disjoint cycles return simultaneously after the least common multiple of their lengths. For example, cycles of lengths 3 and 2 have order 6, while lengths 3 and 3 have order 3. Multiplying the lengths would give the wrong answer in the second case.

A k-cycle has the parity of k − 1 transpositions. Summing those contributions determines whether the full permutation is even or odd. The inverse reverses every mapping; its one-line list is shown separately and should compose with the original result to give 1 2 … n. The calculator computes properties of the composed permutation, not the subgroup generated by both input permutations.

A few questions, answered

Can I enter cycle notation such as (1 2 3)?

Use one-line images instead. The cycle (1 2 3) on three points is entered as 2 3 1. On four points with 4 fixed it is 2 3 1 4.

Is the identity permutation order zero?

No. Its first positive power is already the identity, so its order is 1. All its cycles have length one and its parity is even.

Can permutations of different sizes be composed?

They must act on the same set in this tool. Extend a smaller permutation by explicitly listing any additional fixed points before composition.

Find your calculator

Start typing to explore the library.