Common.Real.Sequence.Geometric #
A characterization of a geometric sequence, i.e. a sequence with a common ratio between each term.
Returns the value of the n
th term of a geometric sequence.
This function calculates the value of this term directly. Keep in mind the
sequence is 0
th-indexed.
Equations
- Real.Geometric.termClosed seq n = seq.a₀ * seq.r ^ n
Instances For
Returns the value of the n
th term of a geometric sequence.
This function calculates the value of this term recursively. Keep in mind the
sequence is 0
th-indexed.
Equations
- Real.Geometric.termRecursive x 0 = x.a₀
- Real.Geometric.termRecursive x (Nat.succ n) = x.r * Real.Geometric.termRecursive x n
Instances For
The recursive and closed term definitions of a geometric sequence agree with one another.
The summation of the first n + 1
terms of a geometric sequence.
This function calculates the sum directly.
Instances For
The summation of the first n + 1
terms of a geometric sequence.
This function calculates the sum recursively.
Equations
- Real.Geometric.sumRecursive x 0 = x.a₀
- Real.Geometric.sumRecursive x (Nat.succ n) = Real.Geometric.termClosed x (n + 1) + Real.Geometric.sumRecursive x n
Instances For
The recursive and closed definitions of the sum of a geometric sequence agree with one another.