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.

结果 =60
排列 A(n,m) = n!/(n−m)! = 5!/2! = 60。
先给 m 个位置选人并排序:第 1 位有 n 种选择,第 2 位 n−1 种……第 m 位 n−m+1 种,乘起来就是 n!/(n−m)!。顺序不同算不同结果,所以是排列。
结果以大整数精确给出(未使用浮点近似)。

From 10 items choose 3 (order ignored (combination)) — how many different results?

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.

Further reading

觉得好用?Found it useful?