You are on page 1of 10

# Theoretical Computer Science Cheat Sheet Denitions f (n) = O(g (n)) f (n) = (g (n)) f (n) = (g (n)) f (n) = o(g

(n))
n

Series
n i=1

i positive c, n0 such that 0 f (n) cg (n) n n0 . i positive c, n0 such that f (n) cg (n) 0 n n0 . i f (n) = O(g (n)) and f (n) = (g (n)). i limn f (n)/g (n) = 0. i > 0, n0 such that |an a| < , n n0 . least b R such that b s, s S . greatest b R such that b s, s S .
n

i=

n(n + 1) , 2

n i=1

i2 =

n(n + 1)(2n + 1) , 6

n i=1

i3 =

n2 (n + 1)2 . 4

## lim an = a sup S inf S lim inf an

n

In general: [ ] n n ( ) 1 im = (n + 1)m+1 1 (i + 1)m+1 im+1 (m + 1)im m+1 i=1 i=1 ( ) n 1 m 1 m+1 Bk nm+1k . im = m + 1 k i=1
k=0

## Geometric series: n cn+1 1 ci = , c1 i=0

n i=0

c = 1,

i=0

ci =

1 , 1c

i=1 i=0

ci =

c , 1c c , (1 c)2

ici =

## ncn+2 (n + 1)cn+1 + c , (c 1)2

n

c = 1,

ici =

n(n 1) n(n + 1) Hn . 2 4 lim sup an lim sup{ai | i n, i N}. i =1 n n ( )( ) n n ( ) (n) i n+1 1 Combinations: Size k subHi = (n + 1)Hn n, Hi = Hn+1 . k m m+1 m+1 sets of a size n set. i=1 i=1 [n] ( ) ( ) ( ) n ( ) Stirling numbers (1st kind): n n! n n n k n 1. = , 2. =2 , 3. = , Arrangements of an n elek (n k )!k ! k k nk k=0 ( ) ( ) ( ) ( ) ( ) ment set into k cycles. n n n1 n n1 n1 {n} 4. = , 5. = + , Stirling numbers (2nd kind): k k k1 k k k1 k ( )( ) ( )( ) ) ( ) n ( Partitions of an n element n m n nk r+k r+n+1 6. = , 7. = , set into k non-empty sets. m k k mk k n n k=0 ( ) ) ( ) n ( ) n ( )( 1st order Eulerian numbers: k k n+1 r s r+s 8. = , 9. = , Permutations 1 2 . . . n on m m+1 k nk n k=0 k=0 {1, 2, . . . , n} with k ascents. ( ) ( ) { } { } n kn1 n n n 10. = (1)k , 11. = = 1, 2nd order Eulerian numbers. k k k 1 n { } { } { } { } Cn Catalan Numbers: Binary n n n1 n1 n 1 12. = 2 1 , 13. = k + , trees with n + 1 vertices. 2 k k k1 [ ] [ ] [ ] [ ] { } n n n n n 14. = (n 1)!, 15. = (n 1)!Hn1 , 16. = 1, 17. , 1 2 n k k [ ] [ ] [ ] { } [ ] ( ) ( ) n [ ] n n1 n1 n n n n 1 2n 18. = (n 1) + , 19. = = , 20. = n! , 21. Cn = , k k k1 n1 n1 2 n+1 n k k =0 n n n n n n1 n1 22. = = 1, 23. = , 24. = (k + 1) + (n k ) , 0 n1 k n1k k k k1 { ( ) 0 n n n+1 1 if k = 0, 25. = 26. = 2n n 1, 27. = 3n (n + 1)2n + , k 1 2 2 0 otherwise ) ) { } ) m ( n ( n ( n x+k n n+1 n n k , 29. = (m + 1 k )n (1)k , 30. m! = , 28. xn = k n m k m k nm k=0 k=0 k=0 ) n { }( n n nk n n nkm 31. = (1) k !, 32. = 1, 33. = 0 for n = 0, m k m 0 n k=0 n n n1 n1 n (2n)n 34. = (k + 1) + (2n 1 k ) , 35. = , k k k1 k 2n k=0 { } ( ) { } ( ){ } } n n { x n x+n1k n+1 n k k 36. = , 37. = = (m + 1)nk , xn k 2n m+1 k m m iHi =
k=0 k k=0

## Harmonic series: n 1 Hn = , i i=1

Theoretical Computer Science Cheat Sheet ( ) n n+1 x n x+k = = 39. = , k m m+1 xn k 2n k k =0 k =0 k =0 { } ( ){ } [ ] [ ]( ) n n k+1 n n+1 k nk = (1) , 41. = (1)mk , m k m+1 m k+1 m k k { } [ ] [ ] { } m m n+k m+n+1 n+k m+n+1 = k , 43. = k (n + k ) , k k m m k =0 k =0 ]{ } }[ ] ( ) [ ( ) { n+1 k n n+1 k n (1)mk , for n m, (1)mk , 45. (n m)! = = k+1 m k+1 m m m k ] k { } [ (m n)(m + n)[ m + k ] (m n)(m + n){ m + k } n n = , 47. = , nm m+k n+k k nm m+k n+k k { }( k ) { }{ }( ) [ ](k ) [ ][ ]( ) n +m k nk n n +m k nk n = , 49. = . +m m k +m m k
k k

[ n ]( k )

] n [ k

## Identities Cont. [ ] n 1 k nnk = n! , m k! m

Trees Every tree with n vertices has n 1 edges. Kraft inequality: If the depths of the leaves of a binary tree are d1 , . . . , d n : n 2di 1,
i=1

## and equality holds only if every internal node has 2 sons.

Recurrences Master method: T (n) = aT (n/b) + f (n), a 1, b > 1 ( ) 1 T (n) 3T (n/2) = n ( ) 3 T (n/2) 3T (n/4) = n/2 . . . . . . . . . ( ) log2 n1 3 T (2) 3T (1) = 2 Let m = log2 n. Summing the left side we get T (n) 3m T (1) = T (n) 3m = T (n) nk where k = log2 3 1.58496. Summing the right side we get m 1 m 1 ( 3 )i n i 3 = n . 2 i 2 i=0 i=0
3 Let c = 2 . Then we have ( m ) m 1 c 1 i n c =n c1 i=0

If > 0 such that f (n) = O(nlogb a ) then T (n) = (nlogb a ). If f (n) = (nlogb a ) then T (n) = (nlogb a log2 n). If > 0 such that f (n) = (nlogb a+ ), and c < 1 such that af (n/b) cf (n) for large n, then T (n) = (f (n)). Substitution (example): Consider the following recurrence i Ti+1 = 22 Ti2 , T1 = 2. Note that Ti is always a power of two. Let ti = log2 Ti . Then we have ti+1 = 2i + 2ti , t1 = 1. Let ui = ti /2i . Dividing both sides of the previous equation by 2i+1 we get ti+1 2i ti = + i. i +1 i +1 2 2 2 Substituting we nd 1 ui+1 = 2 + ui , u1 = 1 2, which is simply ui = i/2. So we nd i 1 that Ti has the closed form Ti = 2i2 . Summing factors (example): Consider the following recurrence T (n) = 3T (n/2) + n, T (1) = 1. Rewrite so that all terms involving T are on the left side T (n) 3T (n/2) = n. Now expand the recurrence, and choose a factor which makes the left side telescope

Generating functions: 1. Multiply both sides of the equation by xi . 2. Sum both sides over all i for which the equation is valid. 3. Choose a generatingfunction G(x). Usually G(x) = i=0 xi gi . 3. Rewrite the equation in terms of the generating function G(x). 4. Solve for G(x). 5. The coecient of xi in G(x) is gi . Example: gi+1 = 2gi + 1, g0 = 0. Multiply and sum: xi . 2gi xi + gi+1 xi =
i 0 i0

= 2n(clog2 n 1) = 2n(c(k1) logc n 1) = 2nk 2n, and so T (n) = 3n 2n. Full history recurrences can often be changed to limited history ones (example): Consider i1 Ti = 1 + Tj , T0 = 1.
k j =0

## We choose G(x) = i0 xi gi . Rewrite in terms of G(x): G(x) g0 = 2G(x) + xi . x

i0

i 0

Simplify: 1 G(x) = 2G(x) + . x 1x Solve for G(x): x G(x) = . (1 x)(1 2x) Expand this ( using partial fractions: ) 1 2 G(x) = x 1 2x 1 x = x 2 2i xi xi = (2i+1 1)xi+1 .
i0 i 0 i0

## Note that Ti+1 = 1 +

i j =0

Tj .

Subtracting we nd i i1 Ti+1 Ti = 1 + Tj 1 Tj
j =0 j =0

## = Ti . And so Ti+1 = 2Ti = 2i+1 .

So gi = 2i 1.

Theoretical Computer Science Cheat Sheet 3.14159, i 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 2i 2 4 8 16 32 64 128 256 512 1,024 2,048 4,096 8,192 16,384 32,768 65,536 131,072 262,144 524,288 1,048,576 2,097,152 4,194,304 8,388,608 16,777,216 33,554,432 67,108,864 134,217,728 268,435,456 536,870,912 1,073,741,824 2,147,483,648 4,294,967,296 Pascals Triangle 1 11 121 1331 14641 1 5 10 10 5 1 1 6 15 20 15 6 1 1 7 21 35 35 21 7 1 1 8 28 56 70 56 28 8 1 1 9 36 84 126 126 84 36 9 1 1 10 45 120 210 252 210 120 45 10 1 e 2.71828, pi 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 0.57721, General Bernoulli Numbers (Bi = 0, odd i = 1): 1 1 B0 = 1, B1 = 1 2 , B2 = 6 , B4 = 30 , 1 5 1 , B8 = 30 , B10 = 66 . B6 = 42 Change of base, quadratic formula: loga x b b2 4ac logb x = , . loga b 2a Eulers number e: 1 1 1 e=1+ 1 2 + 6 + 24 + 120 + ) ( n x = ex . lim 1 + n n ( ) ( ) 1 n 1 n+1 1+ n <e< 1+ n . ( ) ( ) e 11 e 1 1 n 1+ n =e + O . 2 2n 24n n3 Harmonic numbers: 1, 3 2,
11 25 137 49 363 761 7129 6 , 12 , 60 , 20 , 140 , 280 , 2520 , . . .

1+ 5 2

1.61803,

1 5 2

.61803

## Probability Continuous distributions: If b Pr[a < X < b] = p(x) dx,

a

then p is the probability density function of X . If Pr[X < a] = P (a), then P is the distribution function of X . If P and p both exist then a P (a) = p(x) dx.

x

g (x) dP (x).

## ln n < Hn < ln n + 1, ( ) 1 Hn = ln n + + O . n Factorial, Stirlings approximation:

1, 2, 6, 24, 120, 720, 5040, 40320, 362880,

Variance, standard deviation: VAR[X ] = E[X 2 ] E[X ]2 , = VAR[X ]. For events A and B : Pr[A B ] = Pr[A] + Pr[B ] Pr[A B ] Pr[A B ] = Pr[A] Pr[B ], i A and B are independent. Pr[A B ] Pr[B ] For random variables X and Y : E[X Y ] = E[X ] E[Y ], if X and Y are independent. Pr[A|B ] = E[X + Y ] = E[X ] + E[Y ], E[cX ] = c E[X ]. Bayes theorem: Pr[B |Ai ] Pr[Ai ] Pr[Ai |B ] = n . j =1 Pr[Aj ] Pr[B |Aj ] Inclusion-exclusion: n n [ ] Pr Xi = Pr[Xi ] +
i=1 n k=2 i=1

...

( )n ( ( )) n 1 1+ . e n Ackermanns function and inverse: i=1 2j a(i, j ) = a(i 1, 2) j=1 a(i 1, a(i, j 1)) i, j 2 n! = 2n (i) = min{j | a(j, j ) i}. Binomial distribution: ( ) n k nk Pr[X = k ] = p q , q = 1 p, k ( ) n n k nk [ X ] = k p q = np. E k
k=1

Poisson distribution: e k Pr[X = k ] = , E[X ] = . k! Normal (Gaussian) distribution: 2 2 1 p(x) = e(x) /2 , E[X ] = . 2 The coupon collector: We are given a random coupon each day, and there are n dierent types of coupons. The distribution of coupons is uniform. The expected number of days to pass before we to collect all n types is nHn .

(1)k+1

ii <<ik

Pr

k [ j =1

] X ij .

k=1

## Theoretical Computer Science Cheat Sheet Trigonometry Multiplication:

(0,1)

Matrices
n k=1

More Trig. C

b A c C
(-1,0) (0,-1)

C = A B, (cos , sin )
(1,0)

ci,j =

ai,k bk,j .

## Determinants: det A = 0 i A is non-singular. det A B = det A det B, n det A = sign( )ai,(i) .

i=1

a B Pythagorean theorem: C 2 = A2 + B 2 . Denitions: sin a = A/C, csc a = C/A, sin a A tan a = = , cos a B Area, radius of inscribed
1 2 AB,

A c B Law of cosines: c2 = a2 +b2 2ab cos C. Area: A= 1 2 hc, =1 2 ab sin C, c2 sin A sin B . 2 sin C Herons formula: = A = s sa sb sc , s= 1 2 (a + b + c), sa = s a, sb = s b, sc = s c. More identities: 1 cos x x sin 2 = , 2 1 + cos x , cos x 2 = 2 1 cos x tan x , 2 = 1 + cos x 1 cos x , = sin x sin x , = 1 + cos x 1 + cos x cot x , 2 = 1 cos x 1 + cos x = , sin x sin x = , 1 cos x eix eix sin x = , 2i eix + eix cos x = , 2 eix eix tan x = i ix , e + eix e2ix 1 = i 2ix , e +1 sinh ix sin x = , i cos x = cosh ix, tanh ix tan x = . i

cos a = B/C, sec a = C/B, cos a B cot a = = . sin a A circle: AB . A+B+C cos x = 1 , sec x

2 2 and 3 3 determinant: a b = ad bc, c d a b c a b a c b c +i h d e f =g d e e f d f g h i aei + bf g + cdh = ceg f ha ibd. Permanents: n perm A = ai,(i) .
i=1

Identities: 1 sin x = , csc x 1 tan x = , cot x 1 + tan2 x = sec2 x, ( ) sin x = cos 2 x , cos x = cos( x), cot x = cot( x),

Hyperbolic Functions Denitions: ex e x sinh x = , 2 x x e e tanh x = x , e + e x 1 sech x = , cosh x Identities: cosh2 x sinh2 x = 1, coth2 x csch2 x = 1, cosh(x) = cosh x, tanh2 x + sech2 x = 1, sinh(x) = sinh x, tanh(x) = tanh x, e +e , 2 1 csch x = , sinh x 1 coth x = . tanh x cosh x =
x x

sin2 x + cos2 x = 1, 1 + cot2 x = csc2 x, sin x = sin( x), ) ( tan x = cot 2 x , csc x = cot x 2 cot x,

sin(x y ) = sin x cos y cos x sin y, cos(x y ) = cos x cos y sin x sin y, tan x tan y , 1 tan x tan y cot x cot y 1 cot(x y ) = , cot x cot y tan(x y ) = sin 2x = 2 sin x cos x, cos 2x = cos2 x sin2 x, cos 2x = 1 2 sin2 x,

sinh(x + y ) = sinh x cosh y + cosh x sinh y, cosh(x + y ) = cosh x cosh y + sinh x sinh y, sin 2x = sinh 2x = 2 sinh x cosh x, cosh 2x = cosh2 x + sinh2 x, cosh x + sinh x = ex , cosh x sinh x = ex , n Z,

## 2 tan x , 1 + tan2 x cos 2x = 2 cos2 x 1, cos 2x = 1 tan2 x , 1 + tan2 x

2 tan x cot2 x 1 tan 2x = cot 2x = , 2 , 2 cot x 1 tan x sin(x + y ) sin(x y ) = sin2 x sin2 y, cos(x + y ) cos(x y ) = cos2 x sin2 y. Eulers equation: eix = cos x + i sin x, e
i

6 4 3 2

= cosh x 1, cos

2 cosh2 x 2

= cosh x + 1.

sin 0
1 2 2 2 3 2

tan

0
3 3

= 1.

## c 1994 by Steve Seiden v2.02 sseiden@acm.org http://www.csc.lsu.edu/~seiden

3 2 2 2 1 2

1 3

. . . in mathematics you dont understand things, you just get used to them. J. von Neumann

Theoretical Computer Science Cheat Sheet Number Theory The Chinese remainder theorem: There exists a number C such that: C r1 mod m1 . . . . . . . . . C rn mod mn if mi and mj are relatively prime for i = j . Eulers function: (x) is the number of positive integers nless ithan x relatively prime to x. If i=1 pe i is the prime factorization of x then n i 1 (pi 1). (x) = pe i
i=1

Graph Theory An edge connecting a vertex to itself. Directed Each edge has a direction. Simple Graph with no loops or multi-edges. Walk A sequence v0 e1 v1 . . . e v . Trail A walk with distinct edges. Path A trail with distinct vertices. Connected A graph where there exists a path between any two vertices. Component A maximal connected subgraph. Tree A connected acyclic graph. Free tree A tree with no root. DAG Directed acyclic graph. Eulerian Graph with a trail visiting each edge exactly once. Hamiltonian Graph with a cycle visiting each vertex exactly once. Cut A set of edges whose removal increases the number of components. Cut-set A minimal cut. Cut edge A size 1 cut. k-Connected A graph connected with the removal of any k 1 vertices. k-Tough S V, S = we have k c(G S ) |S |. k-Regular A graph where all vertices have degree k . k-Factor A k -regular spanning subgraph. Matching A set of edges, no two of which are adjacent. Clique A set of vertices, all of which are adjacent. Ind. set A set of vertices, none of which are adjacent. Vertex cover A set of vertices which cover all edges. Planar graph A graph which can be embeded in the plane. Plane graph An embedding of a planar graph. deg(v ) = 2m.
v V

Denitions: Loop

Notation: E (G) Edge set V (G) Vertex set c(G) Number of components G[S ] Induced subgraph deg(v ) Degree of v (G) Maximum degree (G) Minimum degree (G) Chromatic number E (G) Edge chromatic number Gc Complement graph Kn Complete graph Kn1 ,n2 Complete bipartite graph r(k, ) Ramsey number Geometry Projective 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, Lp and L metric: (x1 x0 )2 + (y1 y0 )2 , [ ]1/p |x1 x0 |p + |y1 y0 |p , [ ] 1 /p lim |x1 x0 |p + |y1 y0 |p .
p

Eulers theorem: If a and b are relatively prime then 1 a(b) mod b. Fermats theorem: 1 ap1 mod p. The Euclidean algorithm: if a > b are integers then gcd(a, b) = gcd(a mod b, b). n i If i=1 pe i is the prime factorization of x then n i +1 pe 1 i S (x) = d= . p 1 i i=1
d|x

Perfect Numbers: x is an even perfect number i x = 2n1 (2n 1) and 2n 1 is prime. Wilsons theorem: n is a prime i (n 1)! 1 mod n. M obius inversion: 1 if i = 1. 0 if i is not square-free. (i) = r (1) if i is the product of r distinct primes. If G(a) = then
d|a

Area of triangle (x0 , y0 ), (x1 , y1 ) and (x2 , y2 ): x1 x0 y1 y0 1 . 2 abs x x 2 0 y2 y0 Angle formed by three points: (x2 , y2 ) 2 (0, 0) cos = 1 (x1 , y1 )

F (d),

d|a

## Prime numbers: ln ln n pn = n ln n + n ln ln n n + n ln n ) ( n , +O ln n n n 2!n ( n) = + + ln n (ln n)2 (ln n)3 ( ) n +O . (ln n)4

(x1 , y1 ) (x2 , y2 ) . 1 2 Line through two points (x0 , y0 ) and (x1 , y1 ): x y 1 x0 y0 1 = 0. x1 y1 1 Area of circle, volume of sphere: A = r2 ,
3 V =4 3 r .

## If G is planar then n m + f = 2, so f 2n 4, m 3n 6. Any planar graph has a vertex with degree 5.

If I have seen farther than others, it is because I have stood on the shoulders of giants. Issac Newton

Theoretical Computer Science Cheat Sheet Wallis identity: 2 2 4 4 6 6 =2 1 3 3 5 5 7 Brounckers continued fraction expansion: 12 4 =1+ 32 2+ 52
2+
2+ 72 2+

Calculus Derivatives: 1. 4. 7. 9. 11. 13. 15. d(cu) du =c , dx dx d(un ) du = nun1 , dx dx d(cu ) du = (ln c)cu , dx dx d(sin u) du = cos u , dx dx d(tan u) du = sec2 u , dx dx d(sec u) du = tan u sec u , dx dx 14. 16. 10. 12. 2. d(u + v ) du dv d(uv ) dv du = + , 3. =u +v , dx dx dx dx dx dx ( du ) ( dv ) cu v dx u dx d(u/v ) du d(e ) 5. = , 6. = cecu , dx v2 dx dx 8. d(ln u) 1 du = , dx u dx

1 5

1 7

1 9

## d(cos u) du = sin u , dx dx d(cot u) du = csc2 u , dx dx

1 13 1 6 = 2 + 2 3 23 + 2 4 5 25 + Sharps series:
6

## d(csc u) du = cot u csc u , dx dx

) 1 ( 1 1 1 = 1 1 + 2 3 + 3 3 3 5 3 7 3

Eulers series:
2 6 2 8 2 12

d(arcsin u) 1 du = , 2 dx 1 u dx d(arctan u) 1 du 17. = , dx 1 + u2 dx d(arcsec u) 1 du = , 2 dx u 1 u dx d(sinh u) du 21. = cosh u , dx dx 19. 23. 25. 27. d(tanh u) du = sech2 u , dx dx d(sech u) du = sech u tanh u , dx dx 26.

## d(arccos u) 1 du = , dx 1 u2 dx d(arccot u) 1 du 18. = , dx 1 + u2 dx d(arccsc u) 1 du = , 2 dx u 1 u dx d(cosh u) du 22. = sinh u , dx dx d(coth u) du = csch2 u , dx dx

= = =

1 12 1 12 1 12

+ +

1 22 1 32 1 22

+ + +

1 32 1 52 1 32

+ +

1 42 1 72 1 42

+ + +

1 52 1 92 1 52

+ +

20.

Partial Fractions Let N (x) and D(x) be polynomial functions of x. We can break down N (x)/D(x) using partial fraction expansion. First, if the degree of N is greater than or equal to the degree of D, divide N by D, obtaining N (x) N (x) = Q(x) + , D(x) D(x) where the degree of N is less than that of D. Second, factor D(x). Use the following rules: For a non-repeated factor: N (x) A N (x) = + , (x a)D(x) xa D(x) where N (x) A= D(x) [ ] .
x=a

24.

## d(csch u) du = csch u coth u , dx dx d(arccosh u) 1 du = , 2 dx u 1 dx d(arccoth u) 1 du 30. = 2 , dx u 1 dx d(arccsch u) 1 du = . dx |u| 1 + u2 dx (u + v ) dx = u dx + v dx,

d(arcsinh u) 1 du = , 2 dx 1 + u dx d(arctanh u) 1 du 29. = , dx 1 u2 dx d(arcsech u) 1 du = , dx u 1 u2 dx Integrals: 1. cu dx = c u dx, 31. 3. 6. 8. 10. 12. 14.
x arcsin x a dx = arcsin a +

28.

32. 2. 4.

1 xn+1 , x dx = n+1
n

n = 1,

k=0

where

## [ ( )] 1 dk N (x) Ak = . k ! dxk D(x) x=a

The reasonable man adapts himself to the world; the unreasonable persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable. George Bernard Shaw

## csc x dx = ln | csc x + cot x|,

a > 0,

Theoretical Computer Science Cheat Sheet 15. 17. 19. 21. 23. 25. 26. 29. 33. 36. arcsinh
x a dx

arccos

x a dx

= arccos
1 2a

x a

a2 x2 ,

## Calculus Cont. a > 0, 16.

x arctan x a dx = x arctan a a 2

ln(a2 + x2 ),

a > 0,

sin2 (ax)dx =

) ax sin(ax) cos(ax) ,

1 2a

## sec2 x dx = tan x, sinn x dx =

20.

sinn1 x cos x n 1 cosn1 x sin x n 1 + sinn2 x dx, 22. cosn x dx = + cosn2 x dx, n n n n tann1 x cotn1 x n n2 n tan cotn2 x dx, n = 1, tan x dx = x dx, n = 1, 24. cot x dx = n1 n1 tan x secn1 x n 2 secn x dx = + secn2 x dx, n = 1, n1 n1 cot x cscn1 x n 2 cscn x dx = + cscn2 x dx, n = 1, 27. sinh x dx = cosh x, 28. cosh x dx = sinh x, n1 n1 tanh x dx = ln | cosh x|, 30. coth x dx = ln | sinh x|, 31. sech x dx = arctan sinh x, 32. csch x dx = ln tanh x 2 , sinh x dx =
2 1 4

cosh x dx =
2 1 4

sinh(2x)
x a

1 2 x,

34. a > 0,

sinh(2x) + 37.

1 2 x,

35.

sech2 x dx = tanh x,
a 2

= x arcsinh

x 2 + a2 ,

x arctanh x a dx = x arctanh a +

ln |a2 x2 |,

x x arccosh x2 + a2 , if arccosh x a > 0 and a > 0, a 38. arccosh x dx = a x arccosh x + x2 + a2 , if arccosh x < 0 and a > 0, a a ( ) dx 39. = ln x + a2 + x2 , a > 0, a2 + x 2 dx x 1 2 x2 dx = x arctan , a > 0 , 41. 40. = a a2 x2 + a a 2 a2 + x2 4 2 2 x 42. (a2 x2 )3/2 dx = x (5 a 2 x ) a2 x2 + 3a a > 0, 8 8 arcsin a , 43.

a2 2

arcsin x a,

a > 0,

dx dx 1 x a+x dx = arcsin x , a > 0 , 44. , = ln = , 45. a 2 2 2 2 3 / 2 2 2 2 a x 2a ax (a x ) a x a a2 x 2 2 dx 2 x2 a ln x + 2 x2 , 46. a2 x2 dx = x a a 47. = ln x + x2 a2 , a > 0, 2 2 2 2 x a 1 dx x 2(3bx 2a)(a + bx)3/2 = ln , 48. , 49. x a + bx dx = 2 ax + bx a a + bx 15b2 a + bx a + bx a 1 1 x dx = 2 a + bx + a 50. dx, 51. dx = ln , a > 0, x x a + bx a + bx a + bx + a 2 2 a x2 a + a2 x 2 2 2 3/2 , dx = a2 x2 a ln 52. , 53. x a2 x2 dx = 1 3 (a x ) x x dx a + a2 x 2 2 2 2 x a4 x 1 2 2 2 2 54. x a x dx = 8 (2x a ) a x + 8 arcsin a , a > 0, 55. = a ln , x a2 x 2 2 x dx x2 dx x 56. = a2 x2 , 57. = x a2 x 2 + a a > 0, 2 2 arcsin a, 2 2 2 2 a x a x a2 + x 2 x 2 a2 a + a2 + x 2 a dx = a2 + x2 a ln dx = x2 a2 a arccos |x a > 0, 58. , 59. |, x x x x dx 2 2 3/2 1 60. x x2 a2 dx = 1 ( x a ) , 61. =a ln , 3 x x2 + a2 a + a2 + x 2

Theoretical Computer Science Cheat Sheet 62. 64. 66. dx dx x 2 a2 1 a , = a arccos |x| , a > 0, 63. = a2 x x x2 a2 x2 x2 a2 x dx x 2 a2 (x2 + a2 )3/2 = x 2 a2 , 65. dx = , x4 3a2 x3 x 2 a2 1 2ax + b b2 4ac ln , if b2 > 4ac, dx b2 4ac 2ax + b + b2 4ac = ax2 + bx + c 2 2ax + b arctan , if b2 < 4ac, 4ac b2 4ac b2 1 ln 2ax + b + 2 a ax2 + bx + c , if a > 0, a dx = 2 1 2ax b ax + bx + c arcsin , if a < 0, a b2 4ac 2ax + b 2 4ax b2 dx ax2 + bx + c dx = ax + bx + c + , 2 4a 8a ax + bx + c Calculus Cont. Finite Calculus Dierence, shift operators: f (x) = f (x + 1) f (x), E f (x) = f (x + 1). Fundamental Theorem: f (x) = F (x) f (x)x = F (x) + C.
b a

f (x)x =

b1 i= a

f (i).

67. 68.

## Dierences: (cu) = cu, (xn ) = nxn1 , (Hx ) = x1 , (cx ) = (c 1)cx ,

(u + v ) = u + v,

## (uv ) = uv + E v u, (2x ) = 2x , (x) ( x ) m = m1 .

x dx ax2 + bx + c b dx 69. = , 2 2 a 2 a ax + bx + c ax + bx + c 1 2 c ax2 + bx + c + bx + 2c , if c > 0, c ln x dx 70. = x ax2 + bx + c bx + 2c 1 arcsin , if c < 0, c |x| b2 4ac 2 2 2 3/2 2 2 71. x3 x2 + a2 dx = ( 1 , 3 x 15 a )(x + a ) 72. 73. 74. 75. 76. xn (ln ax)m dx = xn eax dx = x cos(ax) dx =
n 1 n ax 1 n x cos(ax) + xn sin(ax) dx = a n a

sin(ax)
n a n a

Sums: cu x = c u x, (u + v ) x = u x + v x, uv x = uv E v u x, n+1 n 1 x x = x x x = Hx , m+1 , ( ) ( x ) x x x c x = cc 1 , m x = m+1 . Falling Factorial Powers: xn = x(x 1) (x n + 1), n > 0, x0 = 1, 1 , (x + 1) (x + |n|) xn+m = xm (x m)n . Rising Factorial Powers: xn = x0 = 1, xn = 1 , (x 1) (x |n|) n < 0, n < 0,

n1

sin(ax) dx,

xn eax a

## xn1 eax dx, ) , xn (ln ax)m1 dx.

xn = x(x + 1) (x + n 1),

n > 0,

xn ln(ax) dx = xn+1
n+1

## x m (ln ax)m n+1 n+1

x1 = x2 = x3 = x4 = x5 = x1 = x = x3 = x4 = x5 =
2 2

x1 x2 + x1 x3 + 3x2 + x1 x4 + 6x3 + 7x2 + x1 x5 + 15x4 + 25x3 + 10x2 + x1 x1 x +x 3 x + 3x2 + 2x1 x4 + 6x3 + 11x2 + 6x1 x5 + 10x4 + 35x3 + 50x2 + 24x1
1

= = = = = x1 = x = x3 = x4 = x5 =
2 2

x1 x2 x1 x3 3x2 + x1 x4 6x3 + 7x2 x1 x5 15x4 + 25x3 10x2 + x1 x1 x x1 x3 3x2 + 2x1 x4 6x3 + 11x2 6x1 x5 10x4 + 35x3 50x2 + 24x1

xn+m = xm (x + m)n . Conversion: xn = (1)n (x)n = (x n + 1)n = 1/(x + 1)n , xn = (1)n (x)n = (x + n 1)n = 1/(x 1)n , n { } n { } n k n xn = x = (1)nk xk , k k k=1 k=1 n [ ] n xn = (1)nk xk , k k=1 n [ ] n k n x = x . k
k=1

Theoretical Computer Science Cheat Sheet Series Taylors series: (x a)i (x a)2 f (x) = f (a) + (x a)f (a) + f (a) + = f (i) (a). 2 i ! i=0 Expansions: 1 xi , = 1 + x + x2 + x3 + x4 + = 1x i=0 1 = 1 + cx + c2 x2 + c3 x3 + = ci xi , 1 cx i=0 1 n 2n 3n = 1 + x + x + x + = xni , 1 xn i=0 x 2 3 4 = x + 2x + 3x + 4x + = ixi , (1 x)2 i=0 n { } n k !z k n 2 n 3 n 4 = x + 2 x + 3 x + 4 x + = in xi , k (1 z )k+1 i=0 k=0 xi 1 3 2 x + x + = , ex =1+x+ 1 2 6 i! i=0 xi 1 3 1 4 2 ln(1 + x) =x 1 x + x x = (1)i+1 , 2 3 4 i i=1 i x 1 ln =x+ 1 x2 + 1 x3 + 1 x4 + = , 2 3 4 1x i i=1 x2i+1 1 3 1 5 1 7 sin x = x 3! x + 5! x 7! x + = (1)i , (2i + 1)! i=0 x2i 1 2 1 4 1 6 cos x = 1 2! x + 4! x 6! x + = , (1)i (2i)! i=0 2i+1 i x 1 5 1 7 3 tan1 x =x 1 x + x x + = ( 1) , 3 5 7 (2i + 1) i=0 ( ) n i 1) 2 x + = (1 + x)n = 1 + nx + n(n2 x, i i=0 ) ( (n+2) 2 1 i+n i = 1 + (n + 1)x + 2 x + = x, (1 x)n+1 i i=0 Bi xi x 1 1 2 1 4 = 1 x + x x + = , 2 12 720 x e 1 i! i=0 ( ) 1 2i i 1 2 3 (1 1 4x) = 1 + x + 2x + 5x + = x, 2x i+1 i i=0 ( ) 1 2i i = 1 + 2x + 6x2 + 20x3 + = x, i 1 4x i=0 ( )n ) ( (4+n) 2 1 1 4x 2i + n i 1 = 1 + (2 + n)x + 2 x + = x, 2x i 1 4x i=0 1 1 3 2 11 3 25 4 ln = x + 2 x + 6 x + 12 x + = Hi xi , 1x 1x i=1 ( )2 Hi1 xi 1 1 3 3 11 4 2 x + x + x + = ln =1 , 2 4 24 2 1x i i=2 x 2 3 4 = x + x + 2 x + 3 x + = Fi x i , 1 x x2 i=0 Fn x 2 3 = F x + F x + F x + = Fni xi . n 2n 3n 1 (Fn1 + Fn+1 )x (1)n x2 i=0

## Ordinary power series: A(x) = ai xi .

i=0

Exponential power series: xi A(x) = ai . i! i=0 Dirichlet power series: ai A(x) = . ix i=1 Binomial theorem: n ( ) n nk k (x + y )n = x y . k
k=0

k=0

## For ordinary power series: A(x) + B (x) = (ai + bi )xi ,

i=0

xk A(x) = A(x) k1
i=0 xk

i= k

aik xi ,
i=0

ai x

ai+k xi ,

A(cx) =

i=0

ci ai xi ,

iai xi , xi ,

## i Summation: If bi = j =0 ai then 1 B (x) = A(x). 1x Convolution: i A(x)B (x) = aj bij xi .

i=0 j =0

God made the natural numbers; all the rest is the work of man. Leopold Kronecker

Theoretical Computer Science Cheat Sheet Series Expansions: 1 1 ln n +1 (1 x) 1x xn ( ln 1 1x tan x 1 (x) (x) 2 (x) (x) (x 1) (2n) x sin x ( )n 1 1 4x 2x e sin x 1x x ( )2 arcsin x x 1
x

Eschers Knot

)n

( ) ( )n { } n+i i 1 i = (Hn+i Hn ) x, = xi , i x n i=0 i=0 [ ] { } n i i n!xi x n = x, (e 1) = , i n i! i=0 i=0 [ ] i n!xi (4)i B2i x2i = , x cot x = , n i! (2i)! i=0 i=0 2i 2i 2i1 1 i1 2 (2 1)B2i x = (1) , (x) = , x (2 i )! i i=1 i=1 (i) (x 1) (i) = , = , x i (x) ix i=1 i=1 1 = , Stieltjes Integration 1 px p If G is continuous in the interval [a, b] and F is nondecreasing then b d(i) = where d(n) = d|n 1, G(x) dF (x) xi
i=1

xi

where S (n) =

d| n

d,

## |B2n | 2n , n N, = (2n)! (4i 2)B2i x2i = , (1)i1 (2i)! i=0 2 = =

n(2i + n 1)! i=0 i=1

a a

G(x) dF (x) +
b b

G(x) dF (x).
b

a b

G(x) dF (x) +
a b

H (x) dF (x),
a b

i!(n + i)! 2
i/2

xi ,

a b b

G(x) dF (x) +
a a b

## G(x) dH (x), G(x) dF (x),

a b

a b

sin i!

i 4

( ) G(x) d c F (x) = c

x,

= =

i=0 i=0

F (x) dG(x).

## (4i)! xi , i 16 2(2i)!(2i + 1)! 4i i!2 x2i . (i + 1)(2i + 1)!

If the integrals involved exist, and F possesses a derivative F at every point in [a, b] then b b G(x) dF (x) = G(x)F (x) dx.
a a

Cramers Rule
00 47 18 76 29 93 85 34 61 52

Fibonacci Numbers
86 11 57 28 70 39 94 45 02 63 95 80 22 67 38 71 49 56 13 04 59 96 81 33 07 48 72 60 24 15 73 69 90 82 44 17 58 01 35 26 68 74 09 91 83 55 27 12 46 30 37 08 75 19 92 84 66 23 50 41 14 25 36 40 51 62 03 77 88 99 21 32 43 54 65 06 10 89 97 78 42 53 64 05 16 20 31 98 79 87

If we have equations: a1,1 x1 + a1,2 x2 + + a1,n xn = b1 a2,1 x1 + a2,2 x2 + + a2,n xn = b2 . . . . . . . . . an,1 x1 + an,2 x2 + + an,n xn = bn Let A = (ai,j ) and B be the column matrix (bi ). Then there is a unique solution i det A = 0. Let Ai be A with column i replaced by B . Then det Ai . xi = det A Improvement makes strait roads, but the crooked roads without Improvement, are roads of Genius. William Blake (The Marriage of Heaven and Hell)

1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . . Denitions: Fi = Fi1 +Fi2 , F0 = F1 = 1, Fi = (1)i1 Fi , ) ( 1 i , Fi = i 5 Cassinis identity: for i > 0: Fi+1 Fi1 Fi2 = (1)i . Additive rule: Fn+k = Fk Fn+1 + Fk1 Fn , F2n = Fn Fn+1 + Fn1 Fn . Calculation by matrices: ( ) ( )n Fn2 Fn1 0 1 = . Fn1 Fn 1 1

The Fibonacci number system: Every integer n has a unique representation n = Fk1 + Fk2 + + Fkm , where ki ki+1 + 2 for all i, 1 i < m and km 2.