Skip to main content
\(\newcommand{\set}[1]{\{1,2,\dotsc,#1\,\}} \newcommand{\ints}{\mathbb{Z}} \newcommand{\posints}{\mathbb{N}} \newcommand{\rats}{\mathbb{Q}} \newcommand{\reals}{\mathbb{R}} \newcommand{\complexes}{\mathbb{C}} \newcommand{\twospace}{\mathbb{R}^2} \newcommand{\threepace}{\mathbb{R}^3} \newcommand{\dspace}{\mathbb{R}^d} \newcommand{\nni}{\mathbb{N}_0} \newcommand{\nonnegints}{\mathbb{N}_0} \newcommand{\dom}{\operatorname{dom}} \newcommand{\ran}{\operatorname{ran}} \newcommand{\prob}{\operatorname{prob}} \newcommand{\Prob}{\operatorname{Prob}} \newcommand{\height}{\operatorname{height}} \newcommand{\width}{\operatorname{width}} \newcommand{\length}{\operatorname{length}} \newcommand{\crit}{\operatorname{crit}} \newcommand{\inc}{\operatorname{inc}} \newcommand{\HP}{\mathbf{H_P}} \newcommand{\HCP}{\mathbf{H^c_P}} \newcommand{\GP}{\mathbf{G_P}} \newcommand{\GQ}{\mathbf{G_Q}} \newcommand{\AG}{\mathbf{A_G}} \newcommand{\GCP}{\mathbf{G^c_P}} \newcommand{\PXP}{\mathbf{P}=(X,P)} \newcommand{\QYQ}{\mathbf{Q}=(Y,Q)} \newcommand{\GVE}{\mathbf{G}=(V,E)} \newcommand{\HWF}{\mathbf{H}=(W,F)} \newcommand{\bfC}{\mathbf{C}} \newcommand{\bfG}{\mathbf{G}} \newcommand{\bfH}{\mathbf{H}} \newcommand{\bfF}{\mathbf{F}} \newcommand{\bfI}{\mathbf{I}} \newcommand{\bfK}{\mathbf{K}} \newcommand{\bfP}{\mathbf{P}} \newcommand{\bfQ}{\mathbf{Q}} \newcommand{\bfR}{\mathbf{R}} \newcommand{\bfS}{\mathbf{S}} \newcommand{\bfT}{\mathbf{T}} \newcommand{\bfNP}{\mathbf{NP}} \newcommand{\bftwo}{\mathbf{2}} \newcommand{\cgA}{\mathcal{A}} \newcommand{\cgB}{\mathcal{B}} \newcommand{\cgC}{\mathcal{C}} \newcommand{\cgD}{\mathcal{D}} \newcommand{\cgE}{\mathcal{E}} \newcommand{\cgF}{\mathcal{F}} \newcommand{\cgG}{\mathcal{G}} \newcommand{\cgM}{\mathcal{M}} \newcommand{\cgN}{\mathcal{N}} \newcommand{\cgP}{\mathcal{P}} \newcommand{\cgR}{\mathcal{R}} \newcommand{\cgS}{\mathcal{S}} \newcommand{\bfn}{\mathbf{n}} \newcommand{\bfm}{\mathbf{m}} \newcommand{\bfk}{\mathbf{k}} \newcommand{\bfs}{\mathbf{s}} \newcommand{\bijection}{\xrightarrow[\text{onto}]{\text{$1$--$1$}}} \newcommand{\injection}{\xrightarrow[]{\text{$1$--$1$}}} \newcommand{\surjection}{\xrightarrow[\text{onto}]{}} \newcommand{\nin}{\not\in} \newcommand{\prufer}{\mbox{prüfer}} \DeclareMathOperator{\fix}{fix} \DeclareMathOperator{\stab}{stab} \DeclareMathOperator{\var}{var} \newcommand{\inv}{^{-1}} \newcommand{\lt}{<} \newcommand{\gt}{>} \newcommand{\amp}{&} \)

Section8.5Partitions of an Integer

A recurring theme in this course has been to count the number of integer solutions to an equation of the form \(x_1+x_2+\cdots + x_k = n\text{.}\) What if we wanted to count the number of such solutions but didn't care what \(k\) was? How about if we took this new question and required that the \(x_i\) be distinct (i.e., \(x_i\neq x_j\) for \(i\neq j\))? What about if we required that each \(x_i\) be odd? These certainly don't seem like easy questions to answer at first, but generating functions will allow us to say something very interesting about the answers to the last two questions.

By a partition \(P\) of an integer, we mean a collection of (not necessarily distinct) positive integers such that \(\sum_{i\in P} i = n\text{.}\) (By convention, we will write the elements of \(P\) from largest to smallest.) For example, \(2+2+1\) is a partition of \(5\text{.}\) For each \(n\ge0\text{,}\) let \(p_n\) denote the number of partitions of the integer \(n\) (with \(p_0=1\) by convention). Note that \(p_8=22\) as evidenced by the list in Table 8.14.

8 distinct parts 7+1 distinct parts, odd parts 6+2 distinct parts
6+1+1 5+3 distinct parts, odd parts 5+2+1 distinct parts
5+1+1+1 odd parts 4+4 4+3+1 distinct parts
4+2+2 4+2+1+1 4+1+1+1+1
3+3+2 3+3+1+1 odd parts 3+2+2+1
3+2+1+1+1 3+1+1+1+1+1 odd parts 2+2+2+2
2+2+2+1+1 2+2+1+1+1+1 2+1+1+1+1+1+1
1+1+1+1+1+1+1+1 odd parts
Table8.14The partitions of \(8\text{,}\) noting those into distinct parts and those into odd parts.

Note that there are \(6\) partitions of \(8\) into distinct parts. Also there are \(6\) partitions of \(8\) into odd parts. While it might seem that this is a coincidence, it in fact is always the case as Theorem 8.15 states. Before looking at that theorem and its proof, let's think about what a generating function for \(p_n\text{,}\) the number of partitions of \(n\text{,}\) would look like. Given a partition of \(n\text{,}\) we can count how many \(1\)'s appear, how many \(2\)'s appear, and so on. This suggests a similarity with our fruit basket problems earlier in the chapter, leading to the generating function \begin{equation*} P(x) = \left(\sum_{m=0}^\infty x^{m}\right)\left(\sum_{m=0}^\infty x^{2m}\right) \left(\sum_{m=0}^\infty x^{3m}\right)\cdots \left(\sum_{m=0}^\infty x^{km}\right)\cdots = \prod_{m=1}^\infty\frac{1}{1-x^m}. \end{equation*} Here the factor whose sum contains terms \(x^{km}\) is accounting for the number of \(k\)'s in the partition. While \(P(x)\) has a quite elegant form, that doesn't mean that it's terribly useful for computing \(p_n\text{.}\) In fact, providing an asymptotic estimate for \(p_n\) was a notoriously difficult problem, finally addressed by Hardy and Ramanujan in 1918. A popular account of this can be found in Robert Kanigel's 1991 book The Man who Knew Infinity or the 2016 film with the same title.

Proving the relationship between the number of partitions into distinct parts and the number of partitions into odd parts will involve restricted versions of the generating function \(P(x)\) from above.

Proof