Follow your curiosity

What discovery has been shared with you?

FACTREE gives you something interesting to discover every day — and something worth talking about together.

Start with one fact. Explore it, go deeper, then follow whichever branch catches your imagination.

Choose subjects for a surprise

Exploring any topic

Begin your discovery

Your next discovery is one click away.

Choose one or more subjects above, or leave Any Topic selected and let curiosity decide.

Mathematics

Using Generating Functions to Solve Combinatorial Problems

Quick fact

Using generating functions, the number of ways to roll two six-sided dice and get a sum of 7 is found by extracting the coefficient of x^7 in (x + x^2 + ... + x^6)^2, which equals 6.

Why this is interesting

Imagine being able to solve a tricky counting problem by just doing algebra on a fancy polynomial. Generating functions turn counting into algebra, and once you see the trick, a whole world of problems becomes surprisingly simple.