Roboculator
Online CalculatorsCategoriesDate & EventsNews
Get Started
Online CalculatorsCategoriesDate & EventsNewsGet Started
Roboculator

Smart calculators for every challenge. Free, fast, and private.

Categories

  • Finance
  • Health
  • Math
  • Construction
  • Conversion
  • Everyday Life

Popular Tools

  • Date & Events
  • Loan Calculator
  • BMI Calculator
  • Percentage Calc
  • Latest News
  • Search All

Resources

  • Glossary
  • Topic Tags
  • News & Insights

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  • Editorial Policy
  • Disclaimer
© 2026 Roboculator. All rights reserved.
Roboculator

roboculator.com

  1. Home
  2. /Statistics
  3. /Probability Calculators
  4. /Permutations Calculator (nPr)

Permutations Calculator (nPr)

Last updated: March 28, 2026

Calculator

Results

P(n, r)

—

log₁₀ P(n,r)

0

Results

P(n, r)

—

log₁₀ P(n,r)

0

The Permutations Calculator computes the number of ordered arrangements of r items selected from n distinct items — denoted P(n, r), ⁿPᵣ, or A(n, r). Unlike combinations, permutations consider the order of selection: choosing A then B is different from choosing B then A. Permutations are essential for calculating probabilities involving sequences, rankings, arrangements, and any scenario where position matters.

Applications range from calculating possible PIN codes and password variations to determining racing finish orders and tournament seedings. This calculator uses a log-gamma approach to handle values up to n = 170 without overflow.

How It Works

The permutation formula counts ordered selections of r items from n:

$$P(n, r) = \frac{n!}{(n-r)!} = n \times (n-1) \times (n-2) \times \cdots \times (n-r+1)$$

This is the falling factorial — the product of r consecutive descending integers starting from n. It equals C(n, r) × r!, confirming that permutations count all ordered arrangements of each unordered combination.

For computational stability with large values, we use the log-gamma approach:

$$\ln P(n,r) = \ln \Gamma(n+1) - \ln \Gamma(n-r+1)$$

Special cases: P(n, 0) = 1 (one way to arrange zero items — the empty arrangement), P(n, 1) = n, and P(n, n) = n! (the total number of ways to arrange all n items).

The relationship between permutations and combinations is P(n, r) = C(n, r) × r!. For every unordered group of r items (a combination), there are r! ways to arrange those r items in order, and permutations count all of these. This is why P(n, r) is always greater than or equal to C(n, r) for r ≥ 1.

Understanding Your Results

The result gives the total number of distinct ordered sequences of length r from n items. P(10, 3) = 720 means there are 720 different 3-item sequences from 10 items. For security applications, larger permutation counts mean more possible combinations an attacker must try. For probability, it's usually a denominator in calculating P(specific sequence) = 1/P(n, r).

Worked Examples

Podium Finishes in a 10-Runner Race

Inputs

n10
r3

Results

permutations720
log permutations2.8573

In a race with 10 runners, the number of possible gold-silver-bronze orderings is P(10,3) = 10 × 9 × 8 = 720. Each ordering represents a distinct podium finish. The probability of correctly predicting the exact top 3 in order is 1/720 ≈ 0.14%.

4-Digit PIN from 10 Digits (No Repeat)

Inputs

n10
r4

Results

permutations5040
log permutations3.7024

A 4-digit PIN using digits 0-9 without repetition has P(10,4) = 10 × 9 × 8 × 7 = 5,040 possible codes. Compare to 10,000 with repetition allowed (10⁴). The no-repetition constraint reduces the search space by about half.

Frequently Asked Questions

Use permutations when the order of selection matters. Ask yourself: "If I rearrange the chosen items, do I get a different result?" If yes, use permutations. Examples: finishing positions in a race, seating arrangements, digit sequences in codes, letter arrangements in words. Use combinations when order doesn't matter: committee selection, card hands, lottery draws, team formation.

The factorial of a non-negative integer n, written n!, is the product of all positive integers from 1 to n: n! = n × (n-1) × (n-2) × ... × 2 × 1. By convention, 0! = 1. Factorials grow extremely rapidly: 10! = 3,628,800; 20! ≈ 2.43 × 10¹⁸; 170! ≈ 7.26 × 10³⁰⁶. This explosive growth is why direct computation fails for large values and log-gamma approximations are necessary.

P(n, n) = n! represents the total number of ways to arrange all n items in a specific order. This is the classic arrangement or permutation problem. For example, P(5, 5) = 120 means 5 books can be arranged on a shelf in 120 different orders. Seating n people around a table (circular permutation) uses (n-1)! instead, because rotations are considered equivalent.

In probability, permutations often appear in the denominator when calculating the likelihood of a specific ordered outcome. P(matching a specific 4-digit code) = 1/P(10,4) = 1/5040 when digits can't repeat. For the birthday problem, P(no shared birthday among n people) = P(365, n) / 365ⁿ. In card games, the number of possible deals involves permutations of the deck: P(52, 5) for ordered 5-card sequences.

No. You cannot arrange more items than you have available (without replacement). P(n, r) is undefined for r > n because (n-r)! would involve a negative factorial. This calculator automatically caps r at n. If you need to select r items from n with replacement allowed (where items can be reused), use permutations with replacement: n^r, which is handled by a separate calculator.

A derangement is a permutation where no element appears in its original position. The number of derangements of n items is D(n) = n! × Σ(-1)^k/k! for k=0 to n, which approaches n!/e as n grows. For n = 4, there are 9 derangements out of 24 total permutations. Derangements appear in problems like the hat-check problem (what's the probability nobody gets their own hat?) and secret Santa assignments.

Sources & Methodology

Rosen, K.H. (2019). Discrete Mathematics and Its Applications (8th ed.). McGraw-Hill. Brualdi, R.A. (2010). Introductory Combinatorics (5th ed.). Pearson. Tucker, A. (2012). Applied Combinatorics (6th ed.). Wiley.
R

Roboculator Team

The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.

How helpful was this calculator?

Be the first to rate!

Related Calculators

Lottery Odds Calculator

Probability Calculators

Probability Calculator

Probability Calculators

Conditional Probability Calculator

Probability Calculators

Monty Hall Problem Calculator

Probability Calculators

Combinations Calculator (nCr)

Probability Calculators

Combinations with Replacement Calculator

Probability Calculators