Exercise · ZW-PARTITION-GENERATING-FUNCTION-009 · ★★☆ Intermediate

How many partitions of 4 have all their parts equal to 1 or 2?

Choose one option.

Show answer
  • B. 3

Explanation

The partitions sought are \(2+2\), \(2+1+1\), and \(1+1+1+1\), three in total. Forgetting \(2+1+1\) gives 2, including \(4\), which uses a forbidden part, gives 4, and counting compositions gives 5.

Study Enumerative combinatorics in ZWMath →

Review the concept: Partition generating function

The partition generating function is the formal series \(\sum_{n\ge 0} p(n)\,x^n\), where \(p(n)\) counts the partitions of the integer \(n\).

\[\sum_{n\ge 0} p(n)x^n=\prod_{k\ge 1}\frac{1}{1-x^k}\]

More practice problems: partition generating function

← ZW-PARTITION-GENERATING-FUNCTION-008 ZW-PARTITION-GENERATING-FUNCTION-010 →