PERMUTATION
Permutations & combinations, computed exactly.
Pick a mode and fill n and m: permutation A(n,m) is "arrange then choose", combination C(n,m) is "choose without order", plus factorial n!, repeated permutations n^m and repeated combinations. Everything is computed with exact big integers, so 20! and beyond never turn into a truncated approximation.
Everything runs locally in your browser
How to use
Choose a mode first: permutation A(n,m) fits queues, prize draws and passwords where different orders are different outcomes; combination C(n,m) fits picking representatives or lottery numbers where order does not matter; factorial gives the total number of orders of n items; repeated permutations and combinations fit drawing with replacement or distributing identical items into boxes that may stay empty. Enter n and m, then compute — the working explains where the formula comes from. All results use exact big integers.
常见问题
How do I tell a permutation from a combination?
One line: if a different order counts as a different result it is a permutation; if the order does not matter it is a combination. "One person from class 1 and one from class 2" is a permutation (who goes where matters); "pick 2 of 5 as representatives" is a combination (only the set matters).
How do A(n,m) and C(n,m) differ?
They differ by m!: A(n,m) = n!/(n−m)! and C(n,m) = n!/[m!(n−m)!], so A(n,m) = C(n,m) × m!. Picking m people and ordering them has m! more outcomes than just picking the group.
Why stars and bars for repeated combinations?
Distributing m identical items into k types with empty types allowed is the same as lining up m balls and k−1 separators: the number of ways is C(m+k−1, k−1) (equivalently C(m+k−1, m)). Stars and bars only fits identical items into distinct containers — if items or containers differ you need a different model.
Is any data uploaded?
No. All computing runs locally in the browser.