Discrete Math Cheatsheet

Definitions, Symbols, Formulas, and Notes — All in One Place.

Logical Connectives

Term

Symbol

Definition

Logical Expression

Negation

¬

Not

¬p

p

p

ConjunctionAnd

p AND q

pq

DisjunctionOr

p OR q

pq

Implication

Conditional

If, Then.

If p, then q

p implies q

pq
Biconditional

If And Only IF.

p if and only if q

pq
ConverseIf q, then pqp
InverseIf ¬p, then ¬q.¬p¬q
ContrapositiveIf ¬q, then ¬p.¬q¬p
ThereforeUsually goes before the final statement in a proof.

Logical Equivalences

Term

Equivalence

Identity Laws

pTp

pFp

Domination Laws

Null Laws

pFF

pTT

Idempotent Laws

ppp

ppp

Double Negation Law

Involution Law

¬(¬p)p
Commutative Laws

pqqp

pqqp

Associative Laws

(pq)rp(qr)

(pq)rp(qr)

Distributive Laws

p(qr)(pq)(pr)

p(qr)(pq)(pr)

De Morgan's Laws

¬(pq)(¬p)(¬q)

¬(pq)(¬p)(¬q)

Absorption Laws

p(pq)p

p(pq)p

Negation Laws

p¬pF

p¬pT

Logical Equivalencepq

Logic Definitions

Term

Definition

PropositionA sentence that is either true or false, but not both.
ContradictionA proposition that is always false.
ContingencyA proposition that is neither a tautology nor a contradiction.
TautologyA proposition that is always true.
Truth TableA table used to determine the truth value of a logical expression based on all possible combinations of input truth values.
PredicateA logical statement whose truth value is a function of one or more variables.

Quantifiers

Term

Symbol

Definition

Example

Universal Quantifier

For all x, p(x)

For all

For any

For each

xp(x)
Existential Quantifier

There exists x such that p(x)

There exists

There is at least one

xp(x)

Logical Equivalences (Conditional)

Term

pq¬pq
pq¬q¬p
pq¬pq
pq¬(p¬q)
¬(pq)p¬q
(pq)(pr)p(qr)
(pr)(qr)(pq)r
(pq)(pr)p(qr)
(pr)(qr)(pq)r

Logical Equivalence (Biconditional)

Term

pq(pq)(qp)
pq¬p¬q
pq(pq)(¬p¬q)
¬(pq)p¬q

Rules of Inference

Term

Rule of Inference

Tautology

Example

Modus Ponens

Law of Detachment

pqpq((pq)p)q

pq "If it is raining, then I will make tea."
p "It is raining."
q "Therefore, I will make tea."

Modus Tollenspq¬q¬p(pq)¬q¬p

Additionqqrp(pq)

Simplificationqrq(pq)p

Resolutionpq¬prqr (pq)(¬pr)(qr)

Hypothetical Syllogismpqqrpr(pq)(qr)(pr)

Disjunctive Syllogismpq¬pq(pq)¬pq

Set Theory

Term

Definition

Notation

SetA collection of objects, enclosed in braces.A={1,2,3,4}

Element

Member

An object in a set.

Cardinality

Size

The total number of elements in a set. For example: A={1,2,3,4}.|A|=4|X|
Set Builder NotationA special notation used to describe sets that are too complex to list between braces. For example: E={4,2,0,2,4}E={2n:nZ}X={expression:rule}
Finite SetA set with a countable amount of elements.
Infinite SetA set with an infinite amount of elements.
Ordered PairA list x,y of two things x and y.(x,y)
Empty SetA set that has no elements.

{}

PowersetThe power set of any given set is a set of all the subsets of that set, including the empty set and the set itself. The power set is denoted as P(A) for a set A.P(A)
SubsetA subset is a set where every element of this set is also an element of another set. More formally, a set A is a subset of a set B if every element of A is also an element of B. This is denoted AB.

AB

x:xAxB

Proper SubsetA proper subset is a subset of a set that is not identical to the original set. More formally, if A is a subset of B, and there is at least one element in B that is not in A, then A is a proper subset of B.

AB

AByB:yA

SupersetA set's superset contains all of its elements, potentially along with additional elements.AB
Proper SupersetA superset that is not equal to the original set.AB
Set Equality

ABBA

A=B

Universal SetA set which contains all elements under consideration in a context or problem.U
Power Set Given a set S, the power set contains all subsets of S, including the empty set and S itself.P(A)
TupleAn ordered list of elements, often represented as (x,y)(1,2)
Roster NotationA concise way to represent a set by listing its elements, separated by commas and enclosed in braces.A={1,2,3,4}
Disjoint Set

Common Sets

Term

Symbol

Definition

Examples

Natural NumbersNThe set of natural numbers (Positive Integers)N={1,2,3,4,5,6,7,}
IntegersZThe set of integers.Z={,3,2,1,0,1,2,3,4,}
Rational NumbersQThe set of rational numbers.Q={x:x=mn, where m,nZ and n0}
Real NumbersRThe set of real numbers.R={5,2.5,2.5,5}
Prime NumbersPThe set of prime numbers, which are integers greater than 1 with no positive divisors other than 1 and themselvesP={7,5,2,2,5,7}
Whole NumbersWThe set of all positive integers, including zero.W={0,1,2,3,4,5,}
Irrational NumbersIThe set of numbers that cannot be expressed as a ratio of two integers. Examples include the square root of 2.I={(2),π}

Set Operations

Term

Notation

Definition

Set ComplementALet A be a set with a universal set U. The complement of A is the set A=UA.
Set IntersectionGiven two sets A and B, their intersection is a set composed only of the elements that are both in A and in B.
Set UnionGiven two sets A and B, their union is the set composed of all elements both in A and B.
Cartesian Product

×

A×B={(a,b):aA,bB}

The multiplication of two sets A and B, resulting in a set of ordered pairs of elements from A and B.
Cartesian Power

An

An=A×A××A={(x1,x2,,xn):x1,x2,,xnA}

The cartesian product of a set A with itself n times.
Set DifferenceABThe difference of two sets A and B is the set of all elements that are in A but not in B.
Symmetric Difference

AΔB

{xxAxB}

Counting

Term

Symbol

Definition

Formula

ListAn ordered sequence of objects, enclosed in parenthesis.(a,b,c,d,e)
Empty ListA special list with no entries.
Multiplication PrincipleSuppose in making a list of length n there are a1 possible choices for the first entry, a2 possible choices for the second entry, a3 possible choices for the third entry, and so on. Then the total number of different lists that can be made this way is the product of a1a2a3an
Factorialn!The product of all positive integers up to a given number n.n!=n(n1)(n2)321
CombinationC(n,k)The number of ways to choose a subset of k elements from a set of n distinct elements, without considering the order.C(n,k)=n!k!(nk)!
PermutationP(n,k)The number of ways to arrange k elements from a set of n distinct elements, considering the order.P(n,k)=n!(nk)!
Binomial TheoremThe binomial theorem describes the algebraic expansion of powers of a binomial. For any positive integer n and any real numbers a and b, the binomial theorem states that (a+b)n=k=0nC(n,k)ankbk(a+b)n=k=0nC(n,k)ankbk
Pigeonhole PrincipleIf n objects are placed into m containers and n>m, then at least one container must contain more than one object.
Generalized Pigeonhole PrincipleThe Generalized Pigeonhole Principle is an extension of the Pigeonhole Principle. It states that if N objects are placed into m containers and N>m, then at least one container must contain at least Nm objects.
Principle of Inclusion and ExclusionA counting technique used to calculate the number of elements in the union of several sets by correcting for overcounting.

Functions

Term

Definition

FunctionA mathematical relation between a set of inputs (domain) and a set of possible outputs (codomain), where each input is related to exactly one output.
DomainThe domain of a function is the set of all possible input values for which the function is defined. It specifies the valid inputs that the function can operate on.
CodomainThe codomainof a function is the set that includes all possible output values that the function can produce. It provides a broader range than the actual outputs and may include values that the function doesn't necessarily map to.

Range

Image

The range of a function, f(A), also known as a function's image, is the set of all actual output values that the function can produce for the given inputs. It represents the values attained by applying the function to elements in its domain.
One-To-One (Injective) FunctionA function in which different elements in the domain map to different elements in the codomain. No two different inputs produce the same output.
Onto (Surjective) FunctionA function in which every element in the codomain has at least one pre-image in the domain. The function covers the entire codomain.
Bijective FunctionA function that is both injective (one-to-one) and surjective (onto). Each element in the domain maps to a unique element in the codomain, and every element in the codomain has a pre-image.
Inverse FunctionFor a bijective function f:AB, the inverse function f1:BA is such that f(f1(y))=y for all y in the codomain of f and f1(f(x))=x for all x in the domain of f.
Function CompositionThe composition of two functions f and g is a new function denoted by gf, defined as (gf)(x)=g(f(x)).
Generating FunctionA generating function is a formal power series used to encode information about a sequence of numbers or combinatorial structures into a single function,

Sequences and Series

Term

Definition

Formula

Summation NotationA concise way to represent the sum of a sequence. It uses the symbol and specifies the terms to be summed, the variable of summation, and the range of values for the variable.i=1nai
Geometric SequenceA sequence in which the ratio of any two consecutive terms is constant. It can be represented by the formula an=a1r(n1), where an is the n-th term, a1 is the first term, n is the number of terms, and r is the common ratio.an=a1r(n1)
Fibonacci SequenceA sequence where each term is the sum of the two preceding terms, usually starting with 0 and 1. The Fibonacci sequence is represented as 0, 1, 1, 2, 3, 5, 8, 13, ...

F0=0,F1=1

Fn=Fn1+Fn2

Periodic SequenceA periodic sequence is a sequence of numbers that repeats itself after a fixed number of terms, called the period.an=an+k
Quadratic SequenceA quadratic sequence is a sequence of numbers where each term is generated by a quadratic function of the form an2+bn+c, where a, b, and c are constants and n is the term number.
Power SeriesA power series represents a function as a sum of powers of xx. Depending on the convergence properties, a power series may converge only for certain values of xx (within its radius of convergence).n=0anxn
Binomial SeriesThe binomial series is a specific form of power series representing the expansion of (1+x)n. The binomial series converges when |x|<1.k=0(nk)xk
Harmonic SeriesThe harmonic series is the sum of the reciprocals of the positive integers. It diverges as n approaches infinity, meaning it grows without bound.Hn=k=1n1k
Sum of Geometric SequenceThe sum of the terms of a geometric sequence. It can be represented by the formula Sn=a1(rn1)r1, where Sn is the sum of the first n terms, a1 is the first term, n is the number of terms, and r is the common ratio.Sn=a1(rn1)r1
Sum of Arithmetic SequenceThe sum of the terms in an arithmetic sequence. Sn=n2(2a1+(n1)d)
Recurrence RelationsAn equation that recursively defines a sequence in terms of its previous terms. It expresses each term as a function of one or more previous terms.
Arithmetic SequenceA sequence in which the difference of any two consecutive terms is constant. It can be represented by the formula an=a1+(n1)d, where an is the n-th term, a1 is the first term, n is the number of terms, and d is the common difference.an=a1+(n1)
ConvergenceConvergence occurs when the terms in a sequence or series approach a finite limit as the index or the number of terms increases, indicating stability or convergence towards a specific value.
Radius of ConvergenceGiven a power series in the form n=0cn(xa)n, the radius of convergence is the number R where the series converges absolutely for all x in the interval (aR,a+R), and diverges for x outside this interval.
DivergenceDivergence occurs when a sequence or series does not approach a finite limit as the index or the number of terms increases, indicating instability or divergence towards positive or negative infinity.

Graph Theory

Term

Definition

Formula

Vertex, NodeA vertex represents a distinct point or object in a graph.V
EdgeAn edge represents a connection or relationship between two nodes or vertices. It defines the link or interaction between the entities represented by the connected nodes.E
WalkA sequence of vertices in a graph where consecutive vertices are connected by edges. It can include repeated vertices and edges.
Open WalkA walk in a graph that starts and ends at different vertices.
Closed WalkA walk in a graph that starts and ends at the same vertex.
CircuitA closed walk in a graph where vertices may be repeated but no edge is repeated.
CycleA closed walk in a graph where no edge is repeated. Every cycle is a circuit, but not every circuit is a cycle.
Bipartite GraphA graph whose vertices can be divided into two disjoint sets such that every edge connects a vertex from one set to a vertex in the other set. A common notation is G=(V,E) with V=V1V2 and E(V1×V2)(V2×V1).
Directed GraphA graph in which edges have a direction, indicating a one-way relationship between the connected vertices. Also known as a digraph.
SubgraphA graph formed by selecting a subset of vertices and edges from a larger graph, preserving the relationships between the selected vertices.
TrailA walk in a graph where no edge is repeated. Vertices may be repeated, but edges are distinct.
PathA trail in a graph where no vertex is repeated. Both vertices and edges are distinct along the path.
Euler CircuitsA circuit in a graph that visits every edge exactly once and returns to the starting vertex. For a graph to have an Euler circuit, every vertex must have an even degree.
Euler PathsA path in a graph that visits every edge exactly once. For a graph to have an Euler path, it must have exactly two vertices with an odd degree (or zero odd-degree vertices).
Hamilton CircuitsA Hamiltonian circuit is a traversal of a graph that visits each vertex exactly once and returns to the starting vertex.
Hamilton PathsA Hamiltonian path is a traversal of a graph that visits each vertex exactly once. Unlike a Hamiltonian circuit, it doesn't necessarily return to the starting vertex.
MatchingA set of edges in a graph, with no two edges sharing a common vertex. A maximum matching is the largest possible matching in a graph.
Euler's FormulaIn graph theory, Euler's formula relates the number of vertices, edges, and faces of a connected planar graph. It is expressed as VE+F=2, where V is the number of vertices, E is the number of edges, and F is the number of faces.
Graph ColoringColoring a graph is an assignment of labels (colors) to its vertices such that no two adjacent vertices have the same color.
Chromatic NumbersThe chromatic number of a graph is the minimum number of colors needed for a valid coloring.
Complete GraphA complete graph is a graph in which each pair of distinct vertices is connected by a unique edge.
Null GraphA null graph is a graph with no edges, meaning it consists solely of isolated vertices. It is the simplest possible graph, containing no connections between any pair of vertices.
DegreeDegree is a measure of the connectivity of a vertex in a graph, representing the number of edges incident to that vertex. In undirected graphs, the degree of a vertex is simply the count of adjacent edges, while in directed graphs, there are separate in-degree and out-degree measures.
AdjacencyIn a graph, vertices that share an edge are said to be adjacent.
IncidencyIf a vertex is incident to an edge, it means the vertex is directly connected to the edge. Similarly, when an edge is incident to a vertex, it is directly connected to the vertex.
Graph IsomorphismGraph isomorphism is a property of two graphs where despite having potentially different vertex and edge labels, their structures remain identical, meaning there exists a bijective mapping between their vertices preserving adjacency relationships.
In-degreeThe number of edges the number of edges that are directed towards a vertex in a directed graph.
Out-degreeThe number of edges that are directed away from a vertex in a directed graph.

Advanced Graph Theory

Term

Definitions

WheelA type of graph that contains a cycle of length nn (called the rim) and a single vertex (called the hub) that is connected to every vertex on the rim.
Countable Graph A graph is countable if its vertex set is countable, meaning it has either a finite number of vertices or a countably infinite number of vertices.
Graph Transitivity In a directed graph, transitivity refers to the property where if there exists a directed edge from vertex A to vertex B, and another directed edge from vertex B to vertex C, then there is also a directed edge from vertex A to vertex C
Tournament A directed graph in which every pair of distinct vertices is connected by exactly one directed edge.
HypergraphA generalization of a graph in which an edge can connect any number of vertices, rather than just two.
Partial Transversal In the context of hypergraphs, a partial transversal is a subset of vertices that intersects with some, but not necessarily all, of the hyperedges.
Edge-Disjoint PathsIn a graph, edge-disjoint paths are paths that do not share any common edges.
Vertex-Disjoint PathsIn a graph, vertex-disjoint paths are paths that do not share any common vertices, except possibly for their endpoints.
VW-Disconnecting SetIn a graph, a VW-disconnecting set is a set of vertices that, when removed from the graph, disconnects all paths between a set of source vertices V and a set of target vertices W.
VW-Separating Setn a graph, a VW-separating set is a set of vertices that, when removed from the graph, separates all paths between a set of source vertices V and a set of target vertices W.
Dual GraphIn the context of planar graphs, the dual graph of a planar graph is a graph that represents the faces of the original graph as vertices, and connects two vertices if the corresponding faces share an edge.
NetworkA graph that represents connections between nodes, often used to model transportation systems, communication networks, etc.
SourceIn a network or flow graph, a source is a node from which flow originates.
SinkIn a network or flow graph, a sink is a node where flow is consumed or terminates.
Flow In the context of flow networks, flow refers to the quantity of some resource (e.g., water, data) that is sent through edges from a source to a sink, subject to certain capacity constraints.
Graph SaturationThe process of adding edges to a graph in order to satisfy certain connectivity or degree requirements.
CutA partition of the vertices of a graph into two disjoint sets such that removing the edges that connect the two sets disconnects the graph.
Max-flow min-cut theoremA theorem relating to networks that states that the maximum flow from a source to a sink in a flow network is equal to the minimum capacity of a cut in the network.
ArcsA directed edge that connects two vertices, indicating a one-way connection from one vertex (the tail) to another vertex (the head).
Dual GraphIn directed graphs, arcs are directed edges that connect two vertices, indicating a one-way connection from one vertex to another
Strong ConnectionA strong connection typically refers to a directed graph where there exists a directed path from every vertex to every other vertex.
Weak ConnectionA weak connection typically refers to an undirected graph where there exists a path between every pair of vertices.

Integers

Term

Definition

Formula

Prime NumberA prime number is a natural number greater than 1 that has no positive divisors other than 1 and itself. In other words, it cannot be formed by multiplying two smaller natural numbers.
Composite NumberA composite number is a natural number greater than 1 that is not a prime number. It has divisors other than 1 and itself, meaning it can be formed by multiplying two smaller natural numbers.
Odd NumberAn odd number is a natural number that is not divisible evenly by 2. In other words, it leaves a remainder of 1 when divided by 2. 2n+1
Even NumberAn even number is a natural number that is divisible evenly by 2. It leaves no remainder when divided by 2. 2n
Greatest Common DivisorThe largest positive integer that divides two or more integers without leaving a remainder. gcd(a,b)
Prime FactorizationThe expression of a composite number as the product of its prime factors. For a positive integer n, the prime factorization is written as n=p1e1p2e2pkek, where p1,p2,,pk are prime numbers and e1,e2,,ek are their respective exponents.
Chinese Remainder TheoremThe Chinese Remainder Theorem states that states that if m1,m2,,mk are pairwise coprime positive integers, and a1,a2,,ak are any integers, then there exists a unique integer x such that xa1(modm1), xa2(modm2), , xak(modmk).
The Division AlgorithmA fundamental theorem stating that given any integers a and b, with b>0, there exist unique integers q and r such that a=bq+r, where 0r<|b|.
Linear Diophantine EquationAn equation of the form ax+by=c, where a,b, and c are integers, and x and y are variables. A solution exists if and only if c is a multiple of the greatest common divisor of a and b.
Euclidean AlgorithmAn extension of the Euclidean Algorithm used to find the coefficients x and y such that ax+by=gcd(a,b). It is often applied in finding modular inverses.
Extended Euclidean AlgorithmThe smallest positive integer that is a multiple of two or more integers. It is often denoted as lcm[a,b] for integers a and b.
Least Common MultipleThe smallest positive integer that is a multiple of two or more integers. It is often denoted as lcm[a,b] for integers a and b.
Modular Multiplicative InverseFor an integer a and a modulus m, the modular multiplicative inverse of a (mod m) is an integer x such that ax1(modm). It exists if and only if a and m are coprime.
CoprimeTwo integers are said to be coprime if their greatest common divisor is 1

Relations

Term

Definition

RelationA relation between sets is a set of ordered pairs. It describes how elements from one set relate to elements in another set.
Reflexive RelationA relation on a set where every element is related to itself. Formally, for all a in the set, (a,a) is in the relation.
Symmetric RelationA relation on a set where if (a,b) is in the relation, then (b,a) is also in the relation for all a,b in the set.
Transitive RelationA relation on a set where if (a,b) and (b,c) are in the relation, then (a,c) is also in the relation for all a,b,c in the set.
Binary RelationA binary relation describes a connection or relationship between pairs of elements in a set.
Irreflexive RelationA relation on a set where no element is related to itself. Formally, for all a in the set, (a,a) is not in the relation.
Antisymmetric RelationA relation on a set where if (a,b) is in the relation, then (b,a) is not in the relation for all a,b in the set.
PartitionsA partition of a set is a grouping of its elements into non-empty subsets, in such a way that every element is included in exactly one subset.
Equivalence RelationA relation on a set that is reflexive, symmetric, and transitive. It divides the set into equivalence classes where elements within a class are equivalent.
Equivalence ClassAn equivalence class is a group of elements from a set that are considered equivalent to each other based on some defined equivalence relation.
Partial OrderingA partial ordering satisfies reflexivity, antisymmetry, and transitivity but may not be total.
Total OrderingA total ordering is a relation that is reflexive, antisymmetric, and transitive.
Cover RelationIn a partially ordered set, a cover relation describes when one element is immediately greater than another, with no elements in between.
Linear ExtensionA linear extension is a total order that maintains the same order relationship as the partial order, arranging elements in a sequence without any ambiguity or conflict in the ordering.

Discrete Probability

Term

Definition

Formula

Bayes' TheoremA mathematical formula that describes the probability of an event based on prior knowledge of conditions that might be related to the event. It is named after the Reverend Thomas Bayes.
Bernoulli TrialsA sequence of independent experiments or trials, each with only two possible outcomes: success or failure. The trials are identically distributed.
Conditional ProbabilityThe probability of event A occurring given that event B has occurred. It is calculated using the formula P(A|B)=P(AB)P(B).P(A|B)=P(AB)P(B)
Expected ValueThe average value of a random variable. For a discrete random variable X, the expected value E(X) is calculated as the sum of each possible value multiplied by its probability: E(X)=xP(X=x).E(X)=xP(X=x)
Independent EventsTwo events are independent if the occurrence of one event does not affect the occurrence of the other. For independent events, the probability of both events occurring is the product of their individual probabilities: P(AB)=P(A)P(B).P(AB)=P(A)P(B)
DistributionIn statistics, a distribution is a function that describes the likelihood of obtaining the possible values that a random variable can take.

Proof-Writing Techniques

Term

Definition

Example

Direct ProofA proof of some statement one arrives at through logical, sequential statements.
Proof by ContrapositiveA method of proof that begins supposes the contrapositive is true and through logical, sequential statements, proves the original statement. You might use this if the contrapositive is easier to prove than the original statement.
Proof by ContradictionA proof of some statement that begins with the assumption that it is not true, and then reasons that it is impossible for it to be untrue.
Proof by InductionA method of proof where one proves a base case
Proof by casesA method of proof that separates the original statement into separate cases and then proves them individually.

Connect with Us

Support our mission in making computer science easier by following our socials
and registering for our free student events!

Instagram
Discord
Eventbrite
TikTok
Twitter
LinkedIn
Slack
Youtube