Concepts13

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

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
MathAdvanced

Stirling Numbers of Second Kind

Stirling numbers of the second kind S(n,k) count how many ways to split n labeled items into k non-empty, unlabeled groups.

#stirling numbers of the second kind#set partitions#bell numbers+12
MathIntermediate

Derangements

A derangement is a permutation with no element left in its original position, often written as !n or D(n).

#derangement#subfactorial#inclusion-exclusion+11
MathIntermediate

Inclusion-Exclusion Principle

The Inclusion-Exclusion Principle (IEP) corrects overcounting by alternately adding and subtracting sizes of intersections of sets.

#inclusion-exclusion#derangements#surjections+12
MathIntermediate

Stars and Bars

Stars and Bars counts the ways to distribute n identical items into k distinct bins using combinations.

#stars and bars#combinatorics#binomial coefficient+12
MathAdvanced

Pollard's Rho Factorization

Pollard's Rho is a randomized algorithm that finds a non-trivial factor of a composite integer by walking a pseudorandom sequence modulo n and extracting a factor with a gcd.

#pollard's rho#integer factorization#cycle detection+10
MathIntermediate

Modular Arithmetic Basics

Modular arithmetic is arithmetic with wrap-around at a fixed modulus m, like numbers on a clock.

#modular arithmetic#mod#modulo c+++12
MathIntermediate

Modular Inverse

A modular inverse of a modulo m is a number a_inv such that a × a_inv ≡ 1 (mod m).

#modular inverse#extended euclidean algorithm#fermats little theorem+12
MathIntermediate

Fermat's Little Theorem

Fermat's Little Theorem says that for a prime p and integer a not divisible by p, a^{p-1} ≡ 1 (mod p).

#fermat's little theorem#modular inverse#binary exponentiation+11
MathIntermediate

Fast Exponentiation

Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.

#binary exponentiation#fast power#modular exponentiation+11
MathIntermediate

Chinese Remainder Theorem

The Chinese Remainder Theorem (CRT) reconstructs an integer from its remainders modulo pairwise coprime moduli and guarantees a unique answer modulo the product.

#chinese remainder theorem#crt#modular arithmetic+12