← Back to the MPU1054 course page

Rearranging a series

Change the order of the terms of a series… and the sum changes: Riemann’s rearrangement theorem, live.

How to use

For a finite sum, the order of the terms does not matter. For a series, it can change everything. The alternating harmonic series \( 1 - \frac{1}{2} + \frac{1}{3} - \frac{1}{4} + \cdots \) converges to \( \log 2 \approx 0.693 \), but its terms taken in the order “one positive, two negative”, \( 1 - \frac{1}{2} - \frac{1}{4} + \frac{1}{3} - \frac{1}{6} - \frac{1}{8} + \cdots \), give a series that converges to half that value. Riemann showed that one can go much further: if a series converges but does not converge absolutely, its terms can be reordered so that the sum is any value chosen in advance. With this application, you can:

  • enter the general term \( x_n \) of a series, for example (-1)^(n+1)/n, sin(n)/n or cos(n*pi/3)/n, and see the series written out, with a numerical diagnosis of its convergence;
  • choose the terms yourself, \( y_1, y_2, y_3, \ldots \), of the rearrangement \( y_k = x_{f(k)} \): from the bank of positive and negative terms, right on the graph (a click above the last point adds the next positive term, a click below it the next negative term, with a preview before the click) or with the keyboard, then drag the terms to change their order;
  • follow on the graph, in the style of my lecture notes, the partial sums \( t_k = y_1 + y_2 + \cdots + y_k \) of the rearrangement next to those of the original series, term by term, with exact values when possible;
  • run Riemann’s procedure toward a value \( c \) typed in, set with the slider or chosen by dragging the gold line on the graph: positive terms as long as \( t_k \le c \), then negative terms as long as \( t_k > c \), and so on, one step at a time or up to thousands of terms;
  • see, with an absolutely convergent series such as \( \sum (-1)^{n+1}/n^2 \), that the procedure can no longer reach any value: this is the rearrangement theorem, which says that all the rearrangements of an absolutely convergent series have the same sum.

The “Pattern” row adds 60 terms following a regular pattern, for example 2 positive terms then 1 negative; for the alternating harmonic series, the application also gives the sum \( \log 2 + \frac{1}{2}\log\frac{p}{q} \) of the rearrangement “\( p \) positive, \( q \) negative”. The “Copy link” button gives an address that reopens the same rearrangement (up to 400 terms), handy for showing it in class. Press ? in the application for the complete help.

HTML, CSS and JavaScript application, created with the help of Claude Code (Anthropic). The formulas are typeset with KaTeX.