Search⌘ K

Combinations

Explore combinations as a fundamental concept in number theory, focusing on selecting items where order does not matter. Understand the formula and practical applications through examples, helping you accurately solve combination problems in competitive programming contexts.

For combinations, the order doesn’t matter.

Without repetition

For example, I want to pick three balls from a bag of five balls. The end result is that I should have three balls, the order in which I actually pick the balls is not important. How many ways can I do this?

The formula is C(n,k)=P(n,k)k!=n!(nk)!k!=(nk)C(n,k) = \frac{P(n,k)}{k!} = \frac{n!}{(n-k)!k!} = {n \choose k} ...