Difference between revisions of "Sum Command"
From GeoGebra Manual
Line 16: | Line 16: | ||
:Returns the sum of given list of numbers considering the frequencies. | :Returns the sum of given list of numbers considering the frequencies. | ||
:{{example|1=<div><code><nowiki>Sum[{1, 2, 3, 4, 5}, {3, 2, 4, 4, 1}]</nowiki></code> yields ''a = 40''.</div>}} | :{{example|1=<div><code><nowiki>Sum[{1, 2, 3, 4, 5}, {3, 2, 4, 4, 1}]</nowiki></code> yields ''a = 40''.</div>}} | ||
− | {{note| 1= | + | {{note| 1=These commands work for numbers, points, vectors, text, and functions.}} |
==CAS Syntax== | ==CAS Syntax== | ||
;Sum[ <List> ] | ;Sum[ <List> ] |
Revision as of 13:09, 5 September 2013
- Sum[ <List> ]
- Calculates the sum of all list elements.
- Examples:
Sum[{1, 2, 3}]
yields the number a = 6.Sum[{x^2, x^3}]
yields f(x) = x2 + x3.Sum[Sequence[ i, i, 1, 100 ]]
yields the number a = 5050.Sum[{(1, 2), (2, 3)}]
yields the point A = (3, 5).Sum[{(1, 2), 3}]
yields the point B = (4, 5).Sum[{"a", "b", "c"}]
yields the text "abc".
- Sum[ <List>, <Number of Elements> ]
- Calculates the sum of the first n list elements.
- Example:
Sum[{1, 2, 3, 4, 5, 6}, 4]
yields the number a = 10.
- Sum[ <List>, <List of Frequencies> ]
- Returns the sum of given list of numbers considering the frequencies.
- Example:
Sum[{1, 2, 3, 4, 5}, {3, 2, 4, 4, 1}]
yields a = 40.
Note: These commands work for numbers, points, vectors, text, and functions.
CAS Syntax
- Sum[ <List> ]
- Calculates the sum of all list elements.
- Examples:
Sum[{1, 2, 3}]
yields 6.Sum[{a, b, c}]
yields a + b + c.
- Sum[ <Expression>, <Variable>, <Start Value>, <End Value> ]
- Computes sum \sum_{t=Start Value}^{End Value}f(t). End value might be infinity.
- Examples:
Sum[i^2, i, 1, 3]
yields 14.Sum[r^i, i, 0, n]
yields \frac{r^{n+1} }{r - 1} - \frac{1}{r - 1}.Sum[(1/3)^i, i, 0, Infinity]
yields \frac{3}{2}.