Upcoming SlideShare
Loading in...5
×

Like this document? Why not share!

List of Software V1 00

on Jan 09, 2009

• 1,526 views

Views

Total Views
1,526
Views on SlideShare
1,525
Embed Views
1

Likes
0
Downloads
19
Comments
0

1 Embed1

 http://www.lmodules.com 1

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

• Comment goes here.
Are you sure you want to
Your message goes here
Edit your comment

List of Software V1 00Document Transcript

• Theoretical Computer Science Cheat Sheet Deﬁnitions Series iﬀ ∃ positive c, n0 such that f (n) = O(g(n)) n n n n2 (n + 1)2 n(n + 1) n(n + 1)(2n + 1) 0 ≤ f (n) ≤ cg(n) ∀n ≥ n0 . i2 = i3 = i= , , . 2 6 4 i=1 i=1 i=1 iﬀ ∃ positive c, n0 such that f (n) = Ω(g(n)) In general: f (n) ≥ cg(n) ≥ 0 ∀n ≥ n0 . n n 1 (n + 1)m+1 − 1 − (i + 1)m+1 − im+1 − (m + 1)im im = f (n) = Θ(g(n)) iﬀ f (n) = O(g(n)) and m+1 i=1 i=1 f (n) = Ω(g(n)). n−1 m 1 m+1 im = Bk nm+1−k . f (n) = o(g(n)) iﬀ limn→∞ f (n)/g(n) = 0. m+1 k i=1 k=0 iﬀ ∀ > 0, ∃n0 such that lim an = a Geometric series: n→∞ |an − a| < , ∀n ≥ n0 . ∞ ∞ n cn+1 − 1 1 c |c| < 1, ci = ci = ci = , c = 1, , , least b ∈ R such that b ≥ s, sup S c−1 1−c 1−c ∀s ∈ S. i=0 i=0 i=1 ∞ n ncn+2 − (n + 1)cn+1 + c c greatest b ∈ R such that b ≤ |c| < 1. ici = ici = inf S , c = 1, , (c − 1)2 (1 − c)2 s, ∀s ∈ S. i=0 i=0 Harmonic series: lim inf{ai | i ≥ n, i ∈ N}. lim inf an n n n(n − 1) 1 n(n + 1) n→∞ n→∞ Hn − Hn = , iHi = . lim sup{ai | i ≥ n, i ∈ N}. i 2 4 lim sup an i=1 i=1 n→∞ n→∞ n n i n+1 1 n Hi = (n + 1)Hn − n, Hn+1 − Combinations: Size k sub- Hi = . 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 1. 2. 3. k = 2n , = , = , Arrangements of an n ele- (n − k)!k! n−k k k k k=0 ment set into k cycles. n n−1 n−1 n−1 n n 4. 5. = , = + , n k k−1 k−1 Stirling numbers (2nd kind): k k k k Partitions of an n element n n−k n m n r+k r+n+1 6. 7. = , = , set into k non-empty sets. m−k m k k k n k=0 n 1st order Eulerian numbers: n n k n+1 r s r+s k 8. 9. = , = , Permutations π1 π2 . . . πn on n−k m m+1 k n {1, 2, . . . , n} with k ascents. k=0 k=0 k−n−1 n n n 10. 11. k n = (−1) , = = 1, 2nd order Eulerian numbers. k k 1 n k Cn Catalan Numbers: Binary n−1 n−1 n n 12. = 2n−1 − 1, 13. =k + , trees with n + 1 vertices. k−1 2 k k n n n n n 14. = (n − 1)!, 15. = (n − 1)!Hn−1 , 16. 17. ≥ = 1, , 1 2 n k k n n−1 n−1 n n n n n 1 2n 18. = (n − 1) 19. 20. 21. Cn = + , = = , = n!, , k−1 n−1 n−1 k k 2 k n+1 n k=0 n−1 n−1 n n n n n 22. 23. 24. + (n − k) = = 1, = , = (k + 1) , n−1 n−1−k k−1 0 k k k 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 n m n n x+k n n+1 n n k 28. 29. (m + 1 − k)n (−1)k , 30. m! xn = , = = , n−m k n m k m k k=0 k=0 k=0 n n−k n n n n 31. 32. 33. (−1)n−k−m k!, = = 1, = 0 for n = 0, m k m 0 n k=0 n n−1 n−1 (2n)n n n 34. + (2n − 1 − k) 35. = (k + 1) , = , k−1 2n k k k k=0 n n x+n−1−k x n n+1 n k k 36. 37. (m + 1)n−k , = , = = x−n k 2n m+1 k m m k=0 k k=0
• Theoretical Computer Science Cheat Sheet Identities Cont. Trees n n n Every tree with n n+1 n k k n−k 1k x n x+k 38. 39. = = n = n! , = , vertices has n − 1 x−n m+1 k m m k! m k 2n k k=0 k=0 k=0 edges. n n k+1 n n+1 k 40. 41. (−1)n−k , (−1)m−k , = = Kraft inequal- m k m+1 m k+1 m k k ity: If the depths m m m+n+1 n+k m+n+1 n+k of the leaves of 42. 43. = k , = k(n + k) , m k m k a binary tree are k=0 k=0 d1 , . . . , dn : n n+1 k n n+1 k 44. 45. (n − m)! for n ≥ m, (−1)m−k , (−1)m−k , = = n m k+1 m m k+1 m 2−di ≤ 1, k k m−n m−n n m+n m+k n m+n m+k i=1 46. 47. = , = , n−m n−m m+k n+k k m+k n+k k and equality holds k k n−k n−k only if every in- n +m k n n +m k n 48. 49. = , = . ternal node has 2 +m m k +m m k k k sons. Recurrences Master method: Generating functions: 1 T (n) − 3T (n/2) = n a ≥ 1, b > 1 T (n) = aT (n/b) + f (n), 1. Multiply both sides of the equa- tion by xi . 3 T (n/2) − 3T (n/4) = n/2 If ∃ > 0 such that f (n) = O(nlogb a− ) 2. Sum both sides over all i for . . . then . . . . . . which the equation is valid. T (n) = Θ(nlogb a ). 3log2 n−1 T (2) − 3T (1) = 2 3. Choose a generating function ∞ If f (n) = Θ(nlogb a ) then G(x). Usually G(x) = i=0 xi gi . T (n) = Θ(nlogb a log2 n). Let m = log2 n. Summing the left side 3. Rewrite the equation in terms of we get T (n) − 3m T (1) = T (n) − 3m = the generating function G(x). If ∃ > 0 such that f (n) = Ω(nlogb a+ ), T (n) − nk where k = log2 3 ≈ 1.58496. 4. Solve for G(x). and ∃c < 1 such that af (n/b) ≤ cf (n) Summing the right side we get 5. The coeﬃcient of xi in G(x) is gi . for large n, then m−1 m−1 ni Example: 3i 3 =n . T (n) = Θ(f (n)). 2 2i gi+1 = 2gi + 1, g0 = 0. i=0 i=0 Substitution (example): Consider the Let c = 3 . Then we have Multiply and sum: following recurrence 2 gi+1 xi = 2gi xi + xi . i m−1 Ti+1 = 22 · Ti2 , T1 = 2. c −1m i n c =n i≥0 i≥0 i≥0 c−1 Note that Ti is always a power of two. i=0 We choose G(x) = i≥0 xi gi . Rewrite = 2n(clog2 n − 1) Let ti = log2 Ti . Then we have in terms of G(x): ti+1 = 2i + 2ti , t1 = 1. = 2n(c(k−1) logc n − 1) G(x) − g0 xi . = 2G(x) + Let ui = ti /2i . Dividing both sides of x = 2nk − 2n, i≥0 the previous equation by 2i+1 we get and so T (n) = 3n − 2n. Full history re- 2i k Simplify: ti+1 ti = i+1 + i . G(x) 1 currences can often be changed to limited i+1 2 2 2 = 2G(x) + . 1−x x history ones (example): Consider Substituting we ﬁnd i−1 ui+1 = 1 + ui , u1 = 1 , Solve for G(x): 2 2 Ti = 1 + Tj , T0 = 1. x G(x) = . (1 − x)(1 − 2x) which is simply ui = i/2. So we ﬁnd j=0 i−1 that Ti has the closed form Ti = 2i2 . Note that Expand this using partial fractions: i Summing factors (example): Consider 2 1 − Ti+1 = 1 + Tj . G(x) = x the following recurrence 1 − 2x 1 − x   j=0 T (n) = 3T (n/2) + n, T (1) = 1. Subtracting we ﬁnd = x 2 xi  2i xi − Rewrite so that all terms involving T i i−1 are on the left side Ti+1 − Ti = 1 + Tj − 1 − i≥0 i≥0 Tj T (n) − 3T (n/2) = n. − 1)x i+1 i+1 j=0 j=0 = (2 . = Ti . Now expand the recurrence, and choose i≥0 a factor which makes the left side “tele- So gi = 2i − 1. And so Ti+1 = 2Ti = 2i+1 . scope”
• Theoretical Computer Science Cheat Sheet √ √ 1+ 5 1− 5 ˆ π ≈ 3.14159, e ≈ 2.71828, γ ≈ 0.57721, ≈ 1.61803, ≈ −.61803 φ= φ= 2 2 2i i pi General Probability Continuous distributions: If 1 2 2 Bernoulli Numbers (Bi = 0, odd i = 1): b 1 1 1 −2, − 30 , 2 4 3 B0 = 1, B1 = B2 = 6, B4 = Pr[a < X < b] = p(x) dx, 1 1 5 B6 = 42 , B8 = − 30 , B10 = 66 . 3 8 5 a then p is the probability density function of Change of base, quadratic formula: 4 16 7 √ X. If −b ± b2 − 4ac loga x 5 32 11 Pr[X < a] = P (a), logb x = , . loga b 2a 6 64 13 then P is the distribution function of X. If Euler’s number e: 7 128 17 P and p both exist then 1 1 1 1 + 24 + 120 + · · · e=1+ + a 8 256 19 2 6 P (a) = p(x) dx. xn = ex . 9 512 23 −∞ lim 1 + n n→∞ Expectation: If X is discrete 10 1,024 29 1n 1 n+1 1+ n <e< 1+ n . E[g(X)] = g(x) Pr[X = x]. 11 2,048 31 e 11e 1 1n x =e− −O 1+ + . 12 4,096 37 2 n3 n 2n 24n If X continuous then ∞ ∞ 13 8,192 41 Harmonic numbers: E[g(X)] = g(x)p(x) dx = g(x) dP (x). 14 16,384 43 1, 3 , 11 , 25 , 137 , 49 , 363 , 761 , 7129 , . . . −∞ −∞ 2 6 12 60 20 140 280 2520 15 32,768 47 Variance, standard deviation: VAR[X] = E[X 2 ] − E[X]2 , 16 65,536 53 ln n < Hn < ln n + 1, 17 131,072 59 1 σ = VAR[X]. Hn = ln n + γ + O . n 18 262,144 61 For events A and B: Pr[A ∨ B] = Pr[A] + Pr[B] − Pr[A ∧ B] Factorial, Stirling’s approximation: 19 524,288 67 Pr[A ∧ B] = Pr[A] · Pr[B], ... 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 20 1,048,576 71 iﬀ A and B are independent. 21 2,097,152 73 √ n n 1 Pr[A ∧ B] n! = 2πn 1+Θ . 22 4,194,304 79 e n Pr[A|B] = Pr[B] 23 8,388,608 83 Ackermann’s function and inverse:  For random variables X and Y : 24 16,777,216 89  2j i=1 E[X · Y ] = E[X] · E[Y ], a(i, j) = a(i − 1, 2) j=1 25 33,554,432 97  a(i − 1, a(i, j − 1)) i, j ≥ 2 if X and Y are independent. 26 67,108,864 101 E[X + Y ] = E[X] + E[Y ], α(i) = min{j | a(j, j) ≥ i}. 27 134,217,728 103 E[cX] = c E[X]. Binomial distribution: 28 268,435,456 107 Bayes’ theorem: n k n−k 29 536,870,912 109 q = 1 − p, Pr[X = k] = pq , Pr[B|Ai ] Pr[Ai ] k Pr[Ai |B] = n . 30 1,073,741,824 113 j=1 Pr[Aj ] Pr[B|Aj ] n n k n−k 31 2,147,483,648 127 E[X] = k pq = np. Inclusion-exclusion: k 32 4,294,967,296 131 n n k=1 Pr Xi = Pr[Xi ] + Poisson distribution: Pascal’s Triangle e−λ λk i=1 i=1 1 Pr[X = k] = , E[X] = λ. n k k! (−1)k+1 Pr Xij . 11 Normal (Gaussian) distribution: ii <···<ik j=1 k=2 121 1 2 2 e−(x−µ) /2σ , E[X] = µ. p(x) = √ Moment inequalities: 1331 2πσ 1 Pr |X| ≥ λ E[X] ≤ The “coupon collector”: We are given a , 14641 λ random coupon each day, and there are n 1 5 10 10 5 1 1 Pr X − E[X] ≥ λ · σ ≤ diﬀerent types of coupons. The distribu- . λ2 1 6 15 20 15 6 1 tion of coupons is uniform. The expected Geometric distribution: 1 7 21 35 35 21 7 1 number of days to pass before we to col- q = 1 − p, Pr[X = k] = pq k−1 , lect all n types is 1 8 28 56 70 56 28 8 1 ∞ 1 nHn . 1 9 36 84 126 126 84 36 9 1 kpq k−1 = E[X] = . p 1 10 45 120 210 252 210 120 45 10 1 k=1
• Theoretical Computer Science Cheat Sheet Trigonometry Matrices More Trig. C Multiplication: n (0,1) C = A · B, ci,j = ai,k bk,j . a b h b (cos θ, sin θ) k=1 C θ Determinants: det A = 0 iﬀ A is non-singular. A (-1,0) (1,0) A c B det A · B = det A · det B, Law of cosines: c a c2 = a2 +b2 −2ab cos C. n (0,-1) det A = sign(π)ai,π(i) . B Area: π i=1 Pythagorean theorem: 2 × 2 and 3 × 3 determinant: C 2 = A2 + B 2 . A = 1 hc, 2 ab = ad − bc, = 1 ab sin C, Deﬁnitions: cd 2 sin a = A/C, cos a = B/C, c2 sin A sin B ab c = . b c ac ab csc a = C/A, sec a = C/B, −h 2 sin C f =g de +i e f df de sin a A cos a B Heron’s formula: gh i tan a = =, cot a = =. cos a B sin a A √ aei + bf g + cdh A = s · sa · sb · sc , = − ceg − f ha − ibd. Area, radius of inscribed circle: s = 1 (a + b + c), AB 1 Permanents: 2 AB, . 2 A+B+C n sa = s − a, ai,π(i) . perm A = Identities: sb = s − b, π i=1 1 1 sc = s − c. sin x = , cos x = , Hyperbolic Functions csc x sec x 1 More identities: Deﬁnitions: sin2 x + cos2 x = 1, tan x = , ex − e−x −x x 1 − cos x cot x e +e sin x = sinh x = , cosh x = , , 1 + tan2 x = sec2 x, 1 + cot2 x = csc2 x, 2 2 2 2 −x e −e x 1 tanh x = x , csch x = , 1 + cos x e + e−x −x , sin x = sin(π − x), π cos x = sinh x sin x = cos , 2 2 2 1 1 sech x = , coth x = . 1 − cos x cos x = − cos(π − x), −x , π cosh x tanh x tan x = cot 2 tan x = , 2 1 + cos x Identities: cot x = − cot(π − x), csc x = cot x − cot x, 1 − cos x 2 cosh2 x − sinh2 x = 1, tanh2 x + sech2 x = 1, = , sin x sin(x ± y) = sin x cos y ± cos x sin y, sin x coth2 x − csch2 x = 1, sinh(−x) = − sinh x, = , 1 + cos x cos(x ± y) = cos x cos y sin x sin y, tanh(−x) = − tanh x, cosh(−x) = cosh x, 1 + cos x tan x ± tan y cot x = , tan(x ± y) = 2 , 1 − cos x sinh(x + y) = sinh x cosh y + cosh x sinh y, 1 tan x tan y 1 + cos x cot x cot y 1 = , cot(x ± y) = cosh(x + y) = cosh x cosh y + sinh x sinh y, , sin x cot x ± cot y sin x 2 tan x = , sinh 2x = 2 sinh x cosh x, 1 − cos x sin 2x = 2 sin x cos x, sin 2x = , 1 + tan2 x eix − e−ix cosh 2x = cosh2 x + sinh2 x, cos 2x = cos2 x − sin2 x, cos 2x = 2 cos2 x − 1, sin x = , 2i cosh x − sinh x = e−x , 1 − tan2 x cosh x + sinh x = ex , eix + e−ix cos 2x = 1 − 2 sin2 x, cos 2x = , 1 + tan2 x cos x = , n ∈ Z, (cosh x + sinh x)n = cosh nx + sinh nx, 2 cot2 x − 1 eix − e−ix 2 tan x tan x = −i ix 2 sinh2 x 2 cosh2 x tan 2x = 2, cot 2x = , , = cosh x − 1, = cosh x + 1. 1 − tan x e + e−ix 2 cot x 2 2 e2ix − 1 sin(x + y) sin(x − y) = sin2 x − sin2 y, = −i 2ix , θ sin θ cos θ tan θ . . . in mathematics e +1 cos(x + y) cos(x − y) = cos2 x − sin2 y. you don’t under- sinh ix 0 0 1 0 sin x = , √ √ stand things, you 1 3 3 i π Euler’s equation: 6 2 2 3 just get used to √ √ = −1. cos x = cosh ix, eix = cos x + i sin x, iπ e 2 2 π them. 1 4 2 2 √ tanh ix √ – J. von Neumann v2.02 c 1994 by Steve Seiden 3 1 tan x = . π 3 i 3 2 2 sseiden@acm.org ∞ π 1 0 2 http://www.csc.lsu.edu/~seiden
• Theoretical Computer Science Cheat Sheet Number Theory Graph Theory Notation: Deﬁnitions: The Chinese remainder theorem: There ex- ists a number C such that: E(G) Edge set Loop An edge connecting a ver- V (G) Vertex set tex to itself. C ≡ r1 mod m1 c(G) Number of components Directed Each edge has a direction. .. . G[S] Induced subgraph Simple Graph with no loops or .. . .. . deg(v) Degree of v multi-edges. C ≡ rn mod mn ∆(G) Maximum degree Walk A sequence v0 e1 v1 . . . e v . δ(G) Minimum degree Trail A walk with distinct edges. if mi and mj are relatively prime for i = j. χ(G) Chromatic number Path A trail with distinct Euler’s function: φ(x) is the number of χE (G) Edge chromatic number vertices. positive integers less than x relatively Gc Complement graph n Connected A graph where there exists prime to x. If i=1 pei is the prime fac- i Kn Complete graph a path between any two torization of x then Kn1 ,n2 Complete bipartite graph n vertices. pi i −1 (pi − 1). e r(k, ) Ramsey number φ(x) = Component A maximal connected i=1 subgraph. Geometry Euler’s theorem: If a and b are relatively Tree A connected acyclic graph. Projective coordinates: triples prime then Free tree A tree with no root. (x, y, z), not all x, y and z zero. 1 ≡ aφ(b) mod b. DAG Directed acyclic graph. (x, y, z) = (cx, cy, cz) ∀c = 0. Eulerian Graph with a trail visiting Fermat’s theorem: Cartesian Projective each edge exactly once. 1 ≡ ap−1 mod p. Hamiltonian Graph with a cycle visiting (x, y) (x, y, 1) The Euclidean algorithm: if a > b are in- y = mx + b (m, −1, b) each vertex exactly once. tegers then (1, 0, −c) Cut A set of edges whose re- x=c gcd(a, b) = gcd(a mod b, b). moval increases the num- Distance formula, Lp and L∞ ber of components. metric: n If i=1 pei is the prime factorization of x i Cut-set A minimal cut. (x1 − x0 )2 + (y1 − y0 )2 , then pi i +1 − 1 n Cut edge A size 1 cut. e 1/p |x1 − x0 |p + |y1 − y0 |p , S(x) = d= . k-Connected A graph connected with pi − 1 the removal of any k − 1 p 1/p i=1 d|x lim |x1 − x0 |p + |y1 − y0 | . vertices. p→∞ Perfect Numbers: x is an even perfect num- ∀S ⊆ V, S = ∅ we have Area of triangle (x0 , y0 ), (x1 , y1 ) k-Tough ber iﬀ x = 2n−1 (2n −1) and 2n −1 is prime. k · c(G − S) ≤ |S|. and (x2 , y2 ): Wilson’s theorem: n is a prime iﬀ x1 − x0 y1 − y0 (n − 1)! ≡ −1 mod n. k-Regular A graph where all vertices 1 2 abs x − x . 0 y2 − y0 have degree k. 2 M¨bius  o inversion: k-Factor A k-regular spanning Angle formed by three points: 1 if i = 1.  subgraph. 0 if i is not square-free. µ(i) = Matching A set of edges, no two of  (−1)r if i is the product of (x2 , y2 )  which are adjacent. r distinct primes. 2 Clique A set of vertices, all of If θ which are adjacent. G(a) = F (d), (x1 , y1 ) (0, 0) 1 Ind. set A set of vertices, none of (x1 , y1 ) · (x2 , y2 ) d|a which are adjacent. cos θ = . then Vertex cover A set of vertices which 12 a F (a) = µ(d)G . Line through two points (x0 , y0 ) cover all edges. d and (x1 , y1 ): d|a Planar graph A graph which can be em- beded in the plane. xy1 Prime numbers: ln ln n Plane graph An embedding of a planar x0 y0 1 = 0. pn = n ln n + n ln ln n − n + n graph. ln n x1 y1 1 n Area of circle, volume of sphere: +O , deg(v) = 2m. ln n A = πr2 , V = 4 πr3 . 3 v∈V n n 2!n If G is planar then n − m + f = 2, so π(n) = + + 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
• Theoretical Computer Science Cheat Sheet π Calculus Derivatives: Wallis’ identity: 2 · 2 · 4 · 4 · 6 · 6··· π =2· d(cu) du d(u + v) du dv d(uv) dv du 1. 2. 3. 1 · 3 · 3 · 5 · 5 · 7··· =c , = + , =u +v , dx dx dx dx dx dx dx dx Brouncker’s continued fraction expansion: v du − u dv d(un ) d(ecu ) du d(u/v) du 12 4. 5. 6. = nun−1 , = cecu , dx dx = , π 4 =1+ v2 dx dx dx dx dx 32 2+ 52 2+ d(cu ) 72 du d(ln u) 1 du 2+ 7. 8. = (ln c)cu , 2+··· = , dx dx dx u dx Gregrory’s series: 1 1 1 1 4 =1− 3 + − − ··· d(sin u) du d(cos u) du π + 9. 10. = − sin u , 5 7 9 = cos u , dx dx dx dx Newton’s series: d(tan u) du d(cot u) du = sec2 u , = csc2 u , 11. 12. 1·3 1 1 dx dx dx dx 6 = 2 + 2 · 3 · 23 + 2 · 4 · 5 · 25 + · · · π d(sec u) du d(csc u) du 13. 14. = − cot u csc u , = tan u sec u , Sharp’s series: dx dx dx dx −1 du d(arcsin u) 1 du d(arccos u) 1 1 1 1 =√ =√ 15. 16. = √ 1− 1 −3 +··· π , , +2 6 2 dx 1 − u2 dx 1−u 3 ·3 3 ·5 3 ·7 dx dx 3 −1 du d(arctan u) 1 du d(arccot u) Euler’s series: 17. 18. = , = , 1 + u2 dx 1 + u2 dx dx dx π2 1 1 1 1 1 + ··· −1 = + + + + d(arcsec u) 1 du d(arccsc u) du 12 22 32 42 52 6 =√ =√ 19. 20. , , π2 1 1 1 1 1 2 dx 2 dx u 1−u u 1−u + ··· dx dx = + + + + 12 32 52 72 92 8 π2 d(sinh u) du d(cosh u) du 1 1 1 1 1 − − − ··· = + + 21. 22. = cosh u , = sinh u , 12 22 32 42 52 12 dx dx dx dx Partial Fractions d(tanh u) du d(coth u) du = sech2 u , = − csch2 u , 23. 24. dx dx dx dx Let N (x) and D(x) be polynomial func- tions of x. We can break down d(sech u) du d(csch u) du 25. = − sech u tanh u , 26. = − csch u coth u , N (x)/D(x) using partial fraction expan- dx dx dx dx sion. First, if the degree of N is greater d(arcsinh u) 1 du d(arccosh u) 1 du than or equal to the degree of D, divide =√ =√ 27. 28. , , 2 dx 2 − 1 dx dx dx 1+u u N by D, obtaining N (x) N (x) d(arctanh u) 1 du d(arccoth u) 1 du = Q(x) + , 29. 30. = , =2 , D(x) D(x) 1 − u2 dx u − 1 dx dx dx −1 −1 where the degree of N is less than that of d(arcsech u) du d(arccsch u) du =√ √ 31. 32. , = . D. Second, factor D(x). Use the follow- u 1 − u2 dx |u| 1 + u2 dx dx dx ing rules: For a non-repeated factor: Integrals: N (x) A N (x) = + , (x − a)D(x) x−a D(x) 1. 2. cu dx = c u dx, (u + v) dx = u dx + v dx, where 1 1 N (x) 3. n = −1, 4. 5. xn dx = xn+1 , ex dx = ex , dx = ln x, A= . n+1 x D(x) x=a dx dv du For a repeated factor: 6. 7. dx = uv − = arctan x, u v dx, 1 + x2 dx dx m−1 N (x) Ak N (x) = + , (x − a)m D(x) (x − a)m−k D(x) 8. sin x dx = − cos x, 9. cos x dx = sin x, k=0 where 1 dk N (x) 10. tan x dx = − ln | cos x|, 11. cot x dx = ln | cos x|, Ak = . k! dxk D(x) x=a 12. sec x dx = ln | sec x + tan x|, 13. csc x dx = ln | csc x + cot x|, The reasonable man adapts himself to the world; the unreasonable persists in trying a2 − x2 , 14. arcsin x dx = arcsin x + a > 0, to adapt the world to himself. Therefore a a all progress depends on the unreasonable. – George Bernard Shaw
• Theoretical Computer Science Cheat Sheet Calculus Cont. ln(a2 + x2 ), a2 − x2 , 15. arccos x dx = arccos x − 16. arctan x dx = x arctan x − a a > 0, a > 0, 2 a a a a sin2 (ax)dx = cos2 (ax)dx = 1 1 17. ax − sin(ax) cos(ax) , 18. ax + sin(ax) cos(ax) , 2a 2a sec2 x dx = tan x, csc2 x dx = − cot x, 19. 20. sinn−1 x cos x n − 1 cosn−1 x sin x n − 1 21. sinn x dx = − 22. sinn−2 x dx, cosn x dx = cosn−2 x dx, + + n n n n tann−1 x cotn−1 x 23. − 24. cotn x dx = − − tann x dx = tann−2 x dx, cotn−2 x dx, n = 1, n = 1, n−1 n−1 tan x secn−1 x n − 2 25. secn x dx = secn−2 x dx, + n = 1, n−1 n−1 cot x cscn−1 x n − 2 26. cscn x dx = − 27. 28. cscn−2 x dx, + n = 1, sinh x dx = cosh x, cosh x dx = sinh x, n−1 n−1 29. 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 sinh2 x dx = cosh2 x dx = sech2 x dx = tanh x, 1 sinh(2x) − 1 x, 1 sinh(2x) + 1 x, 33. 34. 35. 4 2 4 2 ln |a2 − x2 |, x2 + a2 , 36. arcsinh x dx = x arcsinh x − 37. arctanh x dx = x arctanh x + a a > 0, 2 a a a a  x  x arccosh − x2 + a2 , if arccosh x > 0 and a > 0, a a 38. x arccosh a dx = x  x arccosh + x2 + a2 , if arccosh x < 0 and a > 0, a a dx √ = ln x + a2 + x2 , a > 0, 39. a2 + x2 dx a2 1 a2 − x2 dx = a2 − x2 + 40. 41. = a arctan x , a > 0, x arcsin x , a > 0, 2 2 a2 + x2 a a 3a4 (a2 − x2 )3/2 dx = x (5a2 − 2x2 ) a2 − x2 + 42. arcsin x , a > 0, 8 8 a dx dx 1 x a+x dx √ =√ 43. 44. 45. = arcsin x , a > 0, = ln , , a2 2 −x a−x (a2 2 )3/2 −x a2 − x2 2 a2 − x2 a 2a a dx a2 √ a2 ± x2 dx = a2 ± x2 ± a2 ± x2 , = ln x + x2 − a2 , a > 0, 46. 47. x ln x + 2 2 2 − a2 x √ 2(3bx − 2a)(a + bx)3/2 dx 1 x 48. 49. = ln , x a + bx dx = , ax2 + bx 15b2 a a + bx √ √ √ √ a + bx − a a + bx 1 x 1 √ √ dx = √ ln √ 50. 51. √ , a > 0, dx = 2 a + bx + a dx, x x a + bx a + bx a + bx + a 2 √ √ a2 − x2 a + a2 − x2 x a2 − x2 dx = − 1 (a2 − x2 )3/2 , dx = a2 − x2 − a ln 52. 53. , 3 x x √ a2 − x2 dx a+ a4 2 2 2 1 √ a2 x2 a2 x2 54. − −a ) − 55. = − a ln x x x dx = 8 (2x + arcsin a, a > 0, , 8 2 − x2 x a x2 dx x dx 2 √ √ = − a2 − x2 , = − x a2 − x2 + a arcsin a, 56. 57. x a > 0, 2 2 a2 − x2 2 − x2 a √ √ √ a2 + x2 a + a2 + x2 x2 − a2 2 + x2 − a ln dx = x2 − a2 − a arccos |x| , 59. 58. a dx = a , a > 0, x x x dx x x2 ± a2 dx = 1 (x2 ± a2 )3/2 , 1 √ √ 60. 61. x = ln , 3 x x2 + a2 a2 + x2 a a+
• Theoretical Computer Science Cheat Sheet Calculus Cont. Finite Calculus √ x2 ± a2 Diﬀerence, shift operators: dx dx 1 √ √ 62. 63. a = a arccos |x| , a > 0, = , ∆f (x) = f (x + 1) − f (x), a2 x 2 − a2 2 x2 ± a2 xx x √ (x2 + a2 )3/2 x2 ± a2 E f (x) = f (x + 1). x dx √ = x2 ± a2 , 64. 65. dx = , x4 3a2 x3 x2 ± a2 Fundamental Theorem:  √  2ax + b − b2 − 4ac f (x) = ∆F (x) ⇔ 1  f (x)δx = F (x) + C. √ , if b2 > 4ac, √  ln b2 − 4ac 2ax + b + b2 − 4ac dx 66. b b−1 =  ax2 + bx + c  f (x)δx = f (i). √ 2 2ax + b  if b2 < 4ac, arctan √ , a 4ac − b2 4ac − b2 i=a Diﬀerences:   √ ln 2ax + b + 2√a ax2 + bx + c , if a > 0, 1 ∆(cu) = c∆u, ∆(u + v) = ∆u + ∆v,  a dx √ 67. ∆(uv) = u∆v + E v∆u, = −2ax − b ax2 + bx + c  √1 arcsin √   , if a < 0, ∆(xn ) = nxn−1 , −a b2 − 4ac ∆(Hx ) = x−1 , ∆(2x ) = 2x , 4ax − b2 2ax + b dx √ ax2 + bx + c dx = ax2 + bx + c + 68. ∆(cx ) = (c − 1)cx , x x , ∆ = . 2 + bx + c m m−1 4a 8a ax Sums: √ ax2 + bx + c x dx b dx cu δx = c u δx, √ √ 69. − = , 2 + bx + c 2 + bx + c a 2a ax ax (u + v) δx = u δx + v δx,  √√ 2  −1  √ ln 2 c ax + bx + c + bx + 2c , u∆v δx = uv − E v∆u δx,  if c > 0, c x dx n+1 √ 70. x−1 δx = Hx , x = xn δx = m+1 , 1 2 + bx + c  x ax  √ arcsin √ + 2c , bx  if c < 0, x x x c cx δx = c−1 , −c |x| b2 − 4ac m δx = m+1 . Falling Factorial Powers: x3 x2 + a2 dx = ( 1 x2 − 22 2 + a2 )3/2 , 71. 15 a )(x xn = x(x − 1) · · · (x − n + 1), n > 0, 3 x0 = 1, 1 72. xn sin(ax) dx = − a xn cos(ax) + xn−1 cos(ax) dx, n a 1 xn = , n < 0, (x + 1) · · · (x + |n|) 1n 73. sin(ax) − n n−1 n x cos(ax) dx = ax x sin(ax) dx, xn+m = xm (x − m)n . a Rising Factorial Powers: xn eax 74. − xn eax dx = xn−1 eax dx, n xn = x(x + 1) · · · (x + n − 1), a n > 0, a x0 = 1, ln(ax) 1 75. − xn ln(ax) dx = xn+1 , (n + 1)2 n+1 1 xn = , n < 0, (x − 1) · · · (x − |n|) n+1 x m 76. (ln ax)m − xn (ln ax)m dx = xn (ln ax)m−1 dx. n+1 n+1 xn+m = xm (x + m)n . Conversion: xn = (−1)n (−x)n = (x − n + 1)n x1 = x1 x1 = = 1/(x + 1)−n , x2 = x2 + x1 x2 − x1 = x3 = x3 + 3x2 + x1 x3 − 3x2 + x1 xn = (−1)n (−x)n = (x + n − 1)n = = 1/(x − 1)−n , x4 = x + 6x3 + 7x2 + x1 4 x − 6x3 + 7x2 − x1 4 = x5 = x5 + 15x4 + 25x3 + 10x2 + x1 x5 − 15x4 + 25x3 − 10x2 + x1 n n = nk n xn = (−1)n−k xk , x= k k x1 = x1 x1 = x1 k=1 k=1 n x2 = x + x1 2 x2 = x − x1 2 n xn = (−1)n−k xk , 3 3 2 1 3 3 2 1 k x − 3x + 2x x= x + 3x + 2x x= k=1 x4 = x + 6x3 + 11x2 + 6x1 4 x4 = x − 6x3 + 11x2 − 6x1 4 n nk xn = x. 5 5 4 3 2 1 5 5 4 3 2 1 x − 10x + 35x − 50x + 24x x= x + 10x + 35x + 50x + 24x x= k k=1
• Theoretical Computer Science Cheat Sheet Series Ordinary power series: Taylor’s series: ∞ (x − a)2 (x − a)i (i) ∞ f (x) = f (a) + (x − a)f (a) + f (a) + · · · = f (a). ai xi . A(x) = 2 i! i=0 i=0 Expansions: ∞ Exponential power series: 1 = 1 + x + x2 + x3 + x4 + · · · xi , ∞ = xi 1−x A(x) = ai . i=0 i! ∞ 1 i=0 = 1 + cx + c2 x2 + c3 x3 + · · · ci xi , = 1 − cx Dirichlet power series: i=0 ∞ ∞ ai 1 A(x) = . 2n 3n + ··· ni n =1+x +x +x = x, ix 1 − xn i=1 i=0 ∞ Binomial theorem: x = x + 2x2 + 3x3 + 4x4 + · · · ixi , = n n n−k k (1 − x)2 (x + y)n = x y. i=0 k ∞ dn 1 k=0 = x + 2n x2 + 3n x3 + 4n x4 + · · · = xk in xi , Diﬀerence of like powers: 1−x dxn i=0 n−1 ∞ xi xn − y n = (x − y) xn−1−k y k . 12 13 + ··· x e =1+x+ 2x + 6x = , i! k=0 i=0 ∞ For ordinary power series: xi = x − 1 x2 + 1 x3 − 1 x4 − · · · (−1)i+1 , ln(1 + x) = ∞ 2 3 4 i (αai + βbi )xi , i=1 αA(x) + βB(x) = ∞ xi 1 = x + 1 x2 + 1 x3 + 1 x4 + · · · i=0 ln = , 2 3 4 ∞ 1−x i i=1 xk A(x) = ai−k xi , ∞ x2i+1 1 1 1 = x − 3! x3 + 5! x5 − 7! x7 + · · · = (−1)i i=k sin x , (2i + 1)! ∞ k−1 A(x) − i ai x i=0 ∞ ai+k xi , i=0 x2i = xk 12 14 16 =1− − + ··· (−1)i cos x 2! x + 4! x 6! x = , i=0 (2i)! ∞ i=0 ∞ ci ai xi , x2i+1 A(cx) = −1 13 15 17 =x− − + ··· i tan x 3x + 5x 7x = (−1) , i=0 (2i + 1) ∞ i=0 ∞ (i + 1)ai+1 xi , A (x) = ni n(n−1) 2 + ··· (1 + x)n = 1 + nx + x = x, 2 i i=0 i=0 ∞ ∞ 1 i+n i iai xi , xA (x) = x2 + · · · = n+2 = 1 + (n + 1)x + x, 2 (1 − x)n+1 i i=1 i=0 ∞ ∞ i ai−1 i x Bi x = 1 − 1x + 12 1 4 − + ··· = A(x) dx = x, 12 x 720 x , 2 −1 i ex i! i=1 i=0 ∞ √ ∞ 1 1 2i i A(x) + A(−x) = 1 + x + 2x2 + 5x3 + · · · (1 − 1 − 4x) a2i x2i , = x, = 2x i+1 i 2 i=0 i=0 ∞ ∞ 1 2i i A(x) − A(−x) 2 3 √ = 1 + x + 2x + 6x + · · · = x, a2i+1 x2i+1 . 1 − 4x = i 2 √ i=0 ∞ i=0 n 1 − 1 − 4x 1 2i + n i 4+n x2 + · · · = √ i = 1 + (2 + n)x + x, Summation: If bi = j=0 ai then 2 1 − 4x 2x i i=0 1 ∞ B(x) = A(x). 1 1 32 11 3 25 4 1−x + ··· = Hi xi , ln =x+ 2x + 6x + 12 x 1−x 1−x Convolution:   i=1 ∞ 2 Hi−1 xi 1 1 ∞ i = 1 x2 + 3 x3 + 11 4 + ··· ln 24 x = ,  aj bi−j  xi . 2 4 1−x A(x)B(x) = 2 i i=2 ∞ i=0 j=0 x 2 3 4 = x + x + 2x + 3x + · · · i = Fi x , 1 − x − x2 God made the natural numbers; i=0 ∞ Fn x all the rest is the work of man. 2 3 = Fn x + F2n x + F3n x + · · · i = Fni x . 1 − (Fn−1 + Fn+1 )x − (−1)n x2 – Leopold Kronecker i=0
• Theoretical Computer Science Cheat Sheet Series Escher’s Knot Expansions: ∞ ∞ −n 1 1 n+i i 1 i (Hn+i − Hn ) xi , ln = x, = (1 − x) 1−x n+1 i x n i=0 i=0 ∞ ∞ i n!xi ni (e − 1) n x n x = x, = , i n i! i=0 i=0 ∞ ∞ (−4)i B2i x2i n i n!xi 1 ln = , x cot x = , 1−x n i! (2i)! i=0 i=0 ∞ ∞ 2i 2i − 1)B2i x2i−1 i−1 2 (2 1 tan x = (−1) , ζ(x) = , ix (2i)! i=1 i=1 ∞ ∞ ζ(x − 1) 1 µ(i) φ(i) = , = , ix ix ζ(x) ζ(x) i=1 i=1 1 ζ(x) = , Stieltjes Integration 1 − p−x p If G is continuous in the interval [a, b] and F is nondecreasing then ∞ d(i) 2 b ζ (x) = where d(n) = 1, d|n xi G(x) dF (x) i=1 a ∞ exists. If a ≤ b ≤ c then S(i) ζ(x)ζ(x − 1) = where S(n) = d, d|n c b c xi i=1 G(x) dF (x) = G(x) dF (x) + G(x) dF (x). 2n−1 |B2n | 2n 2 a a b n ∈ N, ζ(2n) = π, If the integrals involved exist (2n)! b b b ∞ − 2)B2i x2i i x i−1 (4 G(x) + H(x) dF (x) = G(x) dF (x) + H(x) dF (x), = (−1) , a a a sin x (2i)! i=0 b b b √ ∞ n G(x) d F (x) + H(x) = G(x) dF (x) + G(x) dH(x), 1 − 1 − 4x n(2i + n − 1)! i = x, a a a 2x i!(n + i)! b b b i=0 c · G(x) dF (x) = G(x) d c · F (x) = c G(x) dF (x), ∞ iπ i/2 2 sin 4 a a a x i e sin x = x, b b i! G(x) dF (x) = G(b)F (b) − G(a)F (a) − i=1 F (x) dG(x). √ ∞ a a 1− 1−x (4i)! √ xi , If the integrals involved exist, and F possesses a derivative F at every = x i 2(2i)!(2i + 1)! 16 point in [a, b] then i=0 ∞ 2 4i i!2 b b arcsin x x2i . G(x) dF (x) = G(x)F (x) dx. = x (i + 1)(2i + 1)! a a i=0 Cramer’s Rule Fibonacci Numbers 00 47 18 76 29 93 85 34 61 52 If we have equations: 86 11 57 28 70 39 94 45 02 63 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, . . . a1,1 x1 + a1,2 x2 + · · · + a1,n xn = b1 95 80 22 67 38 71 49 56 13 04 Deﬁnitions: a2,1 x1 + a2,2 x2 + · · · + a2,n xn = b2 59 96 81 33 07 48 72 60 24 15 Fi = Fi−1 +Fi−2 , F0 = F1 = 1, 73 69 90 82 44 17 58 01 35 26 . . . . . . . . . F−i = (−1)i−1 Fi , 68 74 09 91 83 55 27 12 46 30 an,1 x1 + an,2 x2 + · · · + an,n xn = bn 37 08 75 19 92 84 66 23 50 41 1 ˆ φi − φi , √ Fi = 14 25 36 40 51 62 03 77 88 99 5 Let A = (ai,j ) and B be the column matrix (bi ). Then 21 32 43 54 65 06 10 89 97 78 Cassini’s identity: for i > 0: there is a unique solution iﬀ det A = 0. Let Ai be A Fi+1 Fi−1 − Fi2 = (−1)i . 42 53 64 05 16 20 31 98 79 87 with column i replaced by B. Then det Ai Additive rule: The Fibonacci number system: xi = . det A Fn+k = Fk Fn+1 + Fk−1 Fn , Every integer n has a unique representation F2n = Fn Fn+1 + Fn−1 Fn . n = Fk1 + Fk2 + · · · + Fkm , Improvement makes strait roads, but the crooked Calculation by matrices: roads without Improvement, are roads of Genius. where ki ≥ ki+1 + 2 for all i, n Fn−2 Fn−1 01 = . – William Blake (The Marriage of Heaven and Hell) 1 ≤ i < m and km ≥ 2. Fn−1 Fn 11