0% found this document useful (0 votes)
99 views

Cheat 1

This document provides definitions and formulas related to theoretical computer science concepts: 1. It defines big O, Omega, and Theta notation for describing the asymptotic behavior of functions. 2. It presents common series such as harmonic, geometric, and binomial series along with their formulas. 3. It also covers limits, permutations, combinations, and other counting methods with their corresponding equations.

Uploaded by

Tom Li
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
99 views

Cheat 1

This document provides definitions and formulas related to theoretical computer science concepts: 1. It defines big O, Omega, and Theta notation for describing the asymptotic behavior of functions. 2. It presents common series such as harmonic, geometric, and binomial series along with their formulas. 3. It also covers limits, permutations, combinations, and other counting methods with their corresponding equations.

Uploaded by

Tom Li
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Theoretical Computer Science Cheat Sheet

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

You might also like