Loading…

Generating Function Solver

Math Probability • Combinatorics and Counting Techniques

View all topics

Generating Function Solver – Coefficients, OGF/EGF, and Extraction (Free)

Compute ordinary and exponential generating functions and extract coefficients: \(\displaystyle A(x)=\sum_{n\ge0} a_n x^n\) (OGF) or \(\displaystyle A(x)=\sum_{n\ge0} a_n \frac{x^n}{n!}\) (EGF).

Tip: Click Fill example for \((1+x)^5\) and press Play to animate the coefficient build-up.

Generator setup
Template parameters

Inputs accept 1e-3, pi, e, sqrt(2), sin(), cos(), tan(), ln(), log(), abs(). Use * for multiplication.

Coefficient extraction
Play animates how coefficients/partial sums build from term 0 to term \(N-1\). Drag on the plot to pan; wheel/trackpad to zoom.
Ready
Interactive view — coefficient bars + partial-sum plot

Top: coefficients \(a_0,\dots,a_{N-1}\). Bottom: partial sum \(A_{N}(x)=\sum_{n<N} a_n x^n\) (or \(\sum a_n x^n/n!\) for EGF).

Rate this calculator

0.0 /5 (0 ratings)
Be the first to rate.
Your rating
You can update your rating any time.

Frequently Asked Questions

What is a generating function?

It encodes a sequence {a_n} into a function A(x). In an OGF, a_n is the coefficient of x^n; in an EGF, a_n is the coefficient of x^n/n!.

How do I extract a coefficient?

Coefficient extraction means finding a_k such that A(x)=sum a_n x^n (OGF) or sum a_n x^n/n! (EGF). For templates like (1+ax)^n, a_k=binom(n,k)a^k.

Why are OGFs and EGFs different?

OGFs are common for unlabelled counting and size-additive constructions. EGFs naturally handle labelled objects because the n! factor matches permutations of labels.

What is the coin change / partitions connection?

Products like ∏(1-x^c)^{-1} encode unlimited uses of coin c; the coefficient of x^n counts ways to form total n. A classic infinite product encodes integer partitions.