12.07.2015 Views

Cheat_Sheet

Cheat_Sheet

Cheat_Sheet

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Number TheoryThe Chinese remainder theorem: There existsa number C such that:C ≡ r 1 mod m 1...C ≡ r n mod m nif m i and m j are relatively prime for i ≠ j.Euler’s function: φ(x) is the number ofpositive integers less than x relativelyprime to x. If ∏ ni=1 pei i is the prime factorizationof x thenn∏φ(x) = p ei−1i (p i − 1).i=1Euler’s theorem: If a and b are relativelyprime then1 ≡ a φ(b) mod b.Fermat’s theorem:1 ≡ a p−1 mod p.The Euclidean algorithm: if a>bare integersthengcd(a, b) = gcd(a mod b, b).If ∏ nis the prime factorization of xtheni=1 pei iS(x) = ∑ d =d|xn∏i=1p ei+1i − 1p i − 1 .Perfect Numbers: x is an even perfect numberiff x =2 n−1 (2 n −1) and 2 n −1 is prime.Wilson’s theorem: n is a prime iff(n − 1)! ≡−1modn.Möbius ⎧inversion:1 if i =1.⎪⎨0 if i is not square-free.µ(i) =⎪⎩ (−1) r if i is the product ofr distinct primes.IfG(a) = ∑ F (d),d|athenF (a) = ∑ ( a)µ(d)G .dd|aPrime numbers:ln ln np n = n ln n + n ln ln n − n + n( )ln nn+ O ,ln nπ(n) =nln n + n(ln n) 2 + 2!n(ln n)( )3n+ O(ln n) 4 .Theoretical Computer Science <strong>Cheat</strong> <strong>Sheet</strong>Graph TheoryDefinitions:Loop An edge connecting a vertexto itself.Directed Each edge has a direction.Simple Graph with no loops ormulti-edges.Walk A sequence v 0 e 1 v 1 ...e l v l .Trail A walk with distinct edges.Path A trail with distinctvertices.Connected A graph where there existsa path between any twovertices.Component A maximal connectedsubgraph.Tree A connected acyclic graph.Free tree A tree with no root.DAG Directed acyclic graph.Eulerian Graph with a trail visitingeach edge exactly once.Hamiltonian Graph with a cycle visitingeach vertex exactly once.Cut A set of edges whose removalincreases the numberof components.Cut-set A minimal cut.Cut edge A size 1 cut.k-Connected A graph connected withthe removal of any k − 1vertices.k-Tough ∀S ⊆ V,S ≠ ∅ we havek · c(G − S) ≤|S|.k-Regular A graph where all verticeshave degree k.k-Factor A k-regular spanningsubgraph.Matching A set of edges, no two ofwhich are adjacent.Clique A set of vertices, all ofwhich are adjacent.Ind. set A set of vertices, none ofwhich are adjacent.Vertex cover A set of vertices whichcover all edges.Planar graph A graph which can be embededin the plane.Plane graph An embedding of a planargraph.∑deg(v) =2m.v∈VIf G is planar then n − m + f =2,sof ≤ 2n − 4, m ≤ 3n − 6.Any planar graph has a vertex with degree≤ 5.Notation:E(G) Edge setV (G) Vertex setc(G) Number of componentsG[S] Induced subgraphdeg(v) Degree of v∆(G) Maximum degreeδ(G) Minimum degreeχ(G) Chromatic numberχ E (G) Edge chromatic numberG c Complement graphK n Complete graphK n1,n 2Complete bipartite graphr(k, l) Ramsey numberGeometryProjective coordinates: triples(x, y, z), not all x, y and z zero.(x, y, z) =(cx, cy, cz) ∀c ≠0.Cartesian Projective(x, y) (x, y, 1)y = mx + b (m, −1,b)x = c (1, 0, −c)Distance formula, L p and L ∞metric:√(x1 − x 0 ) 2 +(y 1 − y 0 ) 2 ,[|x1 − x 0 | p + |y 1 − y 0 | p] 1/p,[lim |x1 − x 0 | p + |y 1 − y 0 | p] 1/p.p→∞Area of triangle (x 0 ,y 0 ), (x 1 ,y 1 )and (x 2 ,y 2 ):∣ ∣1 ∣∣∣2 abs x 1 − x 0 y 1 − y 0 ∣∣∣.x 2 − x 0 y 2 − y 0Angle formed by three points:(x 2 ,y 2 )l 2θ(0, 0) l 1 (x 1 ,y 1 )cos θ = (x 1,y 1 ) · (x 2 ,y 2 ).l 1 l 2Line through two points (x 0 ,y 0 )and (x 1 ,y 1 ):x y 1x 0 y 0 1∣ x 1 y 1 1 ∣ =0.Area of circle, volume of sphere:A = πr 2 , V = 4 3 πr3 .If I have seen farther than others,it is because I have stood on theshoulders of giants.– Issac Newton

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!