Show Menu
Cheatography

CT Midterms Cheat Sheet (DRAFT) by

ct midterms cheatsheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Counting

Permute = nPr = n! / (n - r)!
Combin­ations = nCr = n!/r!(n - r )!
Circular Permut­ation = n!/n (eg, 6 ppl around tables = 5!)
Inclus­ion­-Ex­clusion Principle: if there are cases when both things are done together, we need to subtract the number of ways to do both from the sum.
 

Complexity

Algori­thims:
- Precise: they must be written in terms unders­tan­dable by anyone
- Effective: a step must help the algorithm progress to the final goal
- Practical: a sequence of precise and effective steps may not be useful in practice