What is a permutation and when should I use it?+
A permutation P(n,r) counts ordered selections of r items from n. Use permutations whenever the sequence or assignment of items to distinct positions matters: race rankings, seating arrangements, password construction, scheduling, or any problem where (A,B) and (B,A) are different outcomes. If order is irrelevant (committees, card hands, sample selection), use combinations C(n,r) instead.
What is the permutation formula?+
P(n,r) = n! / (n-r)!, where n! = n times (n-1) times ... times 2 times 1. The multiplicative shortcut is P(n,r) = n times (n-1) times ... times (n-r+1), using r terms. For P(7,3): 7 times 6 times 5 = 210. This avoids computing full factorials and is easier to evaluate by hand for moderate n and r.
How is a permutation different from a combination?+
Permutations count ordered arrangements; combinations count unordered groups. P(5,3) = 60 because (A,B,C) and (C,B,A) are counted as separate arrangements. C(5,3) = 10 because {A,B,C} = {C,B,A} as an unordered set. The relationship is P(n,r) = r! times C(n,r): each group of r items contributes r! permutations. For r = 3: P = 6 times C.
What does P(n,0) equal and why?+
P(n,0) = 1 for any n. The formula gives n! / n! = 1. There is exactly one way to arrange zero items, which is the empty arrangement. This base case is used in combinatorial proofs and ensures the formula P(n,r) = r! times C(n,r) holds correctly when r = 0 (since C(n,0) = 1 and 0! = 1).
What is P(n,n) and how is it different from P(n,r)?+
P(n,n) = n! because (n-n)! = 0! = 1, so the formula reduces to n!. This is the number of ways to arrange all n items. P(4,4) = 24, P(5,5) = 120, P(6,6) = 720. P(n,r) with r less than n is a partial permutation: you fill only r of the n positions. P(6,3) = 6 times 5 times 4 = 120, which is much smaller than P(6,6) = 720.
How many 3-letter codes can be formed from 26 letters without repetition?+
P(26,3) = 26 times 25 times 24 = 15,600. Without repetition means each letter can be used at most once per code. With repetition allowed, the count is 26^3 = 17,576. For case-sensitive codes with both upper and lower: P(52,3) = 52 times 51 times 50 = 132,600 without repetition, or 52^3 = 140,608 with repetition.
How do permutations apply to arranging all letters of a word?+
Arranging all letters of an n-letter word with distinct letters gives P(n,n) = n! arrangements. For a 5-letter word like CHAIR: P(5,5) = 5! = 120 arrangements. If letters repeat, the multinomial formula applies: n! / (n1! times n2! times ...), where n1, n2, ... are counts of each repeated letter. For RADAR (5 letters, A appears twice, R appears twice): 5! / (2! times 2!) = 120 / 4 = 30 distinct arrangements.
What is the trifecta bet count for a 12-horse race?+
A trifecta requires picking the exact first, second, and third place finishers in order. From 12 horses, this is P(12,3) = 12 times 11 times 10 = 1,320 possible trifectas. An exacta (first and second in order) is P(12,2) = 12 times 11 = 132. A superfecta (first through fourth in order) is P(12,4) = 12 times 11 times 10 times 9 = 11,880. The ordering requirement is why these are permutations, not combinations.
What is a circular permutation and how does it differ from a linear one?+
A linear permutation of n items gives P(n,n) = n! arrangements. A circular permutation fixes one item as a reference and arranges the remaining n-1, giving (n-1)! distinct arrangements. For 6 people seated around a round table: (6-1)! = 5! = 120 arrangements (not 720 as in a line) because rotations are considered identical. This calculator computes linear permutations. For circular permutations, divide the result by n.
How do I handle permutations with some items fixed?+
If k items must appear in fixed positions, count only the remaining n-k items for the remaining r-k positions: P(n-k, r-k). For example, if 8 people must be seated in 5 chairs and person A must sit in chair 1: fix A in chair 1, then arrange the remaining 4 chairs from 7 people: P(7,4) = 7 times 6 times 5 times 4 = 840. Without the constraint, P(8,5) = 8 times 7 times 6 times 5 times 4 = 6,720. The ratio 6720 / 840 = 8, confirming that 1 in 8 of the unconstrained arrangements places A in chair 1.
Can P(n,r) exceed 1 trillion for practical inputs?+
Yes, permutations grow very rapidly. P(20,10) = 670,442,572,800 (about 670 billion). P(15,10) = 10,897,286,400 (about 10.9 billion). P(20,13) exceeds 1 trillion. This calculator uses JavaScript floating-point (up to about 9 times 10^15 with full precision) and switches to scientific notation for results above 10^15. For exact integer arithmetic on very large permutations, use Python with arbitrary-precision integers.