A permutation is an arrangement of items where the order matters. If you are ranking 3 runners out of 10, the sequence Alice → Bob → Carol is a completely different result from Carol → Bob → Alice — first place, second place, and third place all carry different meaning. That ordered count is written as P(n,k), read "n permute k" or "n P k," and it answers the question: how many different ordered arrangements of size k can I pull from a set of n items?
This calculator computes P(n,k) instantly, then turns that raw count into the two numbers people actually care about: the probability that one specific ordered arrangement is the winning one, and the "1 in …" odds. Whether you are sizing a race podium, designing a password space, or wondering how many seating charts are possible, the math underneath is always the same factorial formula.
How to Use
- Enter Total Items (n) — the size of the full set you are arranging from. For a race of 10 runners that is 10; for a 26-letter alphabet it is 26.
- Enter Items Arranged (k) — how many positions each arrangement fills. It must be between 0 and n. Ranking the top 3 means k = 3. The engine supports k from 0 to 20.
- Set Repetition Allowed? to 0 (the default) when each item can be used at most once — a race podium cannot have the same runner in two places. Set it to 1 when repeats are allowed, such as a 4-digit PIN where a digit can appear twice; the count becomes n^k.
- Read the highlighted Answer on the result card. The card also shows both permutations-without-repetition P(n,k) and permutations-with-repetition n^k side by side so you can compare.
- Check Probability of One Arrangement — the percent chance that a single specific ordered sequence (say, Alice first, Bob second, Carol third) is picked at random.
- Read Odds (1 in N) — the same idea written the way people say it: "you have 1 chance in 720."
Negative n is clamped to 0, and arranging more items than the set contains (k > n) yields 0 by the standard mathematical convention — there are simply no ways to make such a sequence.
The Permutation Formula
The number of ways to arrange k items chosen from n items where order matters is:
P(n,k) = n! / (n − k)!
Where the exclamation mark means factorial — the product of all positive integers up to that number. The (n − k)! in the denominator cancels the tail of n! that you never actually use, which is exactly the shortcut that makes the formula computable by hand.
Worked example: arrange 3 items from 10.
- P(10,3) = 10! / 7! = 10 × 9 × 8 = 720.
That matches Python's exact-integer routine math.perm(10, 3) = 720, the same function CPython ships in its standard library.
Two edge cases fall straight out of the formula:
- k = 0: P(n,0) = 1. There is exactly one way to arrange nothing — the empty ordering.
- k = n: P(n,n) = n!. You are arranging the whole set, so every ordering counts.
Permutations vs Combinations: Know the Difference
This is where people most often get the wrong number.
- Permutations (this calculator): order does matter. The sequence Alice → Bob → Carol is different from Carol → Bob → Alice. Use it for race podiums, passwords, PINs, and arranging books on a shelf.
- Combinations: order does not matter. A 3-item committee {Alice, Bob, Carol} counts once. Use it for groups, committees, card hands, and lottery balls.
For the same n and k, a permutation is always k! times larger than the matching combination. That factor k! is exactly the number of ways to reorder the k chosen items among themselves. If your scenario treats rearrangements as identical, do not use this page — look up a combinations calculator instead. Feeding an order-insensitive question into P(n,k) overcounts by a factor of k! and will silently mislead you.
Examples
Example 1 — A 10-runner podium (n = 10, k = 3). Ten athletes cross a finish line and the top 3 step onto a podium. P(10,3) = 10 × 9 × 8 = 720 possible podium results. Since order matters, every ordering of the same three finishers is a distinct result, and your odds that a particular sequence (Alice first, Bob second, Carol third) is the real one are 1 in 720, or about 0.139%.
Example 2 — A 5-card draw order (n = 52, k = 5). If you care about the order in which 5 cards are dealt from a standard deck, P(52,5) = 311,875,200 ordered sequences. That is exactly 5! = 120 times larger than the 2,598,960 unordered poker hands — the same 120 factor that separates permutations from combinations. Casino odds tables use the combination number; dealing-sequence puzzles use the permutation number.
Example 3 — A million-item ordering pair (n = 1,000,000, k = 2). Choosing an ordered pair of items out of a million gives P(1,000,000,2) = 1,000,000 × 999,999 = 999,999,000,000 possible ordered pairs. The exact integer arithmetic never overflows, which is the same reason a multi-million-dollar prize advertised for guessing two ordered numbers still carries a probability so small it rounds to 0.0000000001% per guess.
Example 4 — The empty arrangement (n = 5, k = 0). P(5,0) = 1. There is exactly one permutation when you arrange nothing at all — the empty ordering. The probability column shows 100% because that single arrangement is the only possible outcome.
FAQ
What is the difference between a permutation and a combination?
A permutation treats order as meaningful: ABC, ACB, and BAC are three different arrangements. A combination ignores order: {A, B, C} is the same group as {B, A, C}. Use permutations for race results, passwords, PINs, and seating charts; use combinations for committees, card hands, and lottery pools.
How do I calculate n permute k by hand?
Use the formula P(n,k) = n! / (n − k)!. In practice you never compute the huge factorials directly — cancel first. For P(10,3), write out (10 × 9 × 8) / 1 = 720. The top k factors of n! and the bottom (n − k)! cancel everything else away, leaving just k factors to multiply.
What does P(n,0) equal?
P(n,0) = 1 for any n ≥ 0. There is exactly one way to arrange zero items from a set — the empty permutation — so the formula yields 1, and the probability of picking that empty arrangement is 100%.
Can k be larger than n?
Mathematically, no — you cannot arrange 5 items from a set that only contains 3. The standard convention is P(n,k) = 0 when k > n, which is what the calculator returns. If you expected a non-zero result, double-check which number is the pool size (n) and which is the arrangement size (k).
Why is P(n,k) always k! times C(n,k)?
Because a permutation is just a combination plus an ordering. Once you have chosen k items out of n (that is C(n,k) groups), there are k! ways to line those k items up. Multiplying gives P(n,k) = C(n,k) × k!, which algebraically equals n! / (n − k)!.
When should I use a permutation calculator instead of a combinations calculator?
Use a permutation calculator whenever rearranging the same items would count as a different outcome — first-vs-second place, password order, seat assignments, batting lineups. Use a combinations calculator when rearrangements are the same thing — committee rosters, card hands, lottery tickets. If you are unsure, ask: "If I swap two items, does the answer change?" If yes, use permutations.
Disclaimer
This permutations calculator is provided for informational purposes only and does not constitute mathematical, statistical, financial, or gambling advice. Results are exact integer values of P(n,k) computed from the inputs you enter; probability percentages are derived from those exact counts. Always verify critical decisions — especially those involving probability, risk, or wagers — with a qualified professional before relying on the result.