A Programmer's Intro to Integer Partitions and Compositions

2025-05-18
A Programmer's Intro to Integer Partitions and Compositions

LeetArxiv's new series, "What Every Programmer Needs to Know about Enumerative Combinatorics," starts with Chapter 1: an introduction to integer partitions and compositions. This article uses an accessible approach, guiding programmers through these concepts via observation and pattern recognition. C code is provided to generate weak compositions, efficiently enumerating them using binomial coefficients and binary search.

Development