Przejdź do treści
Liczbnik
Current for 2026Methodology

Combinatorics Calculator

The combinatorics calculator computes the number of permutations, combinations, arrangements (variations), and their with-repetition variants for given n and k. Choose the calculation type, enter n and k, and the calculator returns the result and the applied formula.

Na tej stronie

Combinatorics formulas

Permutations: P(n) = n! Combinations: C(n,k) = n! / (k! × (n−k)!) Arrangements (Variations): V(n,k) = n! / (n−k)! Combinations with repetition: C'(n,k) = (n+k−1)! / (k! × (n−1)!) Arrangements with repetition: W'(n,k) = n^k The calculator computes factorials iteratively and limits n to 20 to prevent integer overflow.

Example: combinations C(10,3) = 120

Choosing 3 elements from a set of 10 (order does not matter). C(10,3) = 10! / (3! × 7!) = 3,628,800 / (6 × 5,040) = 120. If order matters — arrangements: V(10,3) = 10! / 7! = 720 ways.

Frequently asked questions

What are permutations?

A permutation is any ordering of all n elements of a set. Number of permutations P(n) = n! (n factorial). Example: P(3) = 6 — the set {A, B, C} can be ordered in 6 ways: ABC, ACB, BAC, BCA, CAB, CBA.

What are combinations?

A combination is a selection of k elements from an n-element set where order does NOT matter. Formula: C(n,k) = n! / (k! × (n−k)!). Example: choosing a 3-member committee from 10 people — C(10,3) = 120 ways.

What are arrangements (variations) and how do they differ from combinations?

An arrangement (k-permutation) selects k elements from n where order DOES matter. Formula: V(n,k) = n! / (n−k)!. Example: V(10,3) = 720. Difference: combinations ignore order; arrangements respect it. Each combination gives k! arrangements.

A combination with repetition allows choosing the same element more than once. Formula: C'(n,k) = (n+k−1)! / (k! × (n−1)!). Example: 3 ice cream flavours, choosing 2 scoops — C'(3,2) = 6 (you can pick 2 of the same flavour).

An arrangement with repetition places k elements from an n-element set where each element may repeat. Formula: W'(n,k) = n^k. Example: a 4-digit PIN from digits 0–9 → 10^4 = 10,000 possible codes.

Factorial n! = 1 × 2 × 3 × … × n. By convention, 0! = 1. Examples: 5!=120, 10!=3,628,800, 20!=2,432,902,008,176,640,000. Factorials grow very fast — this calculator supports n up to 20.

Combinatorics is used wherever counting selections or arrangements matters: lotteries (winning odds), password security, scheduling optimisation, genetics, probability theory, and statistics.

You must match 6 numbers from 49. Possible combinations: C(49,6) = 13,983,816. Probability of the jackpot = 1 / 13,983,816 ≈ 0.0000071 (roughly 7 in 100 million).

21! exceeds JavaScript's maximum safe integer (Number.MAX_SAFE_INTEGER = 2^53 − 1). 20! = 2,432,902,008,176,640,000 is the last factorial that can be represented exactly. For larger n, arbitrary-precision libraries are needed.

C(n,k) — combinations WITHOUT repetition: each element chosen at most once. C'(n,k) — WITH repetition: the same element may be chosen multiple times. Example: choosing 2 ice cream scoops from 3 flavours — C(3,2)=3 (different flavours only), C'(3,2)=6 (same flavour allowed).

The calculator computes results for non-negative integers n and k (n ≤ 20). For larger numbers, arbitrary-precision arithmetic libraries are required. Results are mathematically correct for given inputs but do not substitute a combinatorics textbook.