Permutation - P(n, r), n!, and Chain

Type n and r into this permutation formula tool and read P(n, r) with the supporting n! and (n - r)! factorials and a step-by-step multiplication chain.

Updated: June 16, 2026 • Free Tool

Permutation

Number of distinct items available to arrange. The result stays exact for any whole number up to 20.

Number of items to pick and arrange in a specific order. Must satisfy 0 <= r <= n.

Results

P(n, r)
0
n! 0
(n - r)! 0
Multiplication Chain Value 0

What Is the Permutation Formula?

The permutation formula is the identity that counts ordered arrangements of r items chosen from a set of n distinct items, written P(n, r) = n! / (n - r)!. Type the total number of items n and the arrangement size r and the result panel returns P(n, r) with the supporting n! and (n - r)! factorials and the multiplication chain. The same identity appears in the binomial coefficient and in the equally-likely model where the favorable outcomes are counted as P(n, r).

  • Race finishing orders: When 8 runners compete and you need the number of possible podium orders, enter n = 8 and r = 3 to get P(8, 3) = 336 distinct podiums.
  • PIN and password sequences: For a 4-character PIN drawn from 10 digits with no repeats allowed, P(10, 4) = 5040. The result panel returns that count with the supporting factorials in a single read.
  • Batting or starting lineups: When a coach needs the number of possible batting orders from 9 players, P(9, 9) = 9! = 362880. The chain 9 * 8 * 7 * 6 * 5 * 4 * 3 * 2 * 1 is shown alongside the count.
  • Counting-problem homework: Students plug in the same n and r and compare the calculator's P(n, r) value with the answer they derived by hand.

P(n, r) is also written nPr, and the underlying identity is the same.

Readers who want a result panel tuned for a quick count rather than a worked formula derivation can open the Permutation Calculator, which returns the same P(n, r) with the same n = 5, r = 3 defaults.

How the Permutation Formula Works

The tool reads n and r, validates that both are whole numbers with r <= n and n <= 20, and then evaluates n! and (n - r)! using a guarded integer loop. P(n, r) is the integer quotient n! / (n - r)!, and the same factorial products are also shown as a multiplication chain so the reader can see which factors of n! survive the division.

P(n, r) = n! / (n - r)!, n! = n * (n - 1) * (n - 2) * ... * 1, 0! = 1
  • n (total items): Total number of distinct items available to arrange. The tool accepts whole numbers from 0 to 20 and rejects anything larger to keep n! inside the safe-integer range.
  • r (items arranged): Number of items to pick and arrange in a specific order. Must satisfy 0 <= r <= n. r = 0 returns 1; r = n returns n! because the denominator collapses to 0! = 1.
  • n! (n factorial): Product of every whole number from 1 to n. By definition 0! = 1, which lets the formula handle r = 0 without a special case.
  • (n - r)! (denominator): Factorial of n - r. When r is small this factorial is tiny, and the division cancels a long tail of factors out of n!.

The multiplication chain makes the cancellation visible. For P(8, 3) the chain is 8 * 7 * 6, which is 8! = 40320 divided by 5! = 120. The denominator drops the smallest five factors out of 8!.

Worked example: 5 items taken 3 at a time

n = 5, r = 3.

n! = 5 * 4 * 3 * 2 * 1 = 120. (n - r)! = (5 - 3)! = 2! = 2 * 1 = 2. P(5, 3) = 120 / 2 = 60. Chain: 5 * 4 * 3 = 60.

P(5, 3) = 60. n! = 120. (n - r)! = 2.

The 5! in the numerator has 5 factors, but the 2! denominator cancels the 2 * 1 tail, leaving 5 * 4 * 3 = 60 distinct ordered arrangements.

According to MathWorld (Wolfram Research), the number of k-permutations of n objects is P(n, k) = n! / (n - k)!, valid for 0 <= k <= n

Readers who need the unordered count C(n, r) alongside P(n, r) for the same n and r can use the Permutation and Combination Calculator, which returns both counts in one result panel.

Key Concepts Behind the Permutation Formula

Four short definitions keep the identity honest. None depend on whether the items are letters, numbers, or people.

Ordered arrangement

An arrangement is a sequence in which position matters. ABC and BAC are two different arrangements of the same three items, so both count separately toward P(n, r).

Factorial n!

The factorial of n multiplies every whole number from 1 up to n. 0! is defined as 1 by the empty-product convention.

Cancellation of (n - r)!

Dividing n! by (n - r)! strips the smallest n - r factors out of the factorial. P(n, r) is the product of the r largest factors of n!.

Permutation versus combination

The formula counts ordered arrangements; combinations count unordered selections. For the same n and r, C(n, r) is always smaller than P(n, r) because every combination of r items can be arranged in r! different orders.

Treating the identity as a cancellation of the (n - r) tail of n! makes larger problems easier to estimate before you trust a calculator answer.

Readers who need to turn P(n, r) into a probability under the equally-likely model can divide the permutation count by the total number of equally-likely outcomes in the Probability Calculator.

How to Use This Permutation Formula Tool

Type n, type r, and read the result panel. The form validates the inputs as you type, so the result updates on every keystroke.

  1. 1 Enter the total number of items n: Type the size of the set you are arranging in the Total Items (n) box. The default 5 covers the most common counting example on first visit.
  2. 2 Enter the arrangement size r: Type the number of slots to fill in the Items to Arrange (r) box. The default 3 matches the textbook example P(5, 3).
  3. 3 Read the P(n, r) result: The first row of the result panel shows P(n, r) as an integer. For the default input the panel reads P(5, 3) = 60.
  4. 4 Read the supporting factorials: The next two rows show n! and (n - r)!. For P(5, 3) the panel shows n! = 120 and (n - r)! = 2.
  5. 5 Read the multiplication chain value: The Multiplication Chain Value row shows the r largest factors of n! multiplied together. For P(5, 3) the chain is 5 * 4 * 3 and the value is 60.
  6. 6 Fix validation errors: If r > n, either input is negative, n is larger than 20, or either input is a decimal, the panel surfaces an inline error. Adjust the inputs and the result panel updates on the next keystroke.

A coach is choosing a gold, silver, and bronze order from 8 runners. The coach enters n = 8 and r = 3 and reads P(8, 3) = 336 distinct podiums. The Multiplication Chain Value reads 336 because 8 * 7 * 6 = 336.

Readers who realize the items in their set can repeat can switch to the Permutation With Repetition Calculator, which counts the n^r case for the same n and r inputs.

Benefits of Using This Permutation Formula

A short list of what the tool does well helps you put the result in the right place in your work.

  • P(n, r) in a single read: The result panel returns the permutation count as an integer, so a homework step or slide can quote the answer without showing the factorial division.
  • Supporting factorials alongside the answer: n! and (n - r)! are shown next to P(n, r) so the reader can see the two factorials that built the count.
  • Multiplication chain: The chain value row shows the r largest factors of n! multiplied together, so the reader can see exactly which factors survived the division by (n - r)!.
  • Validation that catches problems early: If r is greater than n, if either input is negative, or if n is larger than 20, the form surfaces an inline error before the result is reported.
  • Exact integer results up to n = 20: The tool caps n at 20, which keeps 20! inside the safe-integer range, so every result is an exact integer.

These benefits line up with how introductory combinatorics uses the identity to build nCr, since C(n, r) = P(n, r) / r!.

Readers who need to apply the permutation count inside a binomial probability nCr p^r (1 - p)^(n - r) can feed n, r, p, and k into the Binomial Distribution Calculator, which returns P(X = k) for the same n trials.

Factors That Affect Your Permutation Formula Result

The tool is honest about which factors change the count, which only change the size of the factorial, and which the formula does not see at all.

Choice of n and r

P(n, r) grows quickly with both inputs. Adding one to n with r fixed multiplies the count by (n + 1) / (n + 1 - r); adding one to r with n fixed multiplies the count by (n - r), the next available factor below the top of n!.

Whether items are distinct

The formula assumes every item is distinct. If the set has repeated items the count drops, because swapping two identical items does not create a new arrangement.

Whether order matters

The formula counts ordered arrangements. If the downstream problem does not care about order, divide P(n, r) by r! to get the corresponding combination count C(n, r).

Upper bound of n = 20

The tool caps n at 20 because 21! already exceeds the safe-integer range. The cap is a precision decision, not a counting one.

Permutation with repetition

For arrangements where items can repeat, the count is n^r rather than n! / (n - r)!. The panel does not cover that case.

  • The tool assumes distinct items and no repetition. Problems with identical objects or with replacement need different formulas.
  • The cap of n = 20 keeps results exact, but rules out large counting problems like P(52, 5) for 5-card poker. A big-integer library is the right tool for that range.
  • The result panel shows principal counts only. If the downstream problem needs the list of every arrangement, enumerate by hand or use a generation tool.

These factors line up with the equally-likely model in introductory probability, where favorable outcomes are divided by all equally-likely outcomes.

According to Encyclopædia Britannica, a permutation is an ordered arrangement of objects chosen from a set, and the number of r-permutations of n distinct objects is P(n, r) = n! / (n - r)!

For a deeper look at the n! and (n - r)! values that build the permutation count, the Factorial Calculator returns n! and k! with the same whole-number inputs so the reader can confirm the supporting factorials that fed the P(n, r) result.

Permutation formula input form showing n=5 and r=3, with the P(n,r)=60 result next to the n!=120 and (n-r)!=2 factorials
Permutation formula input form showing n=5 and r=3, with the P(n,r)=60 result next to the n!=120 and (n-r)!=2 factorials

Frequently Asked Questions

Q: What is the permutation formula?

A: The permutation formula P(n, r) = n! / (n - r)! counts the ordered arrangements of r items chosen from a set of n distinct items. The result panel shows P(n, r), the supporting n! and (n - r)! factorials, and the chain.

Q: When is the permutation formula valid?

A: The formula is valid for whole-number inputs n and r with 0 <= r <= n. For r = 0 the result is 1 (empty arrangement) and for r = n the result is n!.

Q: How do you calculate P(n, r) by hand?

A: Write out the n! factorial, write out the (n - r)! factorial, then divide. For P(5, 3): 5! = 120, (5 - 3)! = 2! = 2, so 120 / 2 = 60. The chain 5 * 4 * 3 = 60 is the shortcut.

Q: What is the difference between permutation and combination?

A: Permutations count ordered arrangements, so ABC and BAC count as two different results. Combinations count unordered selections. For the same n and r, C(n, r) is always smaller than P(n, r) because every combination can be arranged in r! orders.

Q: How many permutations of 5 objects taken 3 at a time?

A: P(5, 3) = 5! / (5 - 3)! = 120 / 2 = 60. The chain 5 * 4 * 3 = 60 is the shortcut. There are 60 ordered arrangements of 3 items from 5 distinct items.

Q: Does the permutation formula allow repeated items?

A: The standard identity P(n, r) = n! / (n - r)! assumes distinct items and no repetition. For arrangements with repetition, the count is n^r, covered by the Permutation With Repetition Calculator.