Combinatorics & Probability๐
Permutation & Combinations๐
- Permutation (
nPr
) : Number of ways to arranger
objects out ofn
distinct objects, order matters.
- Combination (nCr) : Number of ways to choose
r
objects out ofn
distinct objects, order doesnโt matter
Pascalโs Triangle๐
- A triangular array where each number is sum of two directly above it
- The
nth
row corresponds to coefficient of - Properties
- Symmetry:
Binomial Theorem๐
- Expansion of
- Coefficient are binomial coefficient from Pascalโs Triangle
Stars & Bars๐
- Technique to find the number of solution to : ,
- Number of solution is :
- If , then number of solution is :
Inclusion - Exclusion Principle๐
- To find the size of the union of sets
Derangements๐
- Permutation where no element appears in its original position
- Number of derangements of n objects, denote as
Bell, Catalan, Stirling Numbers๐
- Bell Numbers : Number of ways to partition a set of n elements
- Catalan Number : Number of ways to correctly match parentheses, number of rooted binary trees, etc
- Stirling Numbers of the Second Kind: Number of ways to partition elements into non-empty subsets
Probabilities๐
Conditional Probability๐
Bayesโ Theorem๐
- Bayes theorem plays a central role in probability. It improves probability estimates based on evidence.
- Nice Video : Link
![]() |
Expected Value๐
- For discrete random Variable
Linearity of Expectation๐
- For any random variables :
- Holds even if are dependent
Radomized Techniques๐
Discussed in more detail in simulation section
- Monte Carlo Algorithms: Use randomness to get approximate solutions with some probability of error.
- Las Vegas Algorithms: Always give correct solutions but runtime is random.
Probabilistic DP & Sampling๐
- Use probability distributions to handle states in dynamic programming.
- Sampling methods (e.g., Markov Chain Monte Carlo) to estimate quantities when exact computation is hard.