Combinatorics Fundamentals
Core counting principles and combinatorial formulas.
Core counting principles and combinatorial formulas.
The counting principles used to enumerate possibilities: the sum and product rules, permutations and combinations (with and without repetition), the pigeonhole principle and the binomial theorem, plus inclusion-exclusion, derangements, stars and bars, Catalan and Stirling numbers. Each entry has the principle, a one-line description and the formula.
| Principle | Description | Formula |
|---|---|---|
| Product Rule | If task A has m ways and task B has n ways, both can be done in m * n ways. | m * n |
| Sum Rule | If tasks are mutually exclusive with m and n ways, total is m + n. | m + n |
| Permutations | Ordered arrangements of r elements from n items. | P(n,r) = n! / (n - r)! |
| Combinations | Unordered selections of r elements from n items. | C(n,r) = n! / (r!(n-r)!) |
| Permutations with Repetition | Arrangements when some elements are identical. | n! / (n1! * n2! * ... * nk!) |
| Pigeonhole Principle | If n items are placed into m containers and n > m, some container has >= 2 items. | ceil(n/m) |
| Binomial Theorem | Expansion of (a + b)^n. | (a+b)^n = Sum C(n,k) * a^(n-k) * b^k |
| Inclusion-Exclusion Principle | Counts the union of sets by adding single sets, subtracting pairwise overlaps, adding triple overlaps, and so on. | |A ∪ B| = |A| + |B| − |A ∩ B| |
| Combinations with Repetition | Choose k items from n types where an item can be chosen more than once and order does not matter. | C(n + k - 1, k) |
| Stars and Bars | Counts ways to distribute n identical items into k distinct bins. | C(n + k - 1, k - 1) |
| Multinomial Coefficient | Counts arrangements of n items with k1, k2, ... km identical items of each kind. | n! / (k1! k2! ... km!) |
| Circular Permutations | Arrangements of n distinct objects around a circle, where rotations count as the same arrangement. | (n - 1)! |
| Derangements | Permutations in which no element appears in its original position. | !n = n! (1 - 1/1! + 1/2! - ... + (-1)^n / n!) |
| Pascal's Rule | Each binomial coefficient is the sum of the two above it in Pascal's triangle. | C(n, k) = C(n - 1, k - 1) + C(n - 1, k) |
| Catalan Numbers | Count balanced parentheses, binary trees with n nodes, and monotonic lattice paths that stay on one side of the diagonal. | C_n = C(2n, n) / (n + 1) |
| Stirling Numbers of the Second Kind | Number of ways to partition n labeled items into k non-empty unlabeled subsets. | S(n, k) = k S(n - 1, k) + S(n - 1, k - 1) |
The shape of this dataset, read from the data itself: every column, its type and a real value. Agents can use this to plan a query without fetching the whole document.
| Section | Field | Type | Example |
|---|---|---|---|
| data | principle | string | Product Rule |
| data | description | string | If task A has m ways and task B has n ways, bot… |
| data | formula | string | m * n |
The static files contain the same reference rows as the API, with no API rate limit. Live metadata, such as view counts, may differ. Use the API for content negotiation; use the static files for a cacheable snapshot.
curl "https://yjtoon.yunusemrevurgun.com/api/dataset/combinatorics-fundamentals?format=toon"
const res = await fetch( "https://yjtoon.yunusemrevurgun.com/static-data/dataset/combinatorics-fundamentals.toon" ); const toon = await res.text();
Rate limit: 120 requests per minute per IP, no key and no signup. API reference →