The whole Discrete Mathematics formula sheet, to print
108 formulas in 6 topics, each with when to use it. Each is explained in the topic notes.
IAE Academy: Discrete Mathematics formula sheet (GATE CS)
Propositional and first-order logic
Read the notesIMPLICATION AS A DISJUNCTION
Use it to remove before any manipulation; it holds for all truth values.
BICONDITIONAL
True exactly when and have the same truth value; .
COUNTING TRUTH TABLES
For distinct atoms; the second count is the number of different possible output columns.
IDENTITY, DOMINATION AND COMPLEMENT LAWS
Here T and F stand for the constants true and false.
DE MORGAN'S LAWS
Negation swaps and and negates each part.
DISTRIBUTIVE LAWS
Each of and distributes over the other.
ABSORPTION AND DOUBLE NEGATION
Useful for quickly simplifying a formula.
NEGATION OF AN IMPLICATION
An implication fails only when the hypothesis holds and the conclusion fails.
MOVING IMPLICATIONS AROUND
Exportation and the two combining rules; note the hypotheses combine with when the conclusion is shared.
COMBINING IMPLICATIONS WITH OR
Rewrite each side with to check them. With a shared conclusion and between the implications, the hypotheses combine with .
TEST FOR A VALID ARGUMENT
To refute an argument, find one assignment making every premise true and the conclusion false.
NEGATING QUANTIFIERS
Push inside by flipping each quantifier and negating the body; repeat for nested quantifiers.
QUANTIFIERS THAT DISTRIBUTE
distributes over and distributes over , as equivalences.
PULLING A QUANTIFIER PAST A FORMULA THAT DOES NOT MENTION $X$
The same holds for with and with . The step (or ) used here relies on the domain being non-empty.
MOVING A QUANTIFIER OUT OF AN ANTECEDENT
The quantifier flips when it leaves the antecedent. It keeps its kind when it leaves the consequent: and . The forms need a non-empty domain.
EXISTENTIAL OVER AN IMPLICATION
Write the body as , distribute over , and use . By contrast, only implies .
Sets, relations, functions, partial orders and lattices
Read the notesSIZE OF THE POWER SET
For a finite set A; each element is either in or out of a subset.
SIZE OF A CARTESIAN PRODUCT
Finite sets. A relation from A to B is any subset of A × B, so there are of them.
INCLUSION-EXCLUSION FOR TWO SETS
Finite sets; this is the basis of Venn-diagram counting.
INCLUSION-EXCLUSION FOR THREE SETS
Finite sets; add singles, subtract pairs, add the triple.
SIZE OF THE SYMMETRIC DIFFERENCE
Finite sets.
ALL RELATIONS ON AN N-ELEMENT SET
Each of the ordered pairs is in or out.
REFLEXIVE RELATIONS
The n diagonal pairs are forced; the other are free. Irreflexive relations have the same count.
NEITHER REFLEXIVE NOR IRREFLEXIVE
For , where no relation is both reflexive and irreflexive: subtract the reflexive and the irreflexive relations from all relations.
SYMMETRIC RELATIONS
Choose freely for each of the diagonal pairs and each of the unordered pairs with .
ANTISYMMETRIC RELATIONS
Diagonal pairs are free (); each unordered pair with has 3 choices: none, only, only.
ASYMMETRIC RELATIONS
Diagonal pairs are excluded; each unordered pair has the same 3 choices. Reflexive and antisymmetric relations have the same count (diagonal forced in instead of out).
REFLEXIVE AND SYMMETRIC RELATIONS
Diagonal forced to 1; each unordered pair with is in or out. Irreflexive and symmetric relations have the same count.
RELATIONS BOTH SYMMETRIC AND ANTISYMMETRIC
Such a relation is a subset of the identity relation, so only the diagonal pairs are free.
EQUIVALENCE RELATIONS ON N ELEMENTS
(Bell number) counts partitions of an n-element set; (Stirling number of the second kind) counts partitions into exactly non-empty blocks.
RECURRENCES FOR BELL AND STIRLING NUMBERS
With for , and .
PARTITIONS INTO TWO BLOCKS
For : the number of equivalence relations on n elements with exactly two classes.
ALL FUNCTIONS FROM A TO B
Each element of independently picks an image.
INJECTIVE FUNCTIONS
, , ; when there are none (the product form gives 0).
BIJECTIONS BETWEEN SETS OF EQUAL SIZE
; this is also the number of permutations of an n-set.
SURJECTIVE FUNCTIONS (INCLUSION-EXCLUSION)
, ; zero when .
PARTIAL FUNCTIONS FROM A TO B
, ; each element of maps to one of the elements or is left undefined.
SUBSETS OF AN N-SET ORDERED BY INCLUSION
Poset with : is covered by for each .
DIVISIBILITY ON THE DIVISORS OF N
Poset of positive divisors under 'divides' ( distinct primes); join is lcm and meet is gcd.
HASSE DIAGRAM EDGES FOR THE DIVISORS OF N
; is covered by whenever divides . For : .
Monoids and groups
Read the notesNUMBER OF BINARY OPERATIONS ON AN N-ELEMENT SET
A binary operation on a set of elements is a filled table, each of its entries chosen from the elements. A commutative one is fixed by the entries on and above the main diagonal. For : in all, commutative.
INVERSE OF A PRODUCT
Holds in every group; note the reversed order. If the group is abelian the order does not matter. Also .
LAGRANGE'S THEOREM
For a finite group and any subgroup ; is the number of distinct left cosets of in .
ORDER OF AN ELEMENT DIVIDES THE GROUP ORDER
In every finite group, by Lagrange applied to . Also .
ORDER OF A POWER
Holds in any group. In the element has order . If has order , the element generates exactly when .
NUMBER OF GENERATORS OF A CYCLIC GROUP
For a cyclic group of order , where is Euler's totient (the count of with and ).
EULER'S TOTIENT
The product runs over the distinct primes dividing . For a prime , and .
SUBGROUPS OF A CYCLIC GROUP
A cyclic group of order has exactly one subgroup for each positive divisor of , so the number of subgroups equals the number of divisors of . Every subgroup of a cyclic group is cyclic, and the group has exactly elements of order for each .
ORDER IN A DIRECT PRODUCT
In with finite and . Consequently is cyclic if and only if .
GROUPS OF PRIME ORDER
Any non-identity element has order dividing , so order , hence generates . Every non-identity element is a generator, giving generators.
Graph theory: connectivity, matching and colouring
Read the notesHANDSHAKING LEMMA
Holds for every undirected graph (loops count 2). So the number of odd-degree vertices is always even.
MOST EDGES IN A SIMPLE GRAPH
Attained exactly by the complete graph . A -regular simple graph on vertices has edges, so it can exist only if is even and .
EDGES NEEDED FOR $K$ COMPONENTS
A graph with vertices and components has at least edges; so a connected graph has at least edges. Equality holds exactly for forests.
MOST EDGES IN A DISCONNECTED SIMPLE GRAPH
Simple graph on vertices with at least 2 components. Attained by plus one isolated vertex. With exactly components the maximum is .
VERTEX AND EDGE CONNECTIVITY
The vertex connectivity is the fewest vertices whose removal disconnects or leaves a single vertex; the edge connectivity is the fewest edges whose removal disconnects . . A connected graph on vertices has a cut vertex exactly when , and a connected graph on vertices has a bridge exactly when .
LEAVES OF A TREE
For a tree with vertices. In particular every such tree has at least 2 leaves (vertices of degree 1).
CAYLEY'S FORMULA
Number of labelled trees on vertices, which equals the number of spanning trees of . Also and .
COMPLEMENT EDGE COUNT
For a simple graph , the complement has the same vertices and exactly the non-edges of . Degrees satisfy .
SELF-COMPLEMENTARY GRAPHS
Necessary conditions on the order and size of a simple self-complementary graph. Examples: (4 vertices, 3 edges) and (5 vertices, 5 edges).
INDEPENDENT SET AND VERTEX COVER
Holds for every simple (loopless) graph: a set is independent exactly when its complement is a vertex cover.
KÖNIG'S THEOREM
Every vertex cover needs a distinct vertex for each matching edge, so always; equality is guaranteed only for bipartite graphs. (The triangle has , .)
HALL'S CONDITION
A bipartite graph with parts has a matching covering every vertex of if and only if this holds, where is the set of neighbours of . When , this is the condition for a perfect matching.
GREEDY COLOURING BOUND
For every graph, where is the maximum degree. By Brooks' theorem, a connected graph that is neither a complete graph nor an odd cycle has .
CHROMATIC POLYNOMIALS
is the number of proper colourings of using at most colours, with the colours and vertices labelled. is any tree on vertices; needs . Check: . is the least with .
EDGE COLOURING
The chromatic index is the fewest colours that give edges sharing a vertex different colours. The bounds hold for every simple graph (Vizing). A bipartite graph has . for even and for odd .
EULER'S FORMULA
For a connected planar graph (drawn without crossings). With components the right side is .
EDGE BOUND FOR SIMPLE PLANAR GRAPHS
For a simple planar graph with . If the graph also has no triangle (for example, it is bipartite), . Reason: in a simple connected planar graph with , every face has degree at least 3 (at least 4 with no triangle), and . More generally, if every cycle has length at least , then .
DIRAC'S THEOREM
Simple graph with . Ore's generalisation: if for every pair of non-adjacent , then is Hamiltonian. Both are sufficient only.
HAMILTONIAN CYCLES IN $K_N$
For , labelled vertices, counting a cycle and its reverse as the same. is Hamiltonian exactly when , and () has Hamiltonian cycles (1 for , 6 for ).
POWERS OF THE ADJACENCY MATRIX
For the adjacency matrix of a graph (directed or undirected; in a multigraph counts parallel edges, and a loop is entered as 1 in ). Walks may repeat vertices.
Combinatorics: counting
Read the notesPERMUTATIONS 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).
Recurrence relations and generating functions
Read the notesCATALAN NUMBERS AND DERANGEMENTS
For ; for example and .
CHARACTERISTIC EQUATION
For ; it has degree , so roots over the complex numbers counted with multiplicity. Since , no root is 0.
GENERAL SOLUTION, DISTINCT ROOTS
When all roots are distinct (real or complex); the constants come from the initial conditions.
CONTRIBUTION OF A REPEATED ROOT
A root of multiplicity contributes this term; add the contributions of all roots.
FIBONACCI AND LUCAS CLOSED FORMS
Roots of ; and .
FIRST-ORDER LINEAR RECURRENCE
For with constants and . Example: , gives .
GEOMETRIC SERIES
Coefficients and ; so gives .
LINEAR SEQUENCES
Coefficients and .
NEGATIVE BINOMIAL SERIES
For integer ; counts solutions of in non-negative integers.
FINITE SERIES
For integer ; the second gives a bounded choice of to items.
FIBONACCI AND LUCAS GENERATING FUNCTIONS
With and .
NON-NEGATIVE INTEGER SOLUTIONS
For ; the coefficient of in , i.e. identical objects into distinct boxes. With every the count is (for ; zero if ).