Permutation without repetition
Choosing and ranking 3 of 5 items can be done in 60 different orders, the value of P(5,3). Enter how many distinct items you have and how many places to fill, and get the exact count with no item reused. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- N
- 5
- Resistance (Ω)
- 3
- Quantity
- 60
- Notation
- P(5,3)
When you line up people, assign ranked prizes, or pick a password from a set of unique characters, order matters and no item may be reused. That situation is a permutation without repetition: the number of ways to arrange r distinct items chosen from n available items. The closed count is n factorial divided by (n minus r) factorial, often written P(n,r) or nPr. This calculator evaluates that exact integer for non-negative integers n and r.
What a permutation without repetition counts
A permutation without repetition is an ordered sequence of length r built from n distinct items in which each item may appear at most once. Order is part of the identity of the outcome: ABC and ACB are two different arrangements even though they use the same three letters. The classical closed form is P(n,r) equals n factorial divided by (n minus r) factorial, which expands to the falling product n times (n minus one) times each next smaller integer down to (n minus r plus one).
Classroom stories that match this model include electing a president, vice-president, and secretary from a club of n members, lining up r finishers from a field of n athletes, assigning first, second, and third prizes when those ranks are different, or filling r unique password positions from an alphabet of n unused symbols. When r equals n the product is the full factorial n!, because every item appears once in every complete ordering.
When r equals zero the product is empty and the count is one by convention, matching the single empty sequence. Combinations C(n,r) answer a different question: they ignore order and divide P(n,r) by r!. Permutations with repetition answer yet another question: they allow reuse and grow as n to the power r.
If your problem forbids reuse and treats sequence as meaningful, you want the without-repetition count this tool returns, not those two neighbours.
Where the without-repetition count is used, priced, and delivered
Use the browser tool when you want an immediate exact P(n,r) while studying discrete math, checking a contest answer, or explaining sampling without replacement without installing a computer-algebra system. Accepted indexes run from zero through ten thousand so classroom demos and combinatorial filters remain feasible without unbounded memory growth on pathological products. Results are fully deterministic: the same n and r always yield the same count, notation, and formula fields.
There is no language model, no external arithmetic service, and no randomness, so the capability is safe to pin in continuous-integration checks and reproducible lesson materials.
What you can do with it
Homework and contest verification
Students and graders confirm P(n,r) for ordered sampling without replacement, including the edges P(n,0)=1 and P(n,n)=n!.
Sample-space sizing without replacement
Probability scripts that model ordered draws without reuse can call a deterministic nPr oracle instead of reimplementing BigInt products in every language.
Teaching order versus reuse
Lesson pages that contrast permutations without repetition with n^r (with repetition) and with combinations can show the exact falling product beside the domain rule r ≤ n.
FAQ
How do I count permutations without repetition?
Send integer fields n and r. /(n−r)!, plus notation such as P(5,3) and the factorial formula string.
What is the formula for a permutation without repetition?
P(n,r) equals n factorial divided by (n−r) factorial, which is the falling product n×(n−1)×…×(n−r+1). Order matters and no item is reused.
What happens if r is greater than n?
A permutation without repetition is undefined when r exceeds n, because you cannot select more distinct items than exist.
Is the permutation-without-repetition calculator free?
The browser tool runs free on your device.
How does this differ from permutations with repetition?
Without repetition each item may be used at most once, so the count is n! /(n−r)! and r cannot exceed n. With repetition items may be reused and the count is n^r.
Related tools
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/stat/permutation-without-repetition \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"n":5,"r":3}'const res = await fetch("https://api.kit.forhosting.com/stat/permutation-without-repetition", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"n": 5,
"r": 3
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/stat/permutation-without-repetition",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"n": 5,
"r": 3
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/stat/permutation-without-repetition", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"n":5,"r":3}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"n":5,"r":3}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/stat/permutation-without-repetition", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"n": 5,
"r": 3
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "stat.permutation_without_repetition",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_n | 10000 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |
Technical notes
If r exceeds n, or if either input is not a non-negative integer, the request fails with a clear validation error.
How the calculator evaluates n! / (n − r)! and validates n and r
The engine checks that both values are present as finite non-negative integers at most the published upper bound of ten thousand. For accepted pairs the implementation multiplies BigInt factors from n downward for exactly r steps, which is exactly n factorial over (n minus r) factorial without ever materializing two full factorials and dividing. The response also echoes n and r, a notation string such as P open five comma three close, and a formula string showing the factorial form for the same pair. Edge cases are explicit: any n taken zero times equals one, and n taken n times equals n factorial. Send a JSON body with the required integer fields n and r. If r is greater than n the request fails immediately with invalid_input, because you cannot choose more items than exist when repetition is forbidden, and that failed call is not charged. Missing fields, non-integers, negatives, and values above the limit also fail with invalid_input naming the offending field. The product is returned as a JSON number when it fits inside the safe integer range, otherwise as a decimal string so clients never lose high-order digits to floating-point rounding.
Where the without-repetition count is used, priced, and delivered
Each successful request is one billable item at $0.002; failed validation does not consume balance. Wire the endpoint into combinatorics demos, coding-interview sandboxes, probability tutorials that need sample-space sizes for ordered draws without replacement, seating-chart planners, ranked-award generators, or integer preprocessing steps where you already prefer exact permutation arithmetic over approximate heuristics or opaque third-party widgets that cannot show the product structure or the domain restriction when r exceeds n.