Permutation Calculator
Calculate permutations P(n,r) without repetition, with repetition, and multiset permutations for identical items
Check Permutation Calculator
About This Tool
Calculator Task Context
Use this calculator when order matters, such as arranging winners, passwords, schedules, or ranked selections.
Formula And Method Used
Without repetition, the calculator uses P(n,r) = n! / (n-r)!. With repetition, it uses n^r because each position can reuse any option.
Worked Example
- For arranging 3 winners from 10 people, P(10,3) = 10! / 7!.
- That equals 10*9*8 = 720 ordered outcomes.
Common Mistakes And Limits
- Use combinations instead when order does not matter.
- Ensure r is not greater than n for permutations without repetition.
- Factorials grow quickly, so interpret very large results as counts, not practical lists.
Related Calculators
Permutation Calculator: Compute Ordered Arrangements with Standard, Repetition, and Multiset Modes
Our permutation calculator provides three comprehensive modes for computing the number of ordered arrangements of items: a standard permutation calculator that computes P(n,r) using the formula n! divided by (n-r)! for selections without replacement, a repetition permutation calculator that computes n raised to the power r for scenarios where items can be reused in each position, and a multiset permutation calculator that handles arrangements of items where some elements are identical using the multinomial coefficient formula n! divided by the product of the factorials of each group size. Permutations are a fundamental concept in combinatorics, the branch of mathematics concerned with counting, arranging, and selecting discrete objects, and they differ from combinations in one critical way: in permutations, the order of arrangement matters, so selecting items A, B, C is counted as a different arrangement from B, C, A, whereas in combinations these would be considered the same selection regardless of order. The standard permutation formula P(n,r) equals n factorial divided by (n minus r) factorial, which can be understood through the fundamental counting principle: when selecting the first item you have n choices, for the second item n minus 1 choices remain, for the third n minus 2, and so on until you have filled all r positions, giving the product n times (n-1) times (n-2) times ... times (n-r+1), which is precisely n! divided by (n-r)!. Our calculator uses BigInt arithmetic to handle the extremely rapid growth of factorial values, ensuring exact results even for large inputs where standard floating-point arithmetic would lose precision, such as P(52,5) which equals 311,875,200 possible five-card ordered hands from a standard deck. For computing unordered selections where the arrangement of chosen items does not matter, our Combination Calculator provides C(n,r) computation with the relationship P(n,r) = C(n,r) times r! connecting the two concepts.
Standard Permutations: The Formula P(n,r) and the Fundamental Counting Principle
The standard permutation formula P(n,r) equals n! divided by (n-r)! derives directly from the fundamental counting principle, which states that if a sequence of choices must be made where the first choice has a options, the second choice has b options, and so on, then the total number of possible sequences is the product a times b times c and so forth. When selecting r items from n distinct items without replacement, the first position can be filled by any of the n items, the second position by any of the remaining n-1 items, the third by n-2, continuing until the rth position has n-r+1 choices, giving the product n times (n-1) times (n-2) times ... times (n-r+1), which equals n! divided by (n-r)! because the factorial in the denominator cancels all the terms below n-r+1. The special case P(n,n) equals n! represents the total number of ways to arrange all n items in a complete ordering, which grows extraordinarily fast: 5! equals 120, 10! equals 3,628,800, 15! equals over 1.3 trillion, and 20! exceeds 2.4 quintillion, illustrating why even modest increases in the number of items produce astronomically larger numbers of possible arrangements. This rapid factorial growth has profound implications for computational complexity: algorithms that must examine all permutations of n items, such as brute-force solutions to the traveling salesman problem, become computationally infeasible for even moderate values of n, which is why efficient approximation algorithms and heuristics are essential in operations research and optimization. For computing the probability of specific permutation outcomes occurring in random experiments, our Probability Calculator provides single event, multiple event, and conditional probability calculations with Venn diagram visualization.
Permutations with Repetition: PIN Codes, Passwords, and Sampling with Replacement
Permutations with repetition, calculated using the formula n raised to the power r, apply to scenarios where each position in the arrangement can be filled by any of the n available items regardless of what has been chosen for other positions, meaning items can be reused or repeated across multiple positions in the sequence. The most familiar example is a numeric PIN code: a 4-digit PIN where each digit can be any number from 0 to 9 has 10 to the fourth power equals 10,000 possible combinations, because each of the four positions independently has 10 choices, and the same digit can appear in multiple positions (like 3-3-3-3 or 1-2-1-2). Password security analysis relies heavily on repetition permutations: a password of length 8 drawn from 62 possible characters (26 uppercase letters, 26 lowercase letters, and 10 digits) has 62 to the eighth power equals approximately 218 trillion possible arrangements, and adding special characters to increase the character set from 62 to 95 increases the possibilities to 95 to the eighth power equals approximately 6.6 quadrillion, demonstrating why password policies that require diverse character types dramatically improve security. Our calculator handles repetition permutations with BigInt precision, correctly computing results for large exponents that would overflow standard number types. For finding the prime factorization and divisors of large numbers that arise in permutation calculations, our Factor Calculator provides complete factorization with factor pairs and prime decomposition.
Multiset Permutations: Arranging Items with Identical Elements
Multiset permutations, also called permutations of indistinguishable objects, count the number of distinct arrangements when some items in the set are identical, using the multinomial coefficient formula n! divided by the product of the factorials of each group of identical items. The classic example is arranging the letters of the word MISSISSIPPI, which has 11 letters total but contains 1 M, 4 I's, 4 S's, and 2 P's: the number of distinct arrangements is 11! divided by (1! times 4! times 4! times 2!) equals 34,650, far fewer than the 11! equals 39,916,800 arrangements that would exist if all letters were distinct. In probability theory, multiset permutations calculate the number of ways a specific outcome pattern can occur in a sequence of independent trials: the number of ways to get exactly 3 heads and 2 tails in 5 coin flips is 5! divided by (3! times 2!) equals 10. For statistical analysis of datasets that may arise from permutation-based experimental designs, our Statistics Calculator provides comprehensive descriptive statistics with box plot and histogram visualization.
Applications of Permutations in Cryptography, Computer Science, and Everyday Life
Permutations play a central role in cryptography, computer science, probability theory, and numerous practical applications where the number of possible ordered arrangements determines the security, complexity, or likelihood of specific outcomes. In cryptography, permutation ciphers rearrange the positions of characters in a message according to a secret key, and the security of such ciphers depends on the astronomical number of possible permutations. Modern encryption algorithms like AES use permutation operations as fundamental building blocks within their substitution-permutation network structure. In computer science, the analysis of sorting algorithms is intimately connected to permutations: a sorting algorithm must transform any of the n! possible input permutations into the single sorted order. In sports and tournament design, permutations determine the number of possible rankings and match schedules. In everyday life, permutations govern the number of possible seating arrangements at a dinner table (circular permutations use (n-1)! for n guests), the number of possible routes through a set of destinations, and the number of possible orderings for a playlist of songs. For generating random permutations and random numbers for simulation and testing purposes, our Random Number Generator provides customizable random number generation with multiple output formats.
Permutation Calculator FAQ
Use standard P(n,r) when the chosen items are distinct and cannot be reused, such as arranging finalists, cards, or tasks. Use the repetition mode when each position can reuse the same pool of choices, such as PIN codes and passwords. Use multiset mode when the arrangement contains identical items, such as repeated letters in a word.
If order does not matter, the matching combination count is smaller because it collapses arrangements that contain the same selected items. The calculator shows the exact ordered count and explains when to divide by r! to compare with C(n,r).