Concepts141

βš™οΈAlgorithmAdvanced

DP on Broken Profile - Plug DP

Plug DP (DP on broken profile with plugs) sweeps a grid cell by cell while remembering how partial path segments cross the frontier as labeled β€œplugs.”

#plug dp#broken profile#hamiltonian path+12
βš™οΈAlgorithmAdvanced

Matrix Exponentiation - Advanced

Matrix exponentiation turns repeated linear transitions into fast O(n^{3} log k) computation using exponentiation by squaring.

#matrix exponentiation#adjacency matrix#walk counting+12
πŸ—‚οΈData StructureAdvanced

Top Tree

Top trees are dynamic tree data structures that represent a forest as a hierarchy of clusters, allowing O(log n) amortized time for link, cut, path queries/updates, and many subtree queries.

#top tree#dynamic tree#link cut+12
βˆ‘MathIntermediate

Game Theory - Nim

Nim is a two-player impartial game with several piles where a move removes any positive number of stones from exactly one pile.

#nim#game theory#xor+11
βˆ‘MathIntermediate

Game Theory - Calculation Techniques

Sprague–Grundy theory converts any impartial, normal-play game into an equivalent Nim heap using a Grundy number.

#sprague-grundy#grundy numbers#nim-sum+12
βˆ‘MathIntermediate

Linearity of Expectation Applications

Linearity of expectation says the expected value of a sum equals the sum of expected values, even if the variables are dependent.

#linearity of expectation#indicator variables#expected inversions+12
βˆ‘MathIntermediate

Expected Value

Expected value is the long-run average outcome of a random variable if you could repeat the experiment many times.

#expected value#linearity of expectation#indicator variables+12
βˆ‘MathIntermediate

Bayes' Theorem

Bayes' Theorem tells you how to update the probability of a hypothesis after seeing new evidence.

#bayes' theorem#posterior probability#prior probability+11
βˆ‘MathAdvanced

Partition Function

The partition function p(n) counts the number of ways to write n as a sum of positive integers where order does not matter.

#partition function#integer partitions#euler pentagonal theorem+11
βˆ‘MathAdvanced

Generating Functions - OGF

An ordinary generating function (OGF) encodes a sequence (a_n) as a formal power series A(x) = \sum_{n \ge 0} a_n x^n.

#ordinary generating function#ogf#coefficient extraction+12
βˆ‘MathAdvanced

Stirling Numbers of First Kind

Stirling numbers of the first kind count permutations by their number of cycles and connect power polynomials to rising/falling factorials.

#stirling numbers of the first kind#unsigned cycle numbers#signed stirling numbers+12
βˆ‘MathIntermediate

Lucas' Theorem

Lucas' Theorem lets you compute C(n, k) modulo a prime p by working digit-by-digit in base p.

#lucas theorem#binomial coefficient modulo p#prime power modulus+12