MathematicsCombinatoricsUniversity
AQACCEAEdexcelOCRWJECCBSE

Generating Functions (Coefficient) Calculator

Coefficient of x^n in (1−x)^{−k}.

Use the free calculatorCheck the variablesOpen the advanced solver
This is the free calculator preview. Advanced walkthroughs stay in the app.
Result
Ready
Coefficient

Formula first

Overview

This formula identifies the coefficient of xⁿ in the power series expansion of (1-x)⁻ᵏ, representing the fundamental tool for counting combinations with repetition. In combinatorics, it provides the closed-form solution for distributing n identical items into k distinct categories, often referred to as the stars and bars method.

Symbols

Variables

a_n = Coefficient, n = Power n, k = Parameter k

Coefficient
Power n
Parameter k

Apply it well

When To Use

When to use: Apply this equation when you need to find the number of ways to select n items from k types with replacement allowed. It is also the standard method for finding specific terms in the expansion of rational generating functions where the denominator is a power of a linear binomial.

Why it matters: It bridges algebra and discrete mathematics, allowing complex counting problems to be solved via polynomial manipulation. This is essential in probability theory for negative binomial distributions and in computer science for analyzing the complexity of nested loops.

Avoid these traps

Common Mistakes

  • Using C(n,k) instead of C(n+k−1,k−1).
  • Forgetting k must be at least 1.

One free problem

Practice Problem

Find the coefficient of in (1−x)^{−3}.

Power n4
Parameter k3

Solve for:

Hint: Coefficient is C(n+k−1,k−1)=C(6,2).

The full worked solution stays in the interactive walkthrough.

References

Sources

  1. Concrete Mathematics: A Foundation for Computer Science by Ronald L. Graham, Donald E. Knuth, Oren Patashnik, Chapter 7
  2. A First Course in Probability by Sheldon Ross, Chapter 2
  3. Wikipedia: Generating function
  4. Wikipedia: Stars and bars (combinatorics)
  5. Concrete Mathematics: A Foundation for Computer Science by Ronald L. Graham, Donald E. Knuth, Oren Patashnik
  6. Discrete Mathematics and Its Applications by Kenneth H. Rosen
  7. Generating function (Wikipedia article)
  8. Richard P. Stanley, Enumerative Combinatorics Volume 1