Skip to content

Combinatorics & Probability๐Ÿ”—

Permutation & Combinations๐Ÿ”—

  • Permutation (nPr) : Number of ways to arrange r objects out of n distinct objects, order matters.

  • Combination (nCr) : Number of ways to choose r objects out of n 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
image-20250520101004237

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.