# cheat - Theoretical Computer Science Cheat Sheet...

This preview shows pages 1–3. Sign up to view the full content.

Theoretical Computer Science Cheat Sheet Definitions Series f ( n ) = O ( g ( n )) iff positive c, n 0 such that 0 f ( n ) cg ( n ) n n 0 . n X i =1 i = n ( n + 1) 2 , n X i =1 i 2 = n ( n + 1)(2 n + 1) 6 , n X i =1 i 3 = n 2 ( n + 1) 2 4 . In general: n X i =1 i m = 1 m + 1 ( n + 1) m +1 - 1 - n X i =1 ( ( i + 1) m +1 - i m +1 - ( m + 1) i m ) n - 1 X i =1 i m = 1 m + 1 m X k =0 m + 1 k B k n m +1 - k . Geometric series: n X i =0 c i = c n +1 - 1 c - 1 , c 6 = 1 , X i =0 c i = 1 1 - c , X i =1 c i = c 1 - c , | c | < 1 , n X i =0 ic i = nc n +2 - ( n + 1) c n +1 + c ( c - 1) 2 , c 6 = 1 , X i =0 ic i = c (1 - c ) 2 , | c | < 1 . Harmonic series: H n = n X i =1 1 i , n X i =1 iH i = n ( n + 1) 2 H n - n ( n - 1) 4 . n X i =1 H i = ( n + 1) H n - n, n X i =1 i m H i = n + 1 m + 1 H n +1 - 1 m + 1 . f ( n ) = Ω( g ( n )) iff positive c, n 0 such that f ( n ) cg ( n ) 0 n n 0 . f ( n ) = Θ( g ( n )) iff f ( n ) = O ( g ( n )) and f ( n ) = Ω( g ( n )). f ( n ) = o ( g ( n )) iff lim n →∞ f ( n ) /g ( n ) = 0. lim n →∞ a n = a iff > 0, n 0 such that | a n - a | < , n n 0 . sup S least b R such that b s , s S . inf S greatest b R such that b s , s S . lim inf n →∞ a n lim n →∞ inf { a i | i n, i N } . lim sup n →∞ a n lim n →∞ sup { a i | i n, i N } . ( n k ) Combinations: Size k sub- sets of a size n set. n k Stirling numbers (1st kind): Arrangements of an n ele- ment set into k cycles. 1. n k = n ! ( n - k )! k ! , 2. n X k =0 n k = 2 n , 3. n k = n n - k , 4. n k = n k n - 1 k - 1 , 5. n k = n - 1 k + n - 1 k - 1 , 6. n m m k = n k n - k m - k , 7. n X k =0 r + k k = r + n + 1 n , 8. n X k =0 k m = n + 1 m + 1 , 9. n X k =0 r k s n - k = r + s n , 10. n k = ( - 1) k k - n - 1 k , 11. n 1 = n n = 1 , 12. n 2 = 2 n - 1 - 1 , 13. n k = k n - 1 k + n - 1 k - 1 , n k Stirling numbers (2nd kind): Partitions of an n element set into k non-empty sets. n k 1st order Eulerian numbers: Permutations π 1 π 2 . . . π n on { 1 , 2 , . . . , n } with k ascents. n k 2nd order Eulerian numbers. C n Catalan Numbers: Binary trees with n + 1 vertices. 14. n 1 = ( n - 1)! , 15. n 2 = ( n - 1)! H n - 1 , 16. n n = 1 , 17. n k n k , 18. n k = ( n - 1) n - 1 k + n - 1 k - 1 , 19. n n - 1 = n n - 1 = n 2 , 20. n X k =0 n k = n ! , 21. C n = 1 n + 1 2 n n , 22. n 0 = n n - 1 = 1 , 23. n k = n n - 1 - k , 24. n k = ( k + 1) n - 1 k + ( n - k ) n - 1 k - 1 , 25. 0 k = n 1 if k = 0, 0 otherwise 26. n 1 = 2 n - n - 1 , 27. n 2 = 3 n - ( n + 1)2 n + n + 1 2 , 28. x n = n X k =0 n k x + k n , 29. n m = m X k =0 n + 1 k ( m + 1 - k ) n ( - 1) k , 30. m ! n m = n X k =0 n k k n - m , 31. n m = n X k =0 n k n - k m ( - 1) n - k - m k ! , 32. n 0 = 1 , 33. n n = 0 for n 6 = 0 , 34. n k = ( k + 1) n - 1 k + (2 n - 1 - k ) n - 1 k - 1 , 35. n X k =0 n k = (2 n ) n 2 n , 36. x x - n = n X k =0 n k x + n - 1 - k 2 n , 37. n + 1 m + 1 = X k n k k m = n X k =0 k m ( m + 1) n - k ,

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Theoretical Computer Science Cheat Sheet Identities Cont. Trees 38. n + 1 m + 1 = X k n k k m = n X k =0 k m n n - k = n ! n X k =0 1 k ! k m , 39. x x - n = n X k =0 n k x + k 2 n , 40. n m = X k n k k + 1 m + 1 ( - 1) n - k , 41. n m = X k n + 1 k + 1 k m ( - 1) m - k , 42. m + n + 1 m = m X k =0 k n + k k , 43. m + n + 1 m = m X k =0 k ( n + k ) n + k k , 44. n m = X k n + 1 k + 1 k m ( - 1) m - k , 45. ( n - m )! n m = X k n + 1 k + 1 k m ( - 1) m - k , for n m , 46. n n - m = X k m - n m + k m + n n + k m + k k , 47. n n - m = X k m - n m + k m + n n + k m + k k , 48. n + m + m = X k k n - k m n k , 49. n + m + m = X k k n - k m n k . Every tree with n vertices has n - 1 edges. Kraft inequal- ity: If the depths of the leaves of a binary tree are d 1 , . . . , d n : n X i =1 2 - d i 1 , and equality holds only if every in- ternal node has 2 sons.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern