Counting formulas
Combinatorics: counting. 26 formulas for GATE CS Discrete Mathematics, each with when to use it. Each is explained in the topic notes.
IAE Academy: Combinatorics: counting formulas (GATE CS)
All 26 Counting formulas
PERMUTATIONS OF R FROM N DISTINCT OBJECTS
Ordered arrangements, no repetition, . Also the number of injective functions from an -set to an -set.
COMBINATIONS
Unordered selections of from distinct objects, no repetition, . Symmetry: choosing the ones taken is the same as choosing the ones left.
SELECTIONS WITH REPETITION
Unordered choice of items from kinds () when each kind may be taken any number of times (multisets of size ).
CIRCULAR ARRANGEMENTS
Seating distinct people round a table when rotations count as the same arrangement (reflections counted as different). If reflections are also the same and , divide by 2: .
ARRANGEMENTS WITH IDENTICAL ITEMS (MULTINOMIAL COEFFICIENT)
Distinct arrangements of objects of which are alike of type , . It is also the number of ways to split distinct objects into labelled groups of sizes .
STARS AND BARS: NON-NEGATIVE SOLUTIONS
Number of integer solutions (); equals the number of ways to put identical objects into distinct bins, empty bins allowed.
STARS AND BARS: POSITIVE SOLUTIONS
Every bin non-empty (). For a lower bound , substitute and reduce by .
STARS AND BARS WITH AN INEQUALITY
Add a slack variable ; the equation now has unknowns summing to .
STIRLING NUMBERS OF THE SECOND KIND
= number of ways to split a set of distinct objects into non-empty unlabelled blocks. Conventions: , for , for . Also . Example values: , , .
PARTITIONS OF AN INTEGER INTO EXACTLY K PARTS
Number of ways to write as a sum of exactly positive integers with order ignored. Boundary values: ; if , or if and . is the total over all ; .
BINOMIAL THEOREM
For a non-negative integer . The coefficient of is ; there are terms. In the coefficient of , where , is .
PASCAL'S IDENTITY
For and . Split the -subsets of an -set by whether they contain a chosen element.
SUM OF A ROW
Total number of subsets of an -set; from and . Hence even-size subsets and odd-size subsets each number for .
WEIGHTED ROW SUM
Follows from (choose a committee, then its leader).
VANDERMONDE'S IDENTITY
Choose from two groups of sizes and by how many come from the first (terms with or are 0). The case gives .
HOCKEY-STICK IDENTITY
For . Sum down a diagonal of Pascal's triangle.
INCLUSION-EXCLUSION
Counts elements with at least one of properties; for two sets, . The number with none of the properties is minus this value.
ONTO FUNCTIONS
Functions from an -set onto a -set; equals and is if .
DERANGEMENTS
Permutations of objects with no object in its original place. Convention . Also , and for , is the integer nearest to . .
PERMUTATIONS WITH EXACTLY K FIXED POINTS
Choose which objects stay put, then derange the other (for this gives , the identity).
PIGEONHOLE PRINCIPLE (GENERALISED)
For positive integers , . To guarantee at least objects in one of boxes you need objects. It proves existence only; it does not construct the box.
BELL NUMBERS
Number of partitions of an -set into non-empty blocks, which is also the number of equivalence relations on it (each relation corresponds to its set of equivalence classes).
LATTICE PATHS
Shortest paths from to using unit steps right and up: choose which of the steps are right. Forced points are handled by multiplying path counts of each leg.
CATALAN NUMBERS
Paths from to with right steps (along ) and up steps (along ) that never go above the line (touching allowed). Also: balanced bracket strings with pairs; unlabelled binary trees with nodes (left and right child distinguished); binary search trees on distinct keys; full binary trees with leaves; ways to parenthesise a product of factors; triangulations of a convex -gon.
BINARY STRINGS WITH NO TWO CONSECUTIVE 1S
Condition on the end: a valid string ending in 0 is any valid string of length followed by 0; a valid string ending in 1 must end in 01, after any valid string of length . Values: 2, 3, 5, 8, 13, 21, 34, 55 for ; with .
K-SUBSETS WITH NO TWO CONSECUTIVE ELEMENTS
Number of -element subsets of with no two consecutive integers; equivalently binary strings of length with ones, no two adjacent (place the ones in the gaps around the zeros).
Where this was asked: 2020 (1), 2022 (1), 2023 (1), 2025 (2), 2026 (1). See the 6 previous-year questions on Counting. This shows what was asked, not what will be asked.