LightMySky
En anglais

Generating Functions

Store a whole sequence as the coefficients of a power series, then use algebra on the series to answer questions about the sequence.

Commence ce sujetPas besoin de compte. La progression est enregistrée dans ce navigateur.

Ce que l'enfant saura faire ensuite

  • Write the generating function of a simple sequence and read a coefficient back out
  • Solve a recurrence by converting it into an equation for the generating function
  • Explain what a product of two generating functions counts

1 · Lis

A generating function stores a whole sequence as the coefficients of a power series. The short expression 1 divided by (1 minus x) expands to 1 plus x plus x squared and on forever. Hard sequence problems turn into easier algebra on the function.

Try it together

Reading a coefficient recovers any term. In 1 divided by (1 minus x) every coefficient is 1, so the x to the power 5 term is 1. The polynomial (1 plus x) cubed expands to 1 plus 3x plus 3x squared plus x cubed. Differentiating gives 1 divided by (1 minus x) squared, which stores 1, 2, 3, and on.

Recurrences become equations for the series. For a(n) equal to 2 times a(n minus 1) with a0 equal 1, multiply through and sum to get A(x) minus 1 equal to 2x times A(x). Solving gives 1 divided by (1 minus 2x), which expands as 1 plus 2x plus 4x squared and on, so a4 is 16.

Good to know

Multiplying generating functions convolves the sequences instead of adding them term by term. Each new coefficient sums products of pairs, which counts combined choices. Test it: (1 plus x) times (1 plus x) is 1 plus 2x plus x squared, not 2 plus 2x.

Store the sequence as coefficients, do algebra on the function, and read the answer back as a coefficient.

À lire aussi

6.1 Power Series and Functions

A power series can store a whole sequence in its coefficients. The function 1/(1 minus x) looks like one short expression, yet it expands into 1 plus x plus x squared and so on forever. Reading a coefficient back out recovers any term you want.

6.2 Properties of Power Series

Series can be added, multiplied, differentiated, and integrated term by term inside their range. Multiplying two generating functions convolves their sequences: the new coefficient sums products of pairs. That operation counts combined choices, like picking one object of each of two kinds. Differentiation turns 1, 1, 1, ... into 1, 2, 3, ..., which is how x/(1 minus x) squared arises.

13.3 Geometric Sequences

Geometric sequences are the simplest generating function examples. The sequence 1, 2, 4, 8, ... satisfies a first order recurrence, and its generating function is 1/(1 minus 2 x). Converting the recurrence into an equation for the series solves it in one move. The same method scales to harder recurrences where guessing a formula directly would fail.

Pour aller plus loin

2 · Regarde

En anglais

Sans écran

Imprimer une fiche d'exercicesFormat A4, avec une page de corrigés pour les adultes. Sans écran, sans internet.

Où se situe ce sujet

À apprendre avant

Ce sujet mène à

Rien ne s'appuie encore dessus.

Puis s'entraîner

14 questions attendent derrière cette leçon, chacune avec sa réponse expliquée. Chaque réponse nourrit le ciel : les étoiles s'allument à mesure qu'elles sont apprises, et pâlissent quand vient le moment de revenir.

Commence ce sujet