You are on page 1of 1

Theoretical Computer Science Cheat Sheet

Number Theory Graph Theory


The Chinese remainder theorem: There ex- Definitions: Notation:
ists a number C such that: Loop An edge connecting a ver- E(G) Edge set
tex to itself. V (G) Vertex set
C ≡ r1 mod m1 c(G) Number of components
Directed Each edge has a direction.
.. .. .. Simple Graph with no loops or G[S] Induced subgraph
. . .
multi-edges. deg(v) Degree of v
C ≡ rn mod mn ∆(G) Maximum degree
Walk A sequence v0 e1 v1 . . . eℓ vℓ .
if mi and mj are relatively prime for i 6= j. Trail A walk with distinct edges. δ(G) Minimum degree
Path A trail with distinct χ(G) Chromatic number
Euler’s function: φ(x) is the number of
vertices. χE (G) Edge chromatic number
positive integersQnless than x relatively Connected A graph where there exists Gc Complement graph
prime to x. If i=1 pei i is the prime fac-
a path between any two Kn Complete graph
torization of x then
Yn
vertices. Kn1 ,n2 Complete bipartite graph
φ(x) = piei −1 (pi − 1). Component A maximal connected
r(k, ℓ) Ramsey number
i=1
subgraph. Geometry
Euler’s theorem: If a and b are relatively Tree A connected acyclic graph.
prime then Projective coordinates: triples
Free tree A tree with no root.
1 ≡ aφ(b) mod b. (x, y, z), not all x, y and z zero.
DAG Directed acyclic graph.
Eulerian Graph with a trail visiting (x, y, z) = (cx, cy, cz) ∀c 6= 0.
Fermat’s theorem:
each edge exactly once. Cartesian Projective
1 ≡ ap−1 mod p.
Hamiltonian Graph with a cycle visiting (x, y) (x, y, 1)
The Euclidean algorithm: if a > b are in- each vertex exactly once. y = mx + b (m, −1, b)
tegers then Cut A set of edges whose re- x=c (1, 0, −c)
gcd(a, b) = gcd(a mod b, b). moval increases the num- Distance formula, Lp and L∞
Qn
If i=1 pei i is the prime factorization of x ber of components. metric:
Cut-set A minimal cut.
p
then (x1 − x0 )2 + (y1 − y0 )2 ,
n Cut edge A size 1 cut.
X Y piei +1 − 1 1/p
|x1 − x0 |p + |y1 − y0 |p

S(x) = d= . k-Connected A graph connected with ,
i=1
pi − 1
d|x the removal of any k − 1 lim |x1 − x0 |p + |y1 − y0 |p
 1/p
.
Perfect Numbers: x is an even perfect num- vertices. p→∞

ber iff x = 2n−1 (2n −1) and 2n −1 is prime. k-Tough ∀S ⊆ V, S 6= ∅ we have Area of triangle (x0 , y0 ), (x1 , y1 )
Wilson’s theorem: n is a prime iff k · c(G − S) ≤ |S|. and (x2 , y2 ):

(n − 1)! ≡ −1 mod n. k-Regular A graph where all vertices 1
x1 − x0 y1 − y0
2 abs x − x
.
have degree k. 2 0 y2 − y0
Möbius 
inversion: k-Factor A k-regular spanning
1 if i = 1. Angle formed by three points:
subgraph.

0 if i is not square-free.

µ(i) = r Matching A set of edges, no two of
 (−1) if i is the product of
 (x2 , y2 )
r distinct primes. which are adjacent.
ℓ2
Clique A set of vertices, all of
If θ
X which are adjacent.
G(a) = F (d), (0, 0) ℓ1 (x1 , y1 )
Ind. set A set of vertices, none of
d|a
which are adjacent. (x1 , y1 ) · (x2 , y2 )
cos θ = .
then X a Vertex cover A set of vertices which ℓ1 ℓ2
F (a) = µ(d)G . cover all edges. Line through two points (x0 , y0 )
d
d|a Planar graph A graph which can be em- and (x1 , y1 ):

Prime numbers: beded in the plane. x y 1
ln ln n

Plane graph An embedding of a planar x0 y0 1 = 0.
pn = n ln n + n ln ln n − n + n
  ln n graph. x1 y1 1
n Area of circle, volume of sphere:
+O ,
X
ln n deg(v) = 2m.
v∈V
A = πr2 , V = 34 πr3 .
n n 2!n
π(n) = + + If G is planar then n − m + f = 2, so
ln n (ln n)2 (ln n)3 If I have seen farther than others,
  f ≤ 2n − 4, m ≤ 3n − 6. it is because I have stood on the
n
+O . Any planar graph has a vertex with de- shoulders of giants.
(ln n)4
gree ≤ 5. – Issac Newton

You might also like