Skip to content
Property Value
Hex Value $BB29
Categories
Localizations
  • FR: somCum(

cumSum(

Overview

Returns a list of the cumulative sums of the elements in list, starting with the first element.

Availability: Token available everywhere.

Syntax

cumSum(list)

Arguments

NameTypeOptional
listlist

Location

2nd, list, OPS, 6:cumSum(


Overview

Returns a matrix of the cumulative sums of matrix elements. Each element in the returned matrix is a cumulative sum of a matrix column from top to bottom.

Availability: Token available everywhere.

Syntax

cumSum(matrix)

Arguments

NameTypeOptional
matrixmatrix

Location

2nd, matrix, MATH, 0:cumSum(


Description

cumSum( calculates the cumulative sums of a list, or of the columns of a matrix, and outputs them in a new list or matrix variable.

For a list, this means that the Nth element of the result is the sum of the first N elements of the list:

cumSum({1,3,5,7,9})
    {1 4 9 16 25}

For a matrix, cumSum( is applied to each column in the same way as it would be for a list (but numbers in different columns are never added):

[[0,1,1][0,1,3][0,1,5][0,1,7]]
    [[0 1 1]
     [0 1 3]
     [0 1 5]
     [0 1 7]]
cumSum(Ans)
    [[0 1 1]
     [0 2 4]
     [0 3 9]
     [0 4 16]]

Advanced Uses

The ΔList( command is very nearly the inverse of the cumSum( command - it calculates the differences between consecutive elements. For any list, ΔList(cumSum(list)) will return the same list, but without its first element:

ΔList(cumSum({1,2,3,4,5,6,7}))
    {2 3 4 5 6 7}

Removing the first element would otherwise be a difficult procedure involving the seq( command, so this is a useful trick to know.


For a matrix, if you want to sum up the rows instead of the columns, use the T (transpose) command.


Source: parts of this page were written by the following TI|BD contributors: DarkerLine, GoVegan, Myles_Zadok.

History

Calculator OS Version Description
TI-83 0.01013 Added
Authors: Adrien Bertrand