Table Of ContentTheoretical Computer Science Cheat Sheet
De(cid:12)nitions Series
f(n)=O(g(n)) i(cid:11) 9 positive c;n0 such that Xn n(n+1) Xn n(n+1)(2n+1) Xn n2(n+1)2
0(cid:20)f(n)(cid:20)cg(n) 8n(cid:21)n0. i= ; i2 = ; i3 = :
2 6 4
f(n)=Ω(g(n)) i(cid:11) 9 positive c;n such that i=1 i=1 i=1
0 In general:
f(n)(cid:21)cg(n)(cid:21)0 8n(cid:21)n . (cid:20) (cid:21)
0 Xn Xn (cid:0) (cid:1)
1
f(n)=(cid:2)(g(n)) i(cid:11) f(n) = O(g(n)) and im = (n+1)m+1−1− (i+1)m+1−im+1−(m+1)im
m+1
f(n)=Ω(g(n)). i=1 i=1
(cid:18) (cid:19)
nX−1 Xm
1 m+1
f(n)=o(g(n)) i(cid:11) limn!1f(n)=g(n)=0. im = Bknm+1−k:
m+1 k
nl!im1an =a jia(cid:11)n8−(cid:15)a>j<0(cid:15),, 89nn0(cid:21)snu0c.h that GiX=en1ometriccns+er1ie−s:k1=0 X1 1 X1 c
supS least b 2 R such that b (cid:21) s, ci = c−1 ; c6=1; ci = 1−c; ci = 1−c; jcj<1;
8s2S. i=0 i=0 i=1
Xn ncn+2−(n+1)cn+1+c X1 c
infS greatest b2R such that b(cid:20) ici = ; c6=1; ici = ; jcj<1:
s, 8s2S. i=0 (c−1)2 i=0 (1−c)2
Harmonic series:
linm!i1nfan nl!im1inffai ji(cid:21)n;i2Ng. Xn 1 Xn n(n+1) n(n−1)
Hn = ; iHi = Hn− :
linm!s1upan nl!im1supfai ji(cid:21)n;i2Ng. i=1 i i=1 (cid:18) (cid:19) 2(cid:18) (cid:19)(cid:18) 4 (cid:19)
(cid:0) (cid:1) Xn Xn
nk Combinations: Size k sub- Hi =(n+1)Hn−n; mi Hi = mn++11 Hn+1− m1+1 :
sets of a size n set. i=1 i=1
(cid:2) (cid:3) (cid:18) (cid:19) (cid:18) (cid:19) (cid:18) (cid:19) (cid:18) (cid:19)
n Xn
Stirling numbers (1st kind): n n! n n n
k 1. = ; 2. =2n; 3. = ;
Arrangements of an n ele- k (n−k)!k! k k n−k
ment set into k cycles. (cid:18) (cid:19) (cid:18) (cid:19) k=0 (cid:18) (cid:19) (cid:18) (cid:19) (cid:18) (cid:19)
(cid:8)nk(cid:9) Stirlingnumbers(2ndkind): 4. nk = nk nk−−11 ; 5. nk = n−k 1 + nk−−11 ;
(cid:18) (cid:19)(cid:18) (cid:19) (cid:18) (cid:19)(cid:18) (cid:19) (cid:18) (cid:19) (cid:18) (cid:19)
Partitions of an n element n m n n−k Xn r+k r+n+1
set into k non-empty sets. 6. = ; 7. = ;
(cid:10) (cid:11) m k k m−k k n
n (cid:18) (cid:19) (cid:18) (cid:19) k=0(cid:18) (cid:19)(cid:18) (cid:19) (cid:18) (cid:19)
1st order Eulerian numbers: Xn Xn
k k n+1 r s r+s
Permutations (cid:25)1(cid:25)2:::(cid:25)n on 8. m = m+1 ; 9. k n−k = n ;
f1;2;:::;ng with k ascents. k=(cid:18)0 (cid:19) (cid:18) (cid:19) k=0 (cid:26) (cid:27) (cid:26) (cid:27)
(cid:10)(cid:10) (cid:11)(cid:11) n k−n−1 n n
n 2ndorderEuleriannumbers. 10. =(−1)k ; 11. = =1;
k k k 1 n
(cid:26) (cid:27) (cid:26) (cid:27) (cid:26) (cid:27) (cid:26) (cid:27)
Cn Catalan Numbers: Binary n n n−1 n−1
trees with n+1 vertices. 12. =2n−1−1; 13. =k + ;
2 k k k−1
(cid:20) (cid:21) (cid:20) (cid:21) (cid:20) (cid:21) (cid:20) (cid:21) (cid:26) (cid:27)
n n n n n
14. 1 =(n−1)!; 15. 2 =(n−1)!Hn−1; 16. n =1; 17. k (cid:21) k ;
(cid:20) (cid:21) (cid:20) (cid:21) (cid:20) (cid:21) (cid:26) (cid:27) (cid:20) (cid:21) (cid:18) (cid:19) (cid:20) (cid:21) (cid:18) (cid:19)
n n−1 n−1 n n n Xn n 1 2n
18. k =(n−1) k + k−1 ; 19. n−1 = n−1 = 2 ; 20. k =n!; 21. Cn = n+1 n ;
(cid:28) (cid:29) (cid:28) (cid:29) (cid:28) (cid:29) (cid:28) (cid:29) (cid:28) (cid:29)k=0 (cid:28) (cid:29) (cid:28) (cid:29)
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
(cid:28) (cid:29) n (cid:28) (cid:29) (cid:28) (cid:29) (cid:18) (cid:19)
25. 0 = 1 if k =0, 26. n =2n−n−1; 27. n =3n−(n+1)2n+ n+1 ;
k 0 otherwise 1 2 2
(cid:28) (cid:29)(cid:18) (cid:19) (cid:28) (cid:29) (cid:18) (cid:19) (cid:26) (cid:27) (cid:28) (cid:29)(cid:18) (cid:19)
Xn Xm Xn
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
(cid:28) (cid:29)k=0 (cid:26) (cid:27)(cid:18) (cid:19) k=0 (cid:28)(cid:28) (cid:29)(cid:29) (cid:28)(cid:28) k(cid:29)=(cid:29)0
n Xn n n−k n n
31. = (−1)n−k−mk!; 32. =1; 33. =0 for n6=0;
m k m 0 n
(cid:28)(cid:28) (cid:29)(cid:29) k=0 (cid:28)(cid:28) (cid:29)(cid:29) (cid:28)(cid:28) (cid:29)(cid:29) (cid:28)(cid:28) (cid:29)(cid:29)
n n−1 n−1 Xn n (2n)n
34. =(k+1) +(2n−1−k) ; 35. = ;
k k k−1 k 2n
(cid:26) (cid:27) (cid:28)(cid:28) (cid:29)(cid:29)(cid:18) (cid:19) (cid:26) (cid:27) (cid:18) (cid:19)(cid:26) (cid:27) k=(cid:26)0 (cid:27)
x Xn n x+n−1−k n+1 X n k Xn 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
(cid:20) (cid:21) (cid:20) (cid:21)(cid:18) (cid:19) (cid:20) (cid:21) (cid:20) (cid:21) (cid:20) (cid:21) (cid:28)(cid:28) (cid:29)(cid:29)(cid:18) (cid:19)
X Xn Xn Xn
n+1 n k k 1 k x n x+k Every tree with n
38. m+1 = k m = m nn−k =n! k! m ; 39. x−n = k 2n ; vertices has n−1
(cid:26) (cid:27) X(cid:18)k (cid:19)(cid:26) (cid:27) k=0 k=0 (cid:20) (cid:21) X(cid:20) k=0(cid:21)(cid:18) (cid:19) edges.
n n k+1 n n+1 k
40. = (−1)n−k; 41. = (−1)m−k; Kraft inequal-
m k m+1 m k+1 m
(cid:26) k (cid:27) (cid:26) (cid:27) (cid:20) k(cid:21) (cid:20) (cid:21) ity: If the depths
Xm Xm
42. m+n+1 = k n+k ; 43. m+n+1 = k(n+k) n+k ; of the leaves of
m k m k a binary tree are
(cid:18) (cid:19) (cid:26) k=0(cid:27)(cid:20) (cid:21) (cid:18) (cid:19) (cid:20) (cid:21)(cid:26) (cid:27) k=0
44. n =X n+1 k (−1)m−k; 45. (n−m)! n =X n+1 k (−1)m−k; for n(cid:21)m, d1;X:n::;dn:
(cid:26)m (cid:27)k k+(cid:18)1 m(cid:19)(cid:18) (cid:19)(cid:20) (cid:21) m(cid:20) k (cid:21) k+1(cid:18) m (cid:19)(cid:18) (cid:19)(cid:26) (cid:27) 2−di (cid:20)1;
46. n =X m−n m+n m+k ; 47. n =X m−n m+n m+k ; i=1
n−m m+k n+k k n−m m+k n+k k andequalityholds
(cid:26) (cid:27)(cid:18) k (cid:19) (cid:26) (cid:27)(cid:26) (cid:27)(cid:18) (cid:19) (cid:20) (cid:21)(cid:18)k (cid:19) (cid:20) (cid:21)(cid:20) (cid:21)(cid:18) (cid:19)
n ‘+m X k n−k n n ‘+m X k n−k n only if every in-
48. = ; 49. = :
‘+m ‘ ‘ m k ‘+m ‘ ‘ m k ternal node has 2
k k
sons.
Recurrences
Master method: (cid:0) (cid:1) Generating functions:
T(n)=aT(n=b)+f(n); a(cid:21)1;b>1 1 T(n)−3T(n=2)=n 1. Multiply both sides of the equa-
(cid:0) (cid:1)
If 9(cid:15)>0 such that f(n)=O(nlogba−(cid:15)) 3 T(n=2)−3T(n=4)=n=2 tion by xi.
2. Sum both sides over all i for
then .. .. ..
T(n)=(cid:2)(nlogba): .(cid:0) . . (cid:1) which the equation is valid.
3log2n−1 T(2)−3T(1)=2 3. Choose a generatingPfunction
If f(n)=(cid:2)(nlogba) then G(x). UsuallyG(x)= 1i=0xigi.
T(n)=(cid:2)(nlogbalog2n): wLeetgmet =T(nlo)g2−n3.mSTu(m1)m=ingTt(hne) −lef3tmsid=e 3. Rewrite the equation in terms of
the generating function G(x).
If9(cid:15)>0suchthatf(n)=Ω(nlogba+(cid:15)), T(n) − nk where k = log 3 (cid:25) 1:58496.
afonrdla9rcge<n1, tshuecnh that af(n=b) (cid:20) cf(n) SummingmXt−h1e right sidemXw−1e2(cid:0)ge(cid:1)t 54.. TSohlevecofoe(cid:14)r Gci(exn)t.ofxi inG(x)isgi.
T(n)=(cid:2)(f(n)): n3i =n 3 i: Example:
i=0 2i i=0 2 gi+1 =2gi+1; g0 =0:
Substitution (example): Consider the
fNLoeoltltoetwiti=hnTagil+tor1geTc2=iuTirs2ir.i2eainTlw(cid:1)chTeaeiy2n;swaeTp1hoaw=vee2r:of two. Let c=nmXi32=−.01Tcihe==n2nwn(cid:18)e(cchlcmoag−v2−en11−(cid:19)1) WMinuetlXeict(cid:21)rhimp0ologsyis+oeaf1nGxGd(ix(s=x)u)m=X:i(cid:21):P02ig(cid:21)ix0ix+igiXi.(cid:21)R0xewi:rite
ti+1 =2 +2ti; t1 =1: =2n(c(k−1)logcn−1) G(x)−g0 =2G(x)+Xxi:
Ltheetpuriev=iotui=s2eiq.uDatiivoindibnyg2bio+t1hwseidgeestof =2nk−2n; x i(cid:21)0
2tii++11 = 2i2+i1 + 2tii: caunrdresnoceTs(nca)n=of3tnenk −be2cnh.anFguelldhtiostloimryitreed- SimplifyG:(x) =2G(x)+ 1 :
history ones (example): Consider x 1−x
Substituting we (cid:12)nd
Xi−1
ui+1 = 12 +ui; u1 = 12; Ti =1+ Tj; T0 =1: Solve for G(x): x
G(x)= :
which is simply ui = i=2. So we (cid:12)nd j=0 (1−x)(1−2x)
thatTi hastheclosedformTi =2i2i−1. Note that
Summing factors (example): Consider Xi Expand this(cid:18)using partial fract(cid:19)ions:
2 1
the following recurrence Ti+1 =1+ Tj: G(x)=x 1−2x − 1−x
T(n)=3T(n=2)+n; T(1)=1: j=0 0 1
X X
Rewrite so that all terms involving T Subtracting we (cid:12)ndXi Xi−1 =x@2 2ixi− xiA
are on thTe(lnef)t−sid3Te(n=2)=n: Ti+1−Ti =1+ Tj −1− Tj X i(cid:21)0 i(cid:21)0
j=0 j=0 = (2i+1−1)xi+1:
Nowexpandtherecurrence,andchoose =Ti: i(cid:21)0
afactorwhichmakestheleftside\tele-
scope" And so Ti+1 =2Ti =2i+1. So gi =2i−1.
Theoretical Computer Science Cheat Sheet
p p
(cid:25) (cid:25)3:14159, e(cid:25)2:71828, γ (cid:25)0:57721, (cid:30)= 1+ 5 (cid:25)1:61803, (cid:30)^= 1− 5 (cid:25)−:61803
2 2
i 2i pi General Probability
1 2 2 Bernoulli Numbers (Bi =0, odd i6=1): Continuous distributionsZ: If
b
2 4 3 B =1, B =−1, B = 1, B =− 1 ,
0 1 2 2 6 4 30 Pr[a<X <b]= p(x)dx;
3 8 5 B = 1 , B =− 1 , B = 5 . a
6 42 8 30 10 66
thenpistheprobabilitydensityfunctionof
4 16 7 Change of base, quadratic formula:
p X. If
5 32 11 log x= logax; −b(cid:6) b2−4ac: Pr[X <a]=P(a);
b
6 64 13 logab 2a then P is the distribution function of X. If
Euler’s number e:
7 128 17 P and p both exist then
Z
e=1+ 1 + 1 + 1 + 1 +(cid:1)(cid:1)(cid:1) a
8 256 19 2 (cid:16) 6 2(cid:17)4 120
x n P(a)= p(x)dx:
9 512 23 lim 1+ =ex: −1
n!1 n
10 1,024 29 (cid:0)1+ 1(cid:1)n <e<(cid:0)1+ 1(cid:1)n+1: Expectation: If XXis discrete
11 2,048 31 n n (cid:18) (cid:19) E[g(X)]= g(x)Pr[X =x]:
(cid:0) (cid:1)
12 4,096 37 1+ 1 n =e− e + 11e −O 1 : x
n 2n 24n2 n3 If X continZuous then Z
13 8,192 41 1 1
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;::: −1 −1
2 6 12 60 20 140 280 2520
15 32,768 47 Variance, standard deviation:
16 65,536 53 lnn<Hn <lnn(cid:18)+1(cid:19); VAR[X]=pE[X2]−E[X]2;
17 131,072 59 1 (cid:27) = VAR[X]:
Hn =lnn+γ+O :
18 262,144 61 n For events A and B:
19 524,288 67 Factorial, Stirling’s approximation: Pr[A_B]=Pr[A]+Pr[B]−Pr[A^B]
20 1,048,576 71 1,2,6,24,120,720,5040,40320,362880,::: Pr[A^B]=Pr[A](cid:1)Pr[B];
21 2,097,152 73 p (cid:18) (cid:19)n(cid:18) (cid:18) (cid:19)(cid:19) i(cid:11) A and B are independent.
n 1
22 4,194,304 79 n!= 2(cid:25)n 1+(cid:2) : Pr[A^B]
e n Pr[AjB]=
23 8,388,608 83 Pr[B]
Ackerman8n’s function and inverse:
24 16,777,216 89 <2j i=1 For random variables X and Y:
25 33,554,432 97 a(i;j)= a(i−1;2) j =1 E[X (cid:1)Y]=E[X](cid:1)E[Y];
:
a(i−1;a(i;j−1)) i;j (cid:21)2 if X and Y are independent.
26 67,108,864 101
(cid:11)(i)=minfj ja(j;j)(cid:21)ig: E[X +Y]=E[X]+E[Y];
27 134,217,728 103
E[cX]=cE[X]:
28 268,435,456 107 Binomial distr(cid:18)ibu(cid:19)tion:
Bayes’ theorem:
n
2390 15,03763,8,77401,9,81224 110193 Pr[X =k]=Xnk p(cid:18)knq(cid:19)n−k; q =1−p; Pr[AijB]= PnjP=1r[PBrj[AAij]]PPrr[[ABij]Aj]:
31 2,147,483,648 127 k n−k
E[X]= k p q =np: Inclusion-exclusion:
32 4,294,967,296 131 k=1 k h_n i Xn
Pascal’s Triangle Poisson distribution: Pr Xi = Pr[Xi]+
e−(cid:21)(cid:21)k i=1 i=1
1 Pr[X =k]= ; E[X]=(cid:21): Xn X h ^k i
k!
1 1 Normal (Gaussian) distribution: (−1)k+1 Pr Xij :
1 2 1 p(x)= p1 e−(x−(cid:22))2=2(cid:27)2; E[X]=(cid:22): Momentkin=e2qualities:ii<(cid:1)(cid:1)(cid:1)<ik j=1
1 3 3 1 2(cid:25)(cid:27) (cid:2) (cid:3)
1
1 4 6 4 1 The \coupon collector": We are given a Pr jXj(cid:21)(cid:21)E[X] (cid:20) ;
(cid:21)
1 5 10 10 5 1 rdai(cid:11)nedroemntctoyuppeosnoefaccohudpaoyn,sa.nTdhtehedriestarribeun- Prh(cid:12)(cid:12)X −E[X](cid:12)(cid:12)(cid:21)(cid:21)(cid:1)(cid:27)i(cid:20) 1 :
1 6 15 20 15 6 1 (cid:21)2
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-
Pr[X =k]=pqk−1; q =1−p;
1 8 28 56 70 56 28 8 1 lect all n types is
X1
1 9 36 84 126 126 84 36 9 1 nHn: E[X]= kpqk−1 = 1:
p
1 10 45 120 210 252 210 120 45 10 1 k=1
Theoretical Computer Science Cheat Sheet
Trigonometry Matrices More Trig.
Multiplication: C
Xn
(0,1)
C =A(cid:1)B; ci;j = ai;kbk;j: a
b
b (cos(cid:18);sin(cid:18)) k=1 h
A C (cid:18) Determinants: detA6=0 i(cid:11) A is non-singular.
(-1,0) (1,0) A c B
detA(cid:1)B =detA(cid:1)detB; Law of cosines:
c a (0,-1) XYn c2 =a2+b2−2abcosC:
B detA= sign((cid:25))ai;(cid:25)(i):
Area:
Pythagorean theorem: (cid:25) i=1
C2 =A2+B2: 2(cid:2)2 and 3(cid:2)3 d(cid:12)eterm(cid:12)inant:
(cid:12) (cid:12) A= 1hc;
De(cid:12)nitions: (cid:12)(cid:12)ac db(cid:12)(cid:12)=ad−bc; = 21absinC;
sina=A=C; cosa=B=C; (cid:12)(cid:12)(cid:12)a b c(cid:12)(cid:12)(cid:12) (cid:12)(cid:12) (cid:12)(cid:12) (cid:12)(cid:12) (cid:12)(cid:12) (cid:12)(cid:12) (cid:12)(cid:12) 2c2sinAsinB
csca=C=A; seca=C=B; (cid:12)(cid:12)d e f(cid:12)(cid:12)=g(cid:12)(cid:12)b c(cid:12)(cid:12)−h(cid:12)(cid:12)a c(cid:12)(cid:12)+i(cid:12)(cid:12)a b(cid:12)(cid:12) = 2sinC :
sina A cosa B (cid:12)g h i(cid:12) e f d f d e Heron’s formula:
tana= = ; cota= = :
cosa B sina A
aei+bfg+cdh p
Area, radius of inscribed circle: = −ceg−fha−ibd: A= s(cid:1)sa(cid:1)sb(cid:1)sc;
1AB; AB : Permanents: s= 12(a+b+c);
2 A+B+C XYn sa =s−a;
Identities:1 1 permA= (cid:25) i=1ai;(cid:25)(i): sb =s−b;
sinx= ; cosx= ; Hyperbolic Functions sc =s−c:
cscx secx
tanx= 1 ; sin2x+cos2x=1; De(cid:12)nitions: More iderntities:
cotx ex−e−x ex+e−x 1−cosx
sinhx = ; coshx= ; sinx = ;
1+tan2x=sec2x; 1+cot2x=csc2x; 2 2 2 2
ex−e−x 1 r
(cid:0) (cid:1)
tanhx= ; cschx = ; 1+cosx
sinx=cos (cid:25) −x ; sinx=sin((cid:25)−x); ex+e−x sinhx cosx = ;
2 (cid:0) (cid:1) 1 1 2 r 2
sechx = ; cothx= :
cosx=−cos((cid:25)−x); tanx=cot (cid:25) −x ; coshx tanhx 1−cosx
2 tanx = ;
Identities: 2 1+cosx
cotx=−cot((cid:25)−x); cscx=cotx2 −cotx; 1−cosx
cosh2x−sinh2x=1; tanh2x+sech2x=1; = ;
sinx
sin(x(cid:6)y)=sinxcosy(cid:6)cosxsiny;
sinx
coth2x−csch2x=1; sinh(−x)=−sinhx; = ;
cos(x(cid:6)y)=cosxcosy(cid:7)sinxsiny; r1+cosx
tan(x(cid:6)y)= 1ta(cid:7)ntxan(cid:6)xttaannyy; csionshh((x−+x)y=)=cossihnxh;xcoshy+tacnohs(h−xxs)in=h−y;tanhx; cotx2 = 11+−ccoossxx;
1+cosx
cotxcoty(cid:7)1 = ;
cot(x(cid:6)y)= ; cosh(x+y)=coshxcoshy+sinhxsinhy; sinx
cotx(cid:6)coty
sinx
2tanx sinh2x=2sinhxcoshx; = ;
sin2x=2sinxcosx; sin2x= ; 1−cosx
1+tan2x
cosh2x=cosh2x+sinh2x; eix−e−ix
cos2x=cos2x−sin2x; cos2x=2cos2x−1; sinx= ;
2i
cos2x=1−2sin2x; cos2x= 1−tan2x; coshx+sinhx=ex; coshx−sinhx=e−x; eix+e−ix
1+tan2x (coshx+sinhx)n =coshnx+sinhnx; n2Z; cosx= 2 ;
2tanx cot2x−1 eix−e−ix
tan2x= 1−tan2x; cot2x= 2cotx ; 2sinh2 x2 =coshx−1; 2cosh2 x2 =coshx+1: tanx=−ieix+e−ix;
sin(x+y)sin(x−y)=sin2x−sin2y; e2ix−1
=−i ;
(cid:18) sin(cid:18) cos(cid:18) tan(cid:18) :::inmathematics e2ix+1
cos(x+y)cos(x−y)=cos2x−sin2y: 0 0 1 0 you don’t under- sinhix
p p stand things, you sinx= ;
Euler’s equation: (cid:25) 1 3 3 i
eix =cosx+isinx; ei(cid:25) =−1: (cid:25)6 p22 p22 13 jtuhsetm.get used to cosx=coshix;
v2.02 (cid:13)c1994 by Steve Seiden (cid:25)4 p23 21 p3 { J. von Neumann tanx= tanhix:
sseiden@acm.org 3 2 2 i
(cid:25) 1 0 1
http://www.csc.lsu.edu/~seiden 2
Theoretical Computer Science Cheat Sheet
Number Theory Graph Theory
TheChineseremaindertheorem: Thereex- De(cid:12)nitions: 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 (cid:17)r modm
1 1 Directed Each edge has a direction. c(G) Number of components
.. .. .. Simple Graph with no loops or G[S] Induced subgraph
. . .
multi-edges. deg(v) Degree of v
C (cid:17)rn modmn (cid:1)(G) Maximum degree
Walk A sequence v0e1v1:::e‘v‘.
ifmi andmj arerelativelyprimefori6=j. Trail Awalkwithdistinctedges. (cid:14)(G) Minimum degree
(cid:31)(G) Chromatic number
Path A trail with distinct
Euler’s function: (cid:30)(x) is the number of
vertices. (cid:31)E(G) Edge chromatic number
pproismiteivetoixn.tegIferQs nlesspeithisanthexprreimlaetivfaelcy- Connected Agraphwherethereexists Gc Complement graph
torization of x thein=1 i a path between any two Kn Complete graph
Yn vertices. Kn1;n2 Complete bipartite graph
(cid:30)(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 Aconnectedacyclicgraph.
Projective coordinates: triples
prime then Free tree A tree with no root.
1(cid:17)a(cid:30)(b) modb: DAG Directed acyclic graph. (x;y;z), not all x, y and z zero.
(x;y;z)=(cx;cy;cz) 8c6=0:
Eulerian Graph with a trail visiting
Fermat’s theorem:
1(cid:17)ap−1 modp: each edge exactly once. Cartesian Projective
Hamiltonian Graphwithacyclevisiting (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(amodb;b): moval increases the num- Distance formula, Lp and L1
Q
If n pei is the prime factorization of x ber of components. metpric:
theni=1 i Cut-set A minimal cut. (x −x )2+(y −y )2;
S(x)=Xd=Yn piepi+i−1−11: Ck-uCtoendngeected AA sgizreap1hcucto.nnected with (cid:2)jx(cid:2)1−1x0jp0+jy1−1y0jp(cid:3)01=(cid:3)p;
djx i=1 the removal of any k − 1 lim jx −x jp+jy −y jp 1=p:
1 0 1 0
vertices. p!1
PerfectNumbers: xisanevenperfectnum-
beri(cid:11)x=2n−1(2n−1)and2n−1isprime. k-Tough 8S (cid:18) V;S 6= ; we have Area of triangle (x0;y0), (x1;y1)
Wilson’s theorem: n is a prime i(cid:11) k(cid:1)c(G−S)(cid:20)jSj. and (x2;y(cid:12)2): (cid:12)
(n−1)!(cid:17)−1modn: k-Regular Ahavgeradpehgrweehekr.e all vertices 12abs(cid:12)(cid:12)(cid:12)xx1−−xx0 yy1−−yy0(cid:12)(cid:12)(cid:12):
2 0 2 0
M¨obius 8inversion:
><1 if i=1. k-Factor A k-regular spanning Angle formed by three points:
subgraph.
0 if i is not square-free.
(cid:22)(i)=
>:(−1)r if i is the product of Matching A set of edges, no two of (x2;y2)
r distinct primes. which are adjacent.
‘
Clique A set of vertices, all of 2
If X (cid:18)
which are adjacent.
G(a)= F(d); (0;0) ‘ (x ;y )
Ind. set A set of vertices, none of 1 1 1
dja which are adjacent. cos(cid:18) = (x1;y1)(cid:1)(x2;y2):
then X (cid:16)a(cid:17) Vertex cover A set of vertices which ‘1‘2
F(a)= (cid:22)(d)G : cover all edges. Line through two points (x ;y )
d 0 0
dja Planar graph A graph which can be em- and (x1;(cid:12)y1): (cid:12)
(cid:12) (cid:12)
Prime numbers: beded in the plane. (cid:12) x y 1(cid:12)
pn =nlnn+nlnlnn−n+nlnlnn Plane graph An embedding of a planar (cid:12)(cid:12)(cid:12)x0 y0 1(cid:12)(cid:12)(cid:12)=0:
(cid:18) (cid:19) lnn graph. x1 y1 1
n X Area of circle, volume of sphere:
+O ;
deg(v)=2m:
lnn A=(cid:25)r2; V = 4(cid:25)r3:
v2V 3
n n 2!n
(cid:25)(n)= + + If G is planar then n−m+f =2, so
lnn (lnn)2 (lnn)3 IfIhaveseenfartherthanothers,
(cid:18) (cid:19) f (cid:20)2n−4; m(cid:20)3n−6:
n it is because I have stood on the
+O : Any planar graph has a vertex with de- shoulders of giants.
(lnn)4
gree (cid:20)5. { Issac Newton
Theoretical Computer Science Cheat Sheet
(cid:25) Calculus
Wallis’ identity: Derivatives:
2(cid:1)2(cid:1)4(cid:1)4(cid:1)6(cid:1)6(cid:1)(cid:1)(cid:1)
(cid:25) =2(cid:1) d(cu) du d(u+v) du dv d(uv) dv du
1(cid:1)3(cid:1)3(cid:1)5(cid:1)5(cid:1)7(cid:1)(cid:1)(cid:1) 1. =c ; 2. = + ; 3. =u +v ;
dx dx dx dx dx dx dx dx
(cid:0) (cid:1) (cid:0) (cid:1)
Brouncker’scontinuedfractionexpansion:
(cid:25) 12 4. d(un) =nun−1du; 5. d(u=v) = v ddux −u ddxv ; 6. d(ecu) =cecudu;
4 =1+ 2+ 32 dx dx dx v2 dx dx
2+2+522+72(cid:1)(cid:1)(cid:1) 7. d(cu) =(lnc)cudu; 8. d(lnu) = 1du;
dx dx dx udx
Gregrory’s series:
(cid:25)4 =1− 13 + 15 − 17 + 19 −(cid:1)(cid:1)(cid:1) 9. d(sinu) =cosudu; 10. d(cosu) =−sinudu;
dx dx dx dx
Newton’s series:
d(tanu) du d(cotu) du
(cid:25) = 1 + 1 + 1(cid:1)3 +(cid:1)(cid:1)(cid:1) 11. dx =sec2udx; 12. dx =csc2udx;
6 2 2(cid:1)3(cid:1)23 2(cid:1)4(cid:1)5(cid:1)25
d(secu) du d(cscu) du
13. =tanu secu ; 14. =−cotu cscu ;
Sharp’s series: dx dx dx dx
(cid:25) = p1 (cid:16)1− 1 + 1 − 1 +(cid:1)(cid:1)(cid:1)(cid:17) 15. d(arcsinu) = p 1 du; 16. d(arccosu) = p −1 du;
6 3 31(cid:1)3 32(cid:1)5 33(cid:1)7 dx 1−u2dx dx 1−u2dx
d(arctanu) 1 du d(arccotu) −1 du
Euler’s series: 17. = ; 18. = ;
dx 1+u2dx dx 1+u2dx
(cid:25)62 = 112 + 212 + 312 + 412 + 512 +(cid:1)(cid:1)(cid:1) 19. d(arcsecu) = p 1 du; 20. d(arccscu) = p−1 du;
(cid:25)2 = 1 + 1 + 1 + 1 + 1 +(cid:1)(cid:1)(cid:1) dx u 1−u2dx dx u 1−u2dx
8 12 32 52 72 92
(cid:25)122 = 112 − 212 + 312 − 412 + 512 −(cid:1)(cid:1)(cid:1) 21. d(sinhu) =coshudu; 22. d(coshu) =sinhudu;
dx dx dx dx
Partial Fractions d(tanhu) du d(cothu) du
23. =sech2u ; 24. =−csch2u ;
Let N(x) and D(x) be polynomial func- dx dx dx dx
tions of x. We can break down
d(sechu) du d(cschu) du
N(x)=D(x) using partial fraction expan- 25. =−sechu tanhu ; 26. =−cschu cothu ;
dx dx dx dx
sion. First, if the degree of N is greater
d(arcsinhu) 1 du d(arccoshu) 1 du
than or equal to the degree of D, divide 27. = p ; 28. = p ;
N by D, obtaining dx 1+u2dx dx u2−1dx
N(x) N0(x) d(arctanhu) 1 du d(arccothu) 1 du
=Q(x)+ ; 29. = ; 30. = ;
D(x) D(x) dx 1−u2dx dx u2−1dx
wherethedegreeofN0 islessthanthatof d(arcsechu) −1 du d(arccschu) −1 du
31. = p ; 32. = p :
D. Second, factor D(x). Use the follow- dx u 1−u2dx dx juj 1+u2dx
ing rules: For a non-repeated factor:
Integrals:
N(x) A N0(x) Z Z Z Z Z
= + ;
(x−a)D(x) x−a D(x) 1. cudx=c udx; 2. (u+v)dx= udx+ vdx;
where (cid:20) (cid:21) Z Z Z
A= N(x) : 3. xndx= 1 xn+1; n6=−1; 4. 1dx=lnx; 5. exdx=ex;
D(x) n+1 x
x=a Z Z Z
dx dv du
For a repeated factor: 6. =arctanx; 7. u dx=uv− v dx;
N(x) mX−1 Ak N0(x) Z 1+x2 dx Z dx
= + ;
(x−a)mD(x) k=0 (x−a)m−k D(x) 8. sinxdx=−cosx; 9. cosxdx=sinx;
Z Z
where (cid:20) (cid:18) (cid:19)(cid:21)
1 dk N(x) 10. tanxdx=−lnjcosxj; 11. cotxdx=lnjcosxj;
Ak = k! dxk D(x) x=a: Z Z
12. secxdx=lnjsecx+tanxj; 13. cscxdx=lnjcscx+cotxj;
Thereasonablemanadaptshimselftothe
Z
world; the unreasonable persists in trying p
to adapt the world to himself. Therefore 14. arcsinxdx=arcsinx + a2−x2; a>0;
a a
all progress dependson the unreasonable.
{ George Bernard Shaw
Theoretical Computer Science Cheat Sheet
Calculus Cont.
Z Z
p
15. arccosxdx=arccosx − a2−x2; a>0; 16. arctanxdx=xarctanx − aln(a2+x2); a>0;
a a a a 2
Z Z
(cid:0) (cid:1) (cid:0) (cid:1)
17. sin2(ax)dx= 1 ax−sin(ax)cos(ax) ; 18. cos2(ax)dx= 1 ax+sin(ax)cos(ax) ;
2a 2a
Z Z
19. sec2xdx=tanx; 20. csc2xdx=−cotx;
Z Z Z Z
sinn−1xcosx n−1 cosn−1xsinx n−1
21. sinnxdx=− + sinn−2xdx; 22. cosnxdx= + cosn−2xdx;
n n n n
Z Z Z Z
tann−1x cotn−1x
23. tannxdx= − tann−2xdx; n6=1; 24. cotnxdx=− − cotn−2xdx; n6=1;
n−1 n−1
Z Z
tanxsecn−1x n−2
25. secnxdx= + secn−2xdx; n6=1;
n−1 n−1
Z Z Z Z
cotxcscn−1x n−2
26. cscnxdx=− + cscn−2xdx; n6=1; 27. sinhxdx=coshx; 28. coshxdx=sinhx;
n−1 n−1
Z Z Z Z
(cid:12) (cid:12)
29. tanhxdx=lnjcoshxj; 30. cothxdx=lnjsinhxj; 31. sechxdx=arctansinhx; 32. cschxdx=ln(cid:12)tanhx(cid:12);
2
Z Z Z
33. sinh2xdx= 1sinh(2x)− 1x; 34. cosh2xdx= 1sinh(2x)+ 1x; 35. sech2xdx=tanhx;
4 2 4 2
Z Z
p
36. arcsinhxdx=xarcsinhx − x2+a2; a>0; 37. arctanhxdx=xarctanhx + alnja2−x2j;
a a a a 2
8 p
Z <xarccoshx − x2+a2; if arccoshx >0 and a>0,
38. arccoshxdx= a p a
a : x
xarccosh + x2+a2; if arccoshx <0 and a>0,
a a
Z (cid:16) p (cid:17)
dx
39. p =ln x+ a2+x2 ; a>0;
a2+x2
Z Z
p p
40. dx = 1 arctanx; a>0; 41. a2−x2dx= x a2−x2+ a2 arcsinx; a>0;
a2+x2 a a 2 2 a
Z
p
42. (a2−x2)3=2dx= x(5a2−2x2) a2−x2+ 3a4 arcsinx; a>0;
8 8 a
Z Z (cid:12) (cid:12) Z
(cid:12) (cid:12)
43. pa2dx−x2 =arcsinxa; a>0; 44. a2d−xx2 = 21aln(cid:12)(cid:12)aa−+xx(cid:12)(cid:12); 45. (a2−dxx2)3=2 = a2pax2−x2;
Z p p (cid:12) p (cid:12) Z (cid:12) p (cid:12)
46. a2(cid:6)x2dx= x a2(cid:6)x2(cid:6) a2 ln(cid:12)(cid:12)x+ a2(cid:6)x2(cid:12)(cid:12); 47. p dx =ln(cid:12)(cid:12)x+ x2−a2(cid:12)(cid:12); a>0;
2 2 x2−a2
Z (cid:12) (cid:12) Z
48. dx = 1ln(cid:12)(cid:12)(cid:12) x (cid:12)(cid:12)(cid:12); 49. xpa+bxdx= 2(3bx−2a)(a+bx)3=2;
ax2+bx a a+bx 15b2
Z p Z Z (cid:12)p p (cid:12)
50. a+bxdx=2pa+bx+a p 1 dx; 51. p x dx= p1 ln(cid:12)(cid:12)(cid:12)pa+bx−pa(cid:12)(cid:12)(cid:12); a>0;
Z p x p x(cid:12)(cid:12) a+pbx (cid:12)(cid:12) a+bx Z p2 a+bx+ a
a2−x2 (cid:12)a+ a2−x2(cid:12)
52. dx= a2−x2−aln(cid:12) (cid:12); 53. x a2−x2dx=−1(a2−x2)3=2;
x (cid:12) x (cid:12) 3
Z p p Z (cid:12)(cid:12) p (cid:12)(cid:12)
54. x2 a2−x2dx= x(2x2−a2) a2−x2+ a4 arcsinx; a>0; 55. p dx =−1 ln(cid:12)(cid:12)a+ a2−x2(cid:12)(cid:12);
8 8 a a2−x2 a (cid:12) x (cid:12)
Z Z
p p
56. pxdx =− a2−x2; 57. px2dx =−x a2−x2+ a2 arcsin x a>0;
Z pa2−x2 p (cid:12)(cid:12) p (cid:12)(cid:12) Z pa2−x2 2p 2 a;
a2+x2 (cid:12)a+ a2+x2(cid:12) x2−a2
58. dx= a2+x2−aln(cid:12) (cid:12); 59. dx= x2−a2−aarccos a ; a>0;
x (cid:12) x (cid:12) x jxj
Z Z (cid:12) (cid:12)
p (cid:12) (cid:12)
60. x x2(cid:6)a2dx= 13(x2(cid:6)a2)3=2; 61. xpxd2x+a2 = a1 ln(cid:12)(cid:12)a+pax2+x2(cid:12)(cid:12);
Theoretical Computer Science Cheat Sheet
Calculus Cont. Finite Calculus
Z Z p
dx dx x2(cid:6)a2 Di(cid:11)erence, shift operators:
62. p = 1 arccos a ; a>0; 63. p =(cid:7) ;
x x2−a2 a jxj x2 x2(cid:6)a2 a2x (cid:1)f(x)=f(x+1)−f(x);
Z Z p
xdx p x2(cid:6)a2 (x2+a2)3=2 Ef(x)=f(x+1):
64. p = x2(cid:6)a2; 65. dx=(cid:7) ;
x2(cid:6)a2 8 (cid:12) p x4 (cid:12) 3a2x3 Fundamental TheoXrem:
(cid:12) (cid:12)
Z >>><p 1 ln(cid:12)(cid:12)2ax+b−pb2−4ac(cid:12)(cid:12); if b2 >4ac, f(x)=(cid:1)F(x), f(x)(cid:14)x=F(x)+C:
66. dx = b2−4ac (cid:12)2ax+b+ b2−4ac(cid:12) Xb Xb−1
ax2+bx+c >>>:p 2 arctanp2ax+b ; if b2 <4ac, f(x)(cid:14)x= f(i):
4ac−b2 4ac−b2 a i=a
Di(cid:11)erences:
Z 8>><p1 ln(cid:12)(cid:12)(cid:12)2ax+b+2papax2+bx+c(cid:12)(cid:12)(cid:12); if a>0, (cid:1)(cu)=c(cid:1)u; (cid:1)(u+v)=(cid:1)u+(cid:1)v;
dx a
67. p = (cid:1)(uv)=u(cid:1)v+Ev(cid:1)u;
ax2+bx+c >>:p1 arcsinp−2ax−b ; if a<0, (cid:1)(xn)=nxn−1;
−a b2−4ac
Z p 2ax+bp 4ax−b2 Z dx (cid:1)(Hx)=x−1; (cid:0)(cid:1)(cid:1)(2x)(cid:0)=2x(cid:1);
68. ax2+bx+cdx= ax2+bx+c+ p ; (cid:1)(cx)=(c−1)cx; (cid:1) x = x :
4a 8a ax2+bx+c m m−1
Sums:
Z p Z P P
xdx ax2+bx+c b dx cu(cid:14)x=c u(cid:14)x;
69. p = − p ;
ax2+bx+c a 2a ax2+bx+c P P P
(u+v)(cid:14)x= u(cid:14)x+ v(cid:14)x;
8 (cid:12)(cid:12) p p (cid:12)(cid:12) P P
Z >>><−p1ln(cid:12)(cid:12)2 c ax2+bx+c+bx+2c(cid:12)(cid:12); if c>0, u(cid:1)v(cid:14)x=uv− Ev(cid:1)u(cid:14)x;
dx c (cid:12) x (cid:12) P P
70. Z xpax2+bx+c =>>>:p1−carcsinjxjpbxb2+−2c4ac; if c<0, Pcxxn(cid:14)(cid:14)xx==cxmc−nx+1+;11; P(cid:0)mx(cid:1)x(cid:14)−x1(cid:14)=x(cid:0)=mx+H1x(cid:1);:
p Falling Factorial Powers:
71. x3 x2+a2dx=(13x2− 125a2)(x2+a2)3=2; xn =x(x−1)(cid:1)(cid:1)(cid:1)(x−n+1); n>0;
Z Z
x0 =1;
72. xnsin(ax)dx=−1xncos(ax)+ n xn−1cos(ax)dx;
a a 1
n
Z Z x = ; n<0;
(x+1)(cid:1)(cid:1)(cid:1)(x+jnj)
73. xncos(ax)dx= a1xnsin(ax)− na xn−1sin(ax)dx; xn+m =xm(x−m)n:
Z Z
xneax Rising Factorial Powers:
74. xneaxdx= − n xn−1eaxdx;
a a xn =x(x+1)(cid:1)(cid:1)(cid:1)(x+n−1); n>0;
Z (cid:18) (cid:19)
75. xnln(ax)dx=xn+1 ln(ax) − 1 ; x0 =1;
n+1 (n+1)2 1
Z Z xn = ; n<0;
76. xn(lnax)mdx= xn+1(lnax)m− m xn(lnax)m−1dx: (x−1)(cid:1)(cid:1)(cid:1)(x−jnj)
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 = x4+6x3+7x2+x1 = x4−6x3+7x2−x1 =1=(x−1)−n;
(cid:26) (cid:27) (cid:26) (cid:27)
x5 = x5+15x4+25x3+10x2+x1 = x5−15x4+25x3−10x2+x1 Xn n Xn n
xn = xk = (−1)n−kxk;
k k
x1 = x1 x1 = x1 k=1(cid:20) (cid:21) k=1
Xn
x2 = x2+x1 x2 = x2−x1 xn = n (−1)n−kxk;
x3 = x3+3x2+2x1 x3 = x3−3x2+2x1 k=1(cid:20)k(cid:21)
x4 = x4+6x3+11x2+6x1 x4 = x4−6x3+11x2−6x1 Xn n
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 X1 (x−a)i X1
f(x)=f(a)+(x−a)f0(a)+ 2 f00(a)+(cid:1)(cid:1)(cid:1)= i! f(i)(a): A(x)= aixi:
Expansions: i=0 i=0
X1 Exponential power series:
1
1−x =1+x+x2+x3+x4+(cid:1)(cid:1)(cid:1) = xi; X1 xi
i=0 A(x)= ai :
X1 i!
1 =1+cx+c2x2+c3x3+(cid:1)(cid:1)(cid:1) = cixi; i=0
1−cx Dirichlet power series:
i=0 X1
1 X1 ai
1−xn =1+xn+x2n+x3n+(cid:1)(cid:1)(cid:1) = i=0xni; A(x)= i=1 ix:
X1 Binomial theorem:
x =x+2x2+3x3+4x4+(cid:1)(cid:1)(cid:1) = ixi; Xn (cid:18) (cid:19)
(1−x)2 n n n−k k
(cid:18) (cid:19) i=0 (x+y) = x y :
xk dn 1 =x+2nx2+3nx3+4nx4+(cid:1)(cid:1)(cid:1) =X1 inxi; k=0 k
dxn 1−x Di(cid:11)erence of like powers:
ex =1+x+ 1x2+ 1x3+(cid:1)(cid:1)(cid:1) =Xi1=0 xi; xn−yn =(x−y)nX−1xn−1−kyk:
2 6 i!
i=0 k=0
X1 xi For ordinary power series:
ln(1+x) =x− 1x2+ 1x3− 1x4−(cid:1)(cid:1)(cid:1) = (−1)i+1 ; X1
2 3 4 i
i=1 (cid:11)A(x)+(cid:12)B(x)= ((cid:11)ai+(cid:12)bi)xi;
ln 1 =x+ 1x2+ 1x3+ 1x4+(cid:1)(cid:1)(cid:1) =X1 xi; i=0
1−x 2 3 4 i X1
Xi1=1 x2i+1 xkA(x)= ai−kxi;
sinx =x− 1x3+ 1x5− 1x7+(cid:1)(cid:1)(cid:1) = (−1)i ; i=k
cosx =1− 231!!x2+ 451!!x4− 671!!x6+(cid:1)(cid:1)(cid:1) =Xi1=0(−1)i((x222ii)i+!;1)! A(x)−Pxkki=−01aixXi1=Xi1=0ai+kxi;
i=0
X1 x2i+1 A(cx)= ciaixi;
tan−1x =x− 13x3+ 15x5− 17x7+(cid:1)(cid:1)(cid:1) = (−1)i(2i+1); i=0
i=0(cid:18) (cid:19) X1
X1 0 i
(1+x)n =1+nx+ n(n−1)x2+(cid:1)(cid:1)(cid:1) = n xi; A(x)= (i+1)ai+1x ;
2 i i=0
i=0(cid:18) (cid:19) X1
(cid:0) (cid:1) X1
1 =1+(n+1)x+ n+2 x2+(cid:1)(cid:1)(cid:1) = i+n xi; xA0(x)= iaixi;
(1−x)n+1 2 i=0 i Z i=1
x =1− 1x+ 1 x2− 1 x4+(cid:1)(cid:1)(cid:1) =X1 Bixi; A(x)dx=X1 ai−1xi;
ex−1 2 12 720 i! i
i=0 (cid:18) (cid:19) i=1
21x(1−p1−4x) =1+x+2x2+5x3+(cid:1)(cid:1)(cid:1) =X1 i+11 2ii xi; A(x)+2A(−x) =X1 a2ix2i;
Xi1=0(cid:18) (cid:19) i=0
p(cid:18)1−1 4px (cid:19) =1+x+2x2+6x3+(cid:1)(cid:1)(cid:1) = i=0(cid:18)2ii xi;(cid:19) A(x)−2A(−x) =X1 a2i+1x2i+1:
1 1− 1−4x n (cid:0) (cid:1) X1 2i+n i=P0
p1−4x 2x =1+(2+n)x+ 4+2n x2+(cid:1)(cid:1)(cid:1) = i xi; Summation: If bi = ij=0ai then
Xi1=0 1
1 1 B(x)= A(x):
1−xln1−x =x+ 32x2+ 161x3+ 2152x4+(cid:1)(cid:1)(cid:1) = Hixi; 1−x
(cid:18) (cid:19) i=1 Convolution: 0 1
12 ln1−1 x 2 = 12x2+ 34x3+ 1214x4+(cid:1)(cid:1)(cid:1) =X1 Hi−i1xi; A(x)B(x)=X1 @Xi ajbi−jAxi:
i=2
X1 i=0 j=0
x
1−x−x2 =x+x2+2x3+3x4+(cid:1)(cid:1)(cid:1) = Fixi;
i=0 God made the natural numbers;
X1
1−(Fn−1+FFnn+x1)x−(−1)nx2 =Fnx+F2nx2+F3nx3+(cid:1)(cid:1)(cid:1) = i=0Fnixi: a{llLtehoeporledstKisrotnheeckweorrk of man.
Theoretical Computer Science Cheat Sheet
Series Escher’s Knot
Expansions:
(cid:18) (cid:19) (cid:18) (cid:19) (cid:26) (cid:27)
X1 −n X1
1 1 n+i 1 i
(1−x)n+1 ln1−x = (Hn+i−Hn) i xi; x = n xi;
i=0(cid:20) (cid:21) i=0(cid:26) (cid:27)
X1 n X1 i n!xi
xn = xi; (ex−1)n = ;
i n i!
(cid:18) (cid:19) i=0(cid:20) (cid:21) i=0
ln 1 n =X1 i n!xi; xcotx =X1 (−4)iB2ix2i;
1−x n i! (2i)!
i=0 i=0
tanx =X1 (−1)i−122i(22i−1)B2ix2i−1; (cid:16)(x) =X1 1;
(2i)! ix
i=1 i=1
1 X1 (cid:22)(i) (cid:16)(x−1) X1 (cid:30)(i)
= ; = ;
(cid:16)(x) ix (cid:16)(x) ix
Yi=1 i=1
1
(cid:16)(x) = 1−p−x; Stieltjes Integration
p
If G is continuous in the interval [a;b] and F is nondecreasing then
(cid:16)2(x) =X1 d(i) where d(n)=P 1; Z b
xi djn G(x)dF(x)
i=1 a
X1 S(i) P exists. If a(cid:20)b(cid:20)c then
(cid:16)(x)(cid:16)(x−1) = where S(n)= d; Z Z Z
xi djn c b c
i=1 G(x)dF(x)= G(x)dF(x)+ G(x)dF(x):
(cid:16)(2n) = 22n−1jB2nj(cid:25)2n; n2N; If the integarals involved exisat b
(2n)! Z Z Z
b(cid:0) (cid:1) b b
x =X1 (−1)i−1(4i−2)B2ix2i; G(x)+H(x) dF(x)= G(x)dF(x)+ H(x)dF(x);
sinx (2i)! Za Za Za
(cid:18) p (cid:19) i=0 b (cid:0) (cid:1) b b
1− 1−4x n X1 n(2i+n−1)! G(x)d F(x)+H(x) = G(x)dF(x)+ G(x)dH(x);
i
= x ; a a a
2x i!(n+i)! Z b Z b (cid:0) (cid:1) Z b
i=0
X1 2i=2sini(cid:25) c(cid:1)G(x)dF(x)= G(x)d c(cid:1)F(x) =c G(x)dF(x);
exsinx = 4 xi; Za a Z a
i! b b
s i=1 G(x)dF(x)=G(b)F(b)−G(a)F(a)− F(x)dG(x):
p
1− 1−x =X1 p (4i)! xi; Iftheinategralsinvolvedexist,andF possessesadearivativeF0 atevery
(cid:18) x (cid:19) i=0 16i 2(2i)!(2i+1)! point in [a;b] theZn Z
arcsinx 2 X1 4ii!2 b b
= x2i: G(x)dF(x)= G(x)F0(x)dx:
x i=0 (i+1)(2i+1)! a a
Cramer’s Rule Fibonacci Numbers
00 47 18 76 29 93 85 34 61 52
If we have equations:
a1;1x1+a1;2x2+(cid:1)(cid:1)(cid:1)+a1;nxn =b1 8965 1810 5272 2687 7308 3791 9449 4556 0123 6034 1;1;2;3;5;8;13;21;34;55;89;:::
a2;1x1+a2;2x2+(cid:1)(cid:1)(cid:1)+a2;nxn =b2 59 96 81 33 07 48 72 60 24 15 De(cid:12)nitions:
. . . 73 69 90 82 44 17 58 01 35 26 Fi =Fi−1+Fi−2; F0 =F1 =1;
. . .
. . . 68 74 09 91 83 55 27 12 46 30 F−i =(−(cid:16)1)i−1Fi(cid:17);
an;1x1+an;2x2+(cid:1)(cid:1)(cid:1)+an;nxn =bn 37 08 75 19 92 84 66 23 50 41 Fi = p1 (cid:30)i−(cid:30)^i ;
14 25 36 40 51 62 03 77 88 99 5
LetA=(ai;j)andB bethecolumnmatrix(bi). Then
wthiethreciosluamunniiqureepslaocluedtiobnyiB(cid:11).dTethAen6= 0. Let Ai be A 2412 3523 4634 5045 6156 0260 1301 8998 9779 7887 CasFsiin+i1’sFii−de1n−titFyi2: =for(−i>1)i0::
detAi Additive rule:
xi = : TheFibonaccinumbersystem:
detA Every integer n has a unique Fn+k =FkFn+1+Fk−1Fn;
representation F2n =FnFn+1+Fn−1Fn:
Improvement makes strait roads, but the crooked n=Fk1 +Fk2 +(cid:1)(cid:1)(cid:1)+Fkm; C(cid:18)alculation by(cid:19)matr(cid:18)ices: (cid:19)
r{oWadisllwiaimthoBulatkIem(pTrhoveeMmaenrrti,aagreeorfoHadesavoefnGaenndiuHs.ell) w1h(cid:20)erie<kim(cid:21)ankdi+k1m+(cid:21)22f.or all i, FFnn−−21 FFn−n1 = 01 11 n: