Two series are given, one conditionally convergent, the other absolutely convergent. (See below for definitions and theoretical background.) Select numbers of positive and negative terms, and how many times to repeat your chosen sign sequence; the program computes the corresponding partial sum. Note that the partial sums of the conditionally convergent series can be changed substantially by altering the ratio of positive to negative terms, while the partial sums of the absolutely convergent series approach the same value no matter how many terms of each sign are taken.

Sign Sequence:

Repeat sign sequence times.

An *infinite series* $\sum\limits_{k=1}^{\infty} a_{k}$ is a
sequence $(s_{n})$ of partial sums:
\[
s_{n} = \sum_{k=1}^{n} a_{k} = a_{1} + a_{2} + a_{3} + \dots + a_{n}.
\]
If the sequence of partial sums has a limiting value, the infinite
series is *convergent*; otherwise the series
is *divergent*.

When the terms $a_{k}$ all have the same sign, the
sequence $(s_{n})$ of partial sums is monotone, and therefore has
a limit if and only if it is bounded. If, however, there are
infinitely many terms of either sign, matters become more interesting.
Define the *positive* and *negative* terms of the series
to be
\begin{align*}
a_{k}^{+} &= \frac{|a_{k}| + a_{k}}{2}
= \begin{cases}
a_{k} & \text{if $0 \le a_{k}$,} \\
0 & \text{if $0 \ge a_{k}$;}
\end{cases} \\
a_{k}^{-} &= \frac{|a_{k}| - a_{k}}{2}
= \begin{cases}
0 & \text{if $0 \le a_{k}$,} \\
-a_{k} & \text{if $0 \ge a_{k}$;}
\end{cases}.
\end{align*}

By simple algebra, $a_{k} = a_{k}^{+} - a_{k}^{-}$ and $|a_{k}| = a^{k}_{+} + a_{k}^{-}$. Consequently,

- If $\sum\limits_{k=1}^{\infty} |a_{k}|$ converges, then $\sum\limits_{k=1}^{\infty} a_{k}^{\pm}$, and therefore $\sum\limits_{k=1}^{\infty} a_{k}$ itself, also converge.
- If $\sum\limits_{k=1}^{\infty} a_{k}^{\pm}$ both converge, then $\sum\limits_{k=1}^{\infty} |a_{k}|$ converges.

An infinite series $\sum_{k} a_{k}$ is *absolutely convergent*
if $\sum_{k} |a_{k}|$ converges. Intuitively, the positive terms of an
absolutely convergent series have finite sum, and the negative terms
separately have finite sum.

A convergent infinite series that is not absolutely convergent
is *conditionally convergent*. Intuitively, the series of
positive terms of a conditionally convergent series diverges, as does
the series of negative terms.

Let $\newcommand{\N}{\mathbf{N}}\N$ denote the set of positive integers
and let $\sum_{k} a_{k}$ be an infinite series whose terms are indexed
by positive integers. If $f:\N \to \N$ is a bijection, then the
infinite series
\[
\sum_{k=1}^{\infty} a_{f(k)} = \sum_{k=1}^{\infty} b_{k},\qquad
b_{k} = a_{f(k)},
\]
is said to be a *rearrangement*. Intuitively, a rearrangement
of a series is the sequence of partial sums obtained by taking *the
original terms $(a_{k})$ in a different order*. For example,
the following are rearrangements of the alternating harmonis series:
\begin{alignat*}{3}
&1 - \tfrac{1}{2} + \tfrac{1}{3} - \tfrac{1}{4} + \tfrac{1}{5}
- \tfrac{1}{6} + \tfrac{1}{7} - \tfrac{1}{8} + \tfrac{1}{9} + \dots,
&&\text{One $+$,} && \text{one $-$,} \\
%
&1 + \tfrac{1}{3} - \tfrac{1}{2} + \tfrac{1}{5} + \tfrac{1}{7}
- \tfrac{1}{4} + \tfrac{1}{9} + \tfrac{1}{11} - \tfrac{1}{6} + \dots,
&&\text{Two $+$, } && \text{one $-$,} \\
%
&1 - \tfrac{1}{2} - \tfrac{1}{4} + \tfrac{1}{3} - \tfrac{1}{6}
- \tfrac{1}{8} + \tfrac{1}{5} - \tfrac{1}{10} - \tfrac{1}{12} + \dots,\qquad
&&\text{One $+$,} && \text{two $-$.}
\end{alignat*}
Since there are infinitely many terms of each type (positive and
negative), neither type “runs out” if we select one type
twice as often (say) as the other.

The commutative law of addition might suggest that an arbitrary
rearrangement of a convergent series must converge to the same
limit. This expectation is not generally correct! If $\sum_{k} a_{k}$
is *absolutely convergent*, then an arbitrary rearrangement
converges and has the same sum. Loosely, absolutely convergent series
can be rearranged arbitrarily without changing the sum; they behave
“as expected”.

Intuitively, rearrangement of a conditionally convergent series is expected to change the sum if the rearrangement changes the relative rate at which positive and negative terms are “used up”, e.g., one positive term for each negative term versus two positive terms for each negative term.

Unlike the situation for absolutely convergent series, rearrangements of conditionally convergent series are completely uncontrolled. For example, if $\sum_{k} a_{k}$ converges conditionally and $S$ is an arbitrary real number, there exists a rearrangement converging to $S$. A conceptual argument of this fact is easily sketched. Assume first that $0 \le S$. Since the series of positive and negative terms separately diverge, it is possible to select an initial set of positive terms whose sum exceeds $S$. Next, select an initial set of negative terms so that the “running total” is less than $S$. Continue in this way, adding positive terms until the partial sum exceeds $S$, then adding negative terms until $S$ exceeds the partial sum. Because the original series converges, the positive and negative terms approach $0$ (not necessarily monotonically). The “extreme” partial sums of our rearrangement therefore bracket $S$, alternatively above and below, so the partial sums of the rearrangement converge to $S$. (If instead $S \lt 0$, use the same idea, but start with enough negative terms to “undershoot” $S$.)