Professional Documents
Culture Documents
Cheat PDF
Cheat PDF
Definitions Series
f (n) = O(g(n)) iff ∃ positive c, n0 such that n n n
X n(n + 1) X n(n + 1)(2n + 1) X n2 (n + 1)2
0 ≤ f (n) ≤ cg(n) ∀n ≥ n0 . i= , i2 = , i3 = .
i=1
2 i=1
6 i=1
4
f (n) = Ω(g(n)) iff ∃ positive c, n0 such that
In general:
f (n) ≥ cg(n) ≥ 0 ∀n ≥ n0 . n n
X 1 X
im = (n + 1)m+1 − 1 − (i + 1)m+1 − im+1 − (m + 1)im
f (n) = Θ(g(n)) iff f (n) = O(g(n)) and m+1
f (n) = Ω(g(n)). i=1 i=1
n−1 m
X 1 X m+1
f (n) = o(g(n)) iff limn→∞ f (n)/g(n) = 0. im = Bk nm+1−k .
i=1
m + 1 k
k=0
lim an = a iff ∀ǫ > 0, ∃n0 such that
n→∞ Geometric series:
|an − a| < ǫ, ∀n ≥ n0 . n ∞ ∞
X cn+1 − 1 X 1 X c
sup S least b ∈ R such that b ≥ s, ci = , c 6= 1, ci = , ci = , |c| < 1,
i=0
c−1 i=0
1−c i=1
1−c
∀s ∈ S.
n ∞
X ncn+2 − (n + 1)cn+1 + c X c
inf S greatest b ∈ R such that b ≤ ici = , c 6= 1, ici = , |c| < 1.
s, ∀s ∈ S. i=0
(c − 1)2 i=0
(1 − c)2
Harmonic series:
lim inf an lim inf{ai | i ≥ n, i ∈ N}. n n
n→∞ n→∞ X 1 X n(n + 1) n(n − 1)
Hn = , iHi = Hn − .
lim sup an lim sup{ai | i ≥ n, i ∈ N}. i=1
i i=1
2 4
n→∞ n→∞
n n
n
X X i n+1 1
k Combinations: Size k sub- Hi = (n + 1)Hn − n, Hi = Hn+1 − .
sets of a size n set. i=1 i=1
m m+1 m+1
n n
Stirling numbers (1st kind):
k n n! X n n n n
Arrangements of an n ele- 1. = , 2. =2 , 3. = ,
k (n − k)!k! k k n−k
k=0
ment set into k cycles.
n n n−1 n n−1 n−1
n 4. = , 5. = + ,
k Stirling numbers (2nd kind): k k k−1 k k k−1
Partitions of an n element
n m n n−k
X n
r+k
r+n+1
set into k non-empty sets. 6. = , 7. = ,
m k k m−k k n
n k=0
1st order Eulerian numbers: n n
k X k n+1 X r s r+s
Permutations π1 π2 . . . πn on 8. = , 9. = ,
m m+1 k n−k n
{1, 2, . . . , n} with k ascents. k=0
k=0
k−n−1
n n n
= (−1)k
n
2nd order Eulerian numbers. 10. , 11. = = 1,
k k k 1 n
Cn Catalan Numbers: Binary
n
n
n−1
n−1
n−1
trees with n + 1 vertices. 12. = 2 − 1, 13. = k + ,
2 k k k−1
n n n n n
14. = (n − 1)!, 15. = (n − 1)!Hn−1 , 16. = 1, 17. ≥ ,
1 2 n k k
n
n−1
n−1
n n n n X n 1 2n
18. = (n − 1) + , 19. = = , 20. = n!, 21. Cn = ,
k k k−1 n−1 n−1 2 k n+1 n
k=0
n n n n n n−1 n−1
22. = = 1, 23. = , 24. = (k + 1) + (n − k) ,
0 n−1 k n−1−k k k k−1
n
0 1 if k = 0, n n n+1
25. = 26. = 2n − n − 1, 27. = 3n − (n + 1)2n + ,
k 0 otherwise 1 2 2
n X m X n
X n x+k n n+1 n n k
28. xn = , 29. = (m + 1 − k)n (−1)k , 30. m! = ,
k n m k m k n−m
k=0 k=0 k=0
X n
n−k
n n n−k−m n n
31. = (−1) k!, 32. = 1, 33. = 0 for n 6= 0,
m k m 0 n
k=0
n
(2n)n
n n−1 n−1 X n
34. = (k + 1) + (2n − 1 − k) , 35. = ,
k k k−1 k 2n
k=0
X n X X n
x n x+n−1−k 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
X n k
n+1 X k X 1 k x X n x+k
38. = = nn−k = n! , 39. = , vertices has n − 1
m+1 k m m k! m x−n k 2n
k k=0 k=0 k=0
X X edges.
n n k+1 n−k n n+1 k
40. = (−1) , 41. = (−1)m−k , Kraft inequal-
m k m+1 m k+1 m
k k ity: If the depths
X m X m
m+n+1 n+k m+n+1 n+k of the leaves of
42. = k , 43. = k(n + k) ,
m k m k a binary tree are
k=0 k=0
d1 , . . . , dn :
X X
n n+1 k n n+1 k
44. = (−1)m−k , 45. (n − m)! = (−1)m−k , for n ≥ m, n
m k+1 m m k+1 m
X
k X k 2−di ≤ 1,
n m−n m+n m+k n X m − nm + n m + k i=1
46. = , 47. = ,
n−m m+k n+k k n−m m+k n+k k and equality holds
k X k
only if every in-
n−k
X
k n−k n
n ℓ+m k n n ℓ+m
48. = , 49. = . ternal node has 2
ℓ+m ℓ ℓ m k ℓ+m ℓ ℓ m k
k k
sons.
Recurrences
Master method: Generating functions:
T (n) = aT (n/b) + f (n), a ≥ 1, b > 1 1 T (n) − 3T (n/2) = n 1. Multiply both sides of the equa-
tion by xi .
log b a−ǫ 3 T (n/2) − 3T (n/4) = n/2
If ∃ǫ > 0 such that f (n) = O(n )
.. .. .. 2. Sum both sides over all i for
then
. . . which the equation is valid.
T (n) = Θ(nlogb a ).
log2 n−1 3. Choose a generatingPfunction
3 T (2) − 3T (1) = 2
If f (n) = Θ(nlogb a ) then G(x). Usually G(x) = ∞ i
i=0 x 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.
and ∃c < 1 such that af (n/b) ≤ cf (n) 4. Solve for G(x).
Summing the right side we get 5. The coefficient of xi in G(x) is gi .
for large n, then m−1
X n m−1
Example:
X i
i 3
T (n) = Θ(f (n)). i
3 = n 2 .
i=0
2 i=0
gi+1 = 2gi + 1, g0 = 0.
Substitution (example): Consider the
Let c = 23 . Then we have Multiply
X and sum:
following recurrence X X
i
Ti+1 = 22 · Ti2 , T1 = 2.
m−1
X m
c −1
gi+1 xi = 2gi xi + xi .
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
P
Let ti = log2 Ti . Then we have = 2n(clog2 n − 1)
in terms of G(x):
ti+1 = 2i + 2ti , t1 = 1.
= 2n(c(k−1) logc n − 1) G(x) − g0 X
= 2G(x) + xi .
Let ui = ti /2i . Dividing both sides of = 2nk − 2n, x
i≥0
the previous equation by 2i+1 we get
ti+1 2i ti k
and so T (n) = 3n − 2n. Full history re- Simplify:
= + i. G(x) 1
2 i+1 2 i+1 2 currences can often be changed to limited = 2G(x) + .
history ones (example): Consider x 1−x
Substituting we find i−1
ui+1 = 21 + ui , u1 = 12 , X Solve for G(x):
Ti = 1 + Tj , T0 = 1. x
G(x) = .
which is simply ui = i/2. So we find j=0 (1 − x)(1 − 2x)
i−1
that Ti has the closed form Ti = 2i2 . Note that
i Expand this
using partial fractions:
Summing factors (example): Consider X 2 1
the following recurrence Ti+1 = 1 + Tj . G(x) = x −
j=0 1 − 2x 1 − x
T (n) = 3T (n/2) + n, T (1) = 1.
Rewrite so that all terms involving T Subtracting we find X X
i i−1 = x 2 2i xi − xi
are on the left side
X X
Ti+1 − Ti = 1 + Tj − 1 − Tj i≥0 i≥0
T (n) − 3T (n/2) = n. j=0 j=0
X
i+1 i+1
= (2 − 1)x .
Now expand the recurrence, and choose = Ti . i≥0
a factor which makes the left side “tele-
scope” And so Ti+1 = 2Ti = 2i+1 . So gi = 2i − 1.
Theoretical Computer Science Cheat Sheet
√ √
1+ 5 1− 5
π ≈ 3.14159, e ≈ 2.71828, γ ≈ 0.57721, φ= 2 ≈ 1.61803, φ̂ = 2 ≈ −.61803
i 2i pi General Probability
1 2 2 Bernoulli Numbers (Bi = 0, odd i 6= 1): Continuous distributions: If
Z b
2 4 3 B0 = 1, B1 = − 21 , B2 = 61 , B4 = − 30
1
, Pr[a < X < b] = p(x) dx,
1 1 5
3 8 5 B6 = 42 , B8 = − 30 , B10 = 66 . a
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
Theoretical Computer Science Cheat Sheet
π Calculus
Wallis’ identity: Derivatives:
2 ·2 · 4 ·4 · 6 ·6···
π =2· d(cu) du d(u + v) du dv d(uv) dv du
1 ·3 · 3 ·5 · 5 ·7··· 1. =c , 2. = + , 3. =u +v ,
dx dx dx dx dx dx dx dx
Brouncker’s continued fraction expansion:
v du dv
12 d(un ) du d(u/v) dx − u d(ecu ) du
π 4. = nun−1 , 5. = dx
, 6. = cecu ,
4 = 1+ 32 dx dx dx v2 dx dx
2+ 52
2+
2+ 72 d(cu ) du d(ln u) 1 du
2+···
7. = (ln c)cu , 8. = ,
dx dx dx u dx
Gregrory’s series:
π 1 1 1 1 d(sin u) du d(cos u) du
4 =1− 3 + 5 − 7 + 9 − ··· 9. = cos u , 10. = − sin u ,
dx dx dx dx
Newton’s series:
d(tan u) du d(cot u) du
1 1 1·3 11. = sec2 u , 12. = csc2 u ,
π
= + + + ··· dx dx dx dx
6 2 2·3·2 3 2 · 4 · 5 · 25 d(sec u) du d(csc u) du
Sharp’s series: 13. = tan u sec u , 14. = − cot u csc u ,
dx dx dx dx
1 1 1 1 d(arcsin u) 1 du d(arccos u) −1 du
π
= √ 1− 1 + 2 − 3 +··· 15. =√ , 16. = √ ,
6
3 3 ·3 3 ·5 3 ·7 dx 1 − u dx
2 dx 1 − u2 dx
Euler’s series: d(arctan u) 1 du d(arccot u) −1 du
17. = , 18. = ,
dx 1 + u2 dx dx 1 + u2 dx
π2 1 1 1 1 1
6 = 12 + 22 + 32 + 42 + 52 + ··· d(arcsec u) 1 du d(arccsc u) −1 du
π2
19. = √ , 20. = √ ,
= 1
+ 1
+ 1
+ 1
+ 1
+ ··· dx u 1 − u dx
2 dx u 1 − u dx
2
8 12 32 52 72 92
π2
= 1
− 1
+ 1
− 1
+ 1
− ··· d(sinh u) du d(cosh u) du
12 12 22 32 42 52 21. = cosh u , 22. = sinh u ,
dx dx dx dx
Partial Fractions d(tanh u) du d(coth u) du
23. = sech2 u , 24. = − csch2 u ,
Let N (x) and D(x) be polynomial func- dx dx dx dx
tions of x. We can break down d(sech u) du d(csch u) du
N (x)/D(x) using partial fraction expan- 25. = − sech u tanh u , 26. = − csch u coth u ,
dx dx dx dx
sion. First, if the degree of N is greater
than or equal to the degree of D, divide d(arcsinh u) 1 du d(arccosh u) 1 du
27. =√ , 28. = √ ,
N by D, obtaining dx 1 + u dx
2 dx u − 1 dx
2
where Z Z
1 dk N (x)
Ak = . 10. tan x dx = − ln | cos x|, 11. cot x dx = ln | cos x|,
k! dxk D(x) x=a Z Z
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 Z p
to adapt the world to himself. Therefore 14. arcsin xa dx = arcsin xa + a2 − x2 , a > 0,
all progress depends on the unreasonable.
– George Bernard Shaw
Theoretical Computer Science Cheat Sheet
Calculus Cont.
Z p Z
15. arccos x
a dx = arccos x
a − a2 − x2 , a > 0, 16. arctan xa dx = x arctan xa − a
2 ln(a2 + x2 ), a > 0,
Z Z
sin2 (ax)dx = 1
cos2 (ax)dx = 1
17. 2a ax − sin(ax) cos(ax) , 18. 2a ax + sin(ax) cos(ax) ,
Z Z
19. sec2 x dx = tan x, 20. csc2 x dx = − cot x,
dx
Z p
39. √ = ln x + a2 + x2 , a > 0,
a2 + x2
dx
Z Z p p 2
1 x
40. 2 2
= a arctan a , a > 0, 41. a2 − x2 dx = x2 a2 − x2 + a2 arcsin xa , a > 0,
a +x
Z p 4
42. (a2 − x2 )3/2 dx = x8 (5a2 − 2x2 ) a2 − x2 + 3a8 arcsin xa , a > 0,
dx dx 1 a + x dx x
Z Z Z
x
43. √ = arcsin a , a > 0, 44. 2 2
= ln , 45. 2 2 3/2
= √ ,
2
a −x 2 a −x 2a a−x (a − x ) a a2 − x2
2
dx
Z p p Z
2
p p
46. a2 ± x2 dx = x2 a2 ± x2 ± a2 ln x + a2 ± x2 , 47. √ = ln x + x2 − a2 , a > 0,
x2 − a2
√ 2(3bx − 2a)(a + bx)3/2
dx 1 x
Z Z
48. 2
= ln , 49. x a + bx dx = ,
ax + bx a a + bx 15b2
Z √ √
√ √
a + bx 1 x 1 a + bx − a
Z Z
50. dx = 2 a + bx + a √ dx, 51. √ dx = √ ln √ √ , a > 0,
x x a + bx a + bx 2 a + bx + a
Z √ 2 a + √a2 − x2
a − x2 p Z p
52. 2 2
dx = a − x − a ln , 53. x a2 − x2 dx = − 13 (a2 − x2 )3/2 ,
x x
a + √a2 − x2
dx
Z p p Z
4
54. x2 a2 − x2 dx = x8 (2x2 − a2 ) a2 − x2 + a8 arcsin xa , a > 0, 55. √ = − a1 ln ,
2
a −x 2 x
2
x dx x dx
Z p Z p 2
56. √ = − a2 − x2 , 57. √ = − x2 a2 − x2 + a2 arcsin a, x
a > 0,
2
a −x 2 a 2 − x2
√ √ √
a2 + x2 a + a2 + x2 x2 − a2
Z p Z p
a
58. dx = a2 + x2 − a ln , 59. dx = x2 − a2 − a arccos |x| , a > 0,
x x x
dx x
Z p Z
x x2 ± a2 dx = 31 (x2 ± a2 )3/2 , = a1 ln
60. 61. √ √ ,
x x2 + a2 a + a2 + x2
Theoretical Computer Science Cheat Sheet
Calculus Cont. Finite Calculus
√
dx dx x2 ± a2 Difference, shift operators:
Z Z
1 a
62. √ = a arccos |x| , a > 0, 63. √ =∓ ,
x x2 − a2 x2 x2 ± a2 a2 x ∆f (x) = f (x + 1) − f (x),
√
x dx x2 ± a2 (x2 + a2 )3/2 E f (x) = f (x + 1).
Z p Z
64. √ = x2 ± a2 , 65. dx = ∓ ,
x2 ± a2 x4 3a2 x3 Fundamental Theorem:
√
2ax + b − b2 − 4ac X
1 f (x) = ∆F (x) ⇔ f (x)δx = F (x) + C.
√ ln √ , if b2 > 4ac,
dx
Z 2
b − 4ac 2
2ax + b + b − 4ac b b−1
=
66. X X
ax2 + bx + c 2 2ax + b f (x)δx = f (i).
√ arctan √ if b2 < 4ac,
, a i=a
4ac − b2 4ac − b2
Differences:
1 √ p
∆(cu) = c∆u, ∆(u + v) = ∆u + ∆v,
√ ln 2ax + b + 2 a ax2 + bx + c , if a > 0,
dx a
Z
67. √ = ∆(uv) = u∆v + E v∆u,
ax2 + bx + c 1 −2ax − b
√
arcsin √ , if a < 0, ∆(xn ) = nxn−1 ,
−a b2 − 4ac
∆(Hx ) = x−1 , ∆(2x ) = 2x ,
2ax + b p 2 4ax − b2 dx
Z p Z
x x
ax2 + bx + c dx = √ ∆(cx ) = (c − 1)cx ,
68. ax + bx + c + , ∆ m = m−1 .
4a 8a 2
ax + bx + c
Sums:
√
x dx ax2
+ bx + c b dx
Z Z P P
cu δx = c u δx,
69. √ = − √ ,
2
ax + bx + c a 2a 2
ax + bx + c P P P
(u + v) δx = u δx + v δx,
√ √
−1 2 c ax2 + bx + c + bx + 2c P P
u∆v δx = uv − E v∆u δx,
√c ln , if c > 0,
dx x
Z
n+1
√ = x δx = xm+1 ,
P n P −1
70. x δx = Hx ,
2
x ax + bx + c 1 bx + 2c
√ arcsin √
, if c < 0, P x c x P x
x
−c |x| b2 − 4ac c δx = c−1 , m δx = m+1 .
Z p Falling Factorial Powers:
71. x3 x2 + a2 dx = ( 13 x2 − 15
2 2
a )(x2 + a2 )3/2 ,
xn = x(x − 1) · · · (x − n + 1), n > 0,
0
x = 1,
Z Z
72. xn sin(ax) dx = − a1 xn cos(ax) + n
a xn−1 cos(ax) dx,
1
xn = , n < 0,
Z Z (x + 1) · · · (x + |n|)
n 1 n n n−1
73. x cos(ax) dx = ax sin(ax) − x sin(ax) dx,
a xn+m = xm (x − m)n .
Z
xn eax
Z Rising Factorial Powers:
74. xn eax dx = − n
xn−1 eax dx,
a a xn = x(x + 1) · · · (x + n − 1), n > 0,
ln(ax) 1
Z
75. xn ln(ax) dx = xn+1 − , x0 = 1,
n+1 (n + 1)2 1
n+1 xn = , n < 0,
x m
Z Z
(x − 1) · · · (x − |n|)
76. xn (ln ax)m dx = (ln ax)m − xn (ln ax)m−1 dx.
n+1 n+1 xn+m = xm (x + m)n .
Conversion:
x1 = x1 = x1 xn = (−1)n (−x)n = (x − n + 1)n
x2 = x2 + x1 = x2 − x1 = 1/(x + 1)−n ,
x3 = x3 + 3x2 + x1 = x3 − 3x2 + x1 xn = (−1)n (−x)n = (x + n − 1)n
x4 = x + 6x3 + 7x2 + x1
4
= x − 6x3 + 7x2 − x1
4
= 1/(x − 1)−n ,
x5 = x5 + 15x4 + 25x3 + 10x2 + x1 = x5 − 15x4 + 25x3 − 10x2 + x1 Xn
n k X n
n
xn = x = (−1)n−k xk ,
k k
x1 = x1 x1 = x1 k=1 k=1
n
x2 = x + x1
2
x2 = x − x1
2 X n
xn = (−1)n−k xk ,
x3 = x3 + 3x2 + 2x1 x3 = x3 − 3x2 + 2x1 k
k=1
n
x4 = x4 + 6x3 + 11x2 + 6x1 x4 = x4 − 6x3 + 11x2 − 6x1 n
X n k
x = x .
x5 = x5 + 10x4 + 35x3 + 50x2 + 24x1 x5 = x5 − 10x4 + 35x3 − 50x2 + 24x1 k
k=1
Theoretical Computer Science Cheat Sheet
Series
Taylor’s series: Ordinary power series:
∞
(x − a)2 ′′
′
X (x − a)i ∞
f (x) = f (a) + (x − a)f (a) + f (a) + · · · = f (i) (a).
X
2 i! A(x) = ai xi .
i=0 i=0
Expansions:
1 X∞ Exponential power series:
= 1 + x + x2 + x3 + x4 + · · · = xi , ∞
xi
1−x
X
i=0 A(x) = ai .
∞ i!
1 X i=0
= 1 + cx + c2 x2 + c3 x3 + · · · = ci xi , Dirichlet power series:
1 − cx i=0
∞ ∞
1
X ai
A(x) = .
X
= 1 + x n
+ x 2n
+ x 3n
+ · · · = xni , ix
1 − xn i=0 i=1
∞ Binomial theorem:
x X
2 3
= x + 2x + 3x + 4x + · · · 4
= ixi , n
n n−k k
(1 − x)2
X
i=0 (x + y)n = x y .
n ∞ k
X n k!z k X k=0
= x + 2 n 2
x + 3 n 3
x + 4 n 4
x + · · · = in xi , Difference of like powers:
k (1 − z)k+1 i=0
k=0
∞ n−1
xi
X
xn − y n = (x − y) xn−1−k y k .
X
ex = 1 + x + 21 x2 + 16 x3 + · · · = ,
i=0
i! k=0
∞
X xi For ordinary power series:
ln(1 + x) = x − 12 x2 + 31 x3 − 41 x4 − · · · = (−1)i+1 , ∞
i X
i=1 αA(x) + βB(x) = (αai + βbi )xi ,
∞ i
1 Xx i=0
ln = x + 21 x2 + 31 x3 + 41 x4 + · · · = , ∞
1−x i X
i=1
∞ xk A(x) = ai−k xi ,
X x2i+1
sin x = x − 3! 1 3
x + 5! 1 5
x − 7! 1 7
x + ··· = (−1)i , i=k
(2i + 1)! Pk−1 i ∞
i=0 A(x) − ai x X
∞
x2i
i=0
= ai+k xi ,
xk
X
cos x = 1 − 2! 1 2
x + 4! 1 4
x − 6! 1 6
x + ··· = (−1)i , i=0
i=0
(2i)! ∞
X
X∞
x2i+1 A(cx) = ci ai xi ,
tan−1 x = x − 31 x3 + 51 x5 − 71 x7 + · · · = (−1)i , i=0
i=0
(2i + 1) ∞
∞
X
n i A′ (x) = (i + 1)ai+1 xi ,
= 1 + nx + n(n−1)
X
(1 + x)n 2 x 2
+ · · · = x,
i=0
i i=0
∞
∞
1 i+n i
X
xA′ (x) = iai xi ,
X
n+2 2
= 1 + (n + 1)x + 2 x + · · · = x,
(1 − x)n+1 i=0
i i=1
∞ ∞
Bi xi ai−1
Z
x X
xi ,
X
1 1 2 1 4 A(x) dx =
= 1 − 2 x + 12 x − 720 x + · · · = ,
x
e −1 i! i=1
i
i=0
∞
√ ∞
1 2 3
X 1 2i i A(x) + A(−x) X
(1 − 1 − 4x) = 1 + x + 2x + 5x + · · · = x, = a2i x2i ,
2x i=0
i+1 i 2 i=0
∞
1 X 2i i A(x) − A(−x)
∞
√ = 1 + 2x + 6x2 + 20x3 + · · · = x, =
X
a2i+1 x2i+1 .
1 − 4x i=0
i 2
√ n ∞ i=0
1 − 1 − 4x
1 4+n 2
X 2i + n i Pi
√ = 1 + (2 + n)x + 2 x + · · · = x, Summation: If bi = j=0 ai then
1 − 4x 2x i=0
i
∞ 1
1 1 X B(x) = A(x).
ln 3 2 11 3 25 4
= x + 2 x + 6 x + 12 x + · · · = Hi xi , 1−x
1−x 1−x i=1 Convolution:
2 ∞
Hi−1 xi
1 1 X ∞ i
ln = 21 x2 + 43 x3 + 24 11 4
x + ··· = , X X
2 1−x i A(x)B(x) = aj bi−j xi .
i=2
∞ i=0 j=0
x X
= x + x 2
+ 2x 3
+ 3x 4
+ · · · = Fi xi ,
1 − x − x2 i=0 God made the natural numbers;
∞
Fn x X all the rest is the work of man.
= F n x + F 2n x 2
+ F 3n x 3
+ · · · = Fni xi .
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 X n+i i 1 X i
n+1
ln = (Hn+i − Hn ) x, = xi ,
(1 − x) 1−x i=0
i x i=0
n
∞ ∞
X n i X i n!xi
xn = x, x
(e − 1) n
= ,
i=0
i i=0
n i!
n ∞ ∞
i n!xi (−4)i B2i x2i
1 X X
ln = , x cot x = ,
1−x i=0
n i! i=0
(2i)!
∞ 2i 2i 2i−1 ∞
i−1 2 (2 − 1)B2i x 1
X X
tan x = (−1) , ζ(x) = x
,
i=1
(2i)! i=1
i
∞ ∞
1 X µ(i) ζ(x − 1) X φ(i)
= x
, = ,
ζ(x) i=1
i ζ(x) i=1
ix
Y 1
ζ(x) = , Stieltjes Integration
p
1 − p−x
∞
If G is continuous in the interval [a, b] and F is nondecreasing then
X d(i) Z b
ζ 2 (x)
P
= where d(n) = d|n 1,
xi G(x) dF (x)
i=1 a
∞
X S(i) P exists. If a ≤ b ≤ c then
ζ(x)ζ(x − 1) = where S(n) = d|n d, Z c b c
xi
Z Z
i=1 G(x) dF (x) = G(x) dF (x) + G(x) dF (x).
2n−1
2 |B2n | 2n a a b
ζ(2n) = π , n ∈ N, If the integrals involved exist
(2n)! Z b Z b Z b
∞
x (4i − 2)B2i x2i
X G(x) + H(x) dF (x) = G(x) dF (x) + H(x) dF (x),
= (−1)i−1 , a a a
sin x i=0
(2i)! Z b Z b Z b
√ n ∞
1 − 1 − 4x X n(2i + n − 1)! G(x) d F (x) + H(x) = G(x) dF (x) + G(x) dH(x),
= xi , a a a
2x i=0
i!(n + i)! Z b Z b
Z b
∞ i/2 iπ c · G(x) dF (x) = G(x) d c · F (x) = c G(x) dF (x),
x
X 2 sin 4 i a a a
e sin x = x, b b
i!
Z Z
i=1 G(x) dF (x) = G(b)F (b) − G(a)F (a) − F (x) dG(x).
√
s
∞ a a
1− 1−x (4i)!
If the integrals involved exist, and F possesses a derivative F ′ at every
X
= √ xi ,
x i=0
i
16 2(2i)!(2i + 1)! point in [a, b] then
2 ∞ Z b Z b
4i i!2
arcsin x X
= x2i . G(x) dF (x) = G(x)F ′ (x) dx.
x i=0
(i + 1)(2i + 1)! a a