Partial sums of geometric series in a ring #
This file determines the values of the geometric series $\sum_{i=0}^{n-1} x^i$ and $\sum_{i=0}^{n-1} x^i y^{n-1-i}$ and variants thereof.
Several variants are recorded, generalising in particular to the case of a noncommutative ring in
which x and y commute. Even versions not using division or subtraction, valid in each semiring,
are recorded.
Summing k against the weights x ^ k * (1 - x) for k < m, plus m against the
boundary weight x ^ m, gives the geometric sum ∑ k ∈ Icc 1 m, x ^ k. This is the identity
behind the mean of a censored geometric distribution: x ^ k * (1 - x) is the mass at k and
x ^ m the mass collected at m.
Value of a geometric sum over the naturals. Note: see geom_sum_mul_add for a formulation
that avoids division and subtraction.