Difference between revisions of "Sum Command"
From GeoGebra Manual
Line 1: | Line 1: | ||
<noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude> | <noinclude>{{Manual Page|version=4.0}}[[Category:Manual (official)|{{PAGENAME}}]]</noinclude> | ||
{{command|statistics}} | {{command|statistics}} | ||
− | ;Sum[ <List> ]: Calculates the sum of all list elements. | + | ;Sum[ <List> ] |
+ | :Calculates the sum of all list elements. | ||
:{{example|1=<div> | :{{example|1=<div> | ||
:* <code><nowiki>Sum[{1, 2, 3}]</nowiki></code> yields the number ''a = 6''. | :* <code><nowiki>Sum[{1, 2, 3}]</nowiki></code> yields the number ''a = 6''. | ||
Line 15: | Line 16: | ||
:{{note| This command works for numbers, points, vectors, text, and functions.}} | :{{note| This command works for numbers, points, vectors, text, and functions.}} | ||
==CAS Syntax== | ==CAS Syntax== | ||
− | Following syntax works only in CAS view | + | Following syntax works only in CAS view: |
+ | :{{example|1=<div> | ||
+ | :* <code><nowiki>Sum[{1, 2, 3}]</nowiki></code> yields ''6''. | ||
+ | :* <code><nowiki>Sum[{a, b, c}]</nowiki></code> yields ''a + b + c''.</div>}} | ||
;Sum[ <Expression f(t)>, <Variable t>, <Start Value s>, <End Value e>] | ;Sum[ <Expression f(t)>, <Variable t>, <Start Value s>, <End Value e>] | ||
:Computes sum <math>\sum_{t=s}^{e}f(t)</math>. End value might be infinity. | :Computes sum <math>\sum_{t=s}^{e}f(t)</math>. End value might be infinity. |
Revision as of 11:10, 26 August 2011
- Sum[ <List> ]
- Calculates the sum of all list elements.
- Example:
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, 2).Sum[{"a", "b", "c"}]
yields the text "abc".
- Note: This command works for numbers, points, vectors, text, and functions.
- Sum[ <List>, <Number n 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.
- Note: This command works for numbers, points, vectors, text, and functions.
CAS Syntax
Following syntax works only in CAS view:
- Example:
Sum[{1, 2, 3}]
yields 6.Sum[{a, b, c}]
yields a + b + c.
- Sum[ <Expression f(t)>, <Variable t>, <Start Value s>, <End Value e>]
- Computes sum \sum_{t=s}^{e}f(t). End value might be infinity.
- Example:
Sum[i^2, i, 1, 3]
yields 14.Sum[r^i, i, 0, n]
yields \frac{r^{n+1} - 1}{r - 1}.Sum[(1/3)^i, i, 0, Infinity]
yields \frac{3}{2}.