Concepts5
βMathIntermediate
Probability Fundamentals
Probability quantifies uncertainty by assigning numbers between 0 and 1 to events in a sample space.
#probability#sample space#conditional probability+12
βMathAdvanced
MΓΆbius Function and Inversion
The MΓΆbius function ΞΌ(n) is 0 if n has a squared prime factor, otherwise it is (-1)^k where k is the number of distinct prime factors.
#mobius function#mobius inversion#dirichlet convolution+12
βοΈAlgorithmAdvanced
Sum over Subsets (SOS) DP
Sum over Subsets (SOS) DP lets you compute F[mask] = sum of A[submask] over all submasks in O(n 2^n) instead of O(3^n).
#sos dp#subset zeta transform#mobius inversion+11
βοΈAlgorithmIntermediate
Prefix Sum and Difference Array
Prefix sums precompute running totals so any range sum [l, r] can be answered in O(1) time as prefix[r] - prefix[l-1].
#prefix sum#difference array#imos method+12
ποΈData StructureIntermediate
2D Fenwick Tree
A 2D Fenwick Tree (Binary Indexed Tree) supports point updates and rectangle sum queries in O(log n Γ log m) time.
#2d fenwick tree#binary indexed tree 2d#bit 2d+12