Generating Functions Practice Questions

Last Updated : 10 Jul, 2026

A generating function is a mathematical method used to represent a sequence of numbers as a power series. In this series, the coefficient of each power of x represents a term of the sequence. It is commonly used to solve problems involving sequences, counting, and recurrence relations.

Example:

For the sequence 1, 2, 3, 4, ..., the generating function is:

G(x) = 1 + 2x + 3x² + 4x³ + ...

Here, the coefficients 1, 2, 3, 4, ... represent the terms of the sequence.

Question 1: Find the generating function for the sequence {1, 1, 1, 1, …}.

Solution:

The generating function is

G(x) = 1 + x + x² + x³ + …

This is an infinite geometric series with common ratio x.

Using the formula,

1 + x + x² + x³ + … = 1 / (1 − x)

Therefore, G(x) = 1 / (1 − x)

Question 2: Find the generating function for the sequence {0, 1, 2, 3, …}.

Solution:

The generating function is

G(x) = 0 + x + 2x² + 3x³ + …

Using the standard generating function formula,

x + 2x² + 3x³ + … = x / (1 − x)²

Therefore, G(x) = x / (1 − x)²

Question 3: Find the generating function for the sequence {1, 2, 4, 8, …}.

Solution:

The generating function is

G(x) = 1 + 2x + 4x² + 8x³ + …

This is a geometric series with common ratio 2x.

Using the formula,

1 + 2x + 4x² + … = 1 / (1 − 2x)

Therefore, G(x) = 1 / (1 − 2x)

Question 4: Find the generating function for the sequence {ⁿC₀, ⁿC₁, ⁿC₂, … , ⁿCₙ}.

Solution:

The generating function is

G(x) = ⁿC₀ + ⁿC₁x + ⁿC₂x² + … + ⁿCₙxⁿ

Using the Binomial Theorem,

(1 + x)ⁿ = ⁿC₀ + ⁿC₁x + ⁿC₂x² + … + ⁿCₙxⁿ

Therefore, G(x) = (1 + x)ⁿ

Practice Problems

  • Problem 1: Find the generating function for the sequence {1, 2, 3, 4, …}
  • Problem 2: Determine the generating function for the sequence {1, −1, 1, −1, …}.
  • Problem 3: Find the generating function for the sequence {1, 0, 1, 0, 1, 0, …}.
  • Problem 4: Determine the generating function for the sequence {1, 4, 9, 16, …}.
  • Problem 5: Derive the generating function for the sequence {1, 1/2, 1/4, 1/8, …}.
  • Problem 6: Derive the generating function for the sequence {1, 3, 6, 10, 15, …}.
Comment

Explore