MathematicsCombinatoricsUniversity
AQACCEAEdexcelOCRWJECCBSE

Generating Functions (Coefficient)

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

Understand the formulaSee the free derivationOpen the full walkthrough

This public page keeps the free explanation visible and leaves premium worked solving, advanced walkthroughs, and saved study tools inside the app.

Core idea

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.

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.

Symbols

Variables

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

Coefficient
Power n
Parameter k

Walkthrough

Derivation

Coefficient Identity for (1−x)^{−k}

The coefficient of in (1−x)^{−k} is C(n+k−1,k−1).

  • n is an integer ≥ 0.
  • k is an integer ≥ 1.
1

State the standard series expansion:

This is a classical generating function identity used in stars-and-bars counting.

2

Read off the coefficient of x^n:

The coefficient is the binomial coefficient shown.

Result

Free formulas

Rearrangements

Solve for

Make the subject

This identity directly defines the coefficient of in the power series expansion of (1-x)^{-k} as a binomial coefficient. The goal is to state this known combinatorial form.

Difficulty: 2/5

The static page shows the finished rearrangements. The app keeps the full worked algebra walkthrough.

Visual intuition

Graph

Graph unavailable for this formula.

The graph displays a power-law curve where the coefficient increases as the independent variable n grows. Because the formula is equivalent to a polynomial in n of degree k-1, the shape transitions from constant to linear or higher-order polynomial growth depending on the fixed value of k.

Graph type: power_law

Why it behaves this way

Intuition

Visualize 'n' identical items (stars) arranged in a row, with 'k-1' identical dividers (bars) placed among them to partition the items into 'k' distinct groups, where the total number of arrangements of these stars and

n
The number of identical items to be chosen or distributed.
Represents the 'stars' in a stars and bars problem; increasing 'n' generally increases the number of possible combinations.
k
The number of distinct categories or types from which items are chosen.
Represents the 'bins' or 'types' available; increasing 'k' generally increases the number of possible combinations.
An operator that extracts the coefficient of the x^n term from a power series.
It isolates the specific combinatorial count for a given 'n' from the infinite series generated by the function.
A generating function whose power series expansion coefficients solve problems of combinations with repetition.
This specific algebraic form acts as a 'container' that systematically produces the desired combinatorial numbers as the coefficients of its power series.

Signs and relationships

  • -k: The negative exponent arises from the algebraic manipulation of the geometric series 1/(1-x). When raised to a negative power 'k', it corresponds to multiplying 'k' such series, which is the algebraic representation of
  • k-1: This term represents the number of 'bars' needed to divide 'n' identical items ('stars') into 'k' distinct bins. For 'k' bins, 'k-1' dividers are required, which is a core component of the 'stars and bars' combinatorial
  • n+k-1: This represents the total number of 'positions' available when arranging 'n' identical items (stars) and 'k-1' identical dividers (bars).

Free study cues

Insight

Canonical usage

This equation is used in combinatorics to count the number of combinations with repetition, and all quantities involved are dimensionless counts or formal mathematical variables.

Common confusion

A common mistake is to attempt to assign physical units to the formal variable 'x' or to the counts 'n' and 'k', when in this context, they are inherently dimensionless mathematical constructs.

Dimension note

All variables (n, k) and the result (the binomial coefficient) represent counts or formal variables, making the entire equation fundamentally dimensionless.

Unit systems

dimensionless (count of items) · Represents a non-negative integer count of items being selected or distributed.
dimensionless (count of types/categories) · Represents a positive integer count of distinct types or categories.
dimensionless (formal variable) · Acts as a placeholder variable in the power series expansion, without physical units.

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.

Where it shows up

Real-World Context

Counting solutions to x1+x2+...+xk=n with xi≥0.

Study smarter

Tips

  • The value of [xⁿ](1-x)⁻ᵏ is equivalent to (n+k-1) choose n.
  • Always ensure the inner term is in the form (1-x); if it is (1-ax), the result must be multiplied by aⁿ.
  • If you have lower bounds on variables (e.g., at least one item per bin), subtract those constants from n first.

Avoid these traps

Common Mistakes

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

Common questions

Frequently Asked Questions

The coefficient of x^n in (1−x)^{−k} is C(n+k−1,k−1).

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.

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.

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

Counting solutions to x1+x2+...+xk=n with xi≥0.

The value of [xⁿ](1-x)⁻ᵏ is equivalent to (n+k-1) choose n. Always ensure the inner term is in the form (1-x); if it is (1-ax), the result must be multiplied by aⁿ. If you have lower bounds on variables (e.g., at least one item per bin), subtract those constants from n first.

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