Difference between revisions of "Sum Command"
From GeoGebra Manual
(added v.4 - note/example formatting) |
(added v.4 - note/example formatting) |
||
Line 4: | Line 4: | ||
: {{Note| This command works for numbers, points, vectors, text, and functions.}} | : {{Note| This command works for numbers, points, vectors, text, and functions.}} | ||
: {{Example|1= | : {{Example|1= | ||
− | :* < | + | :* <code>Sum[{1, 2, 3}]</code> gives you the number ''a = 6''. |
− | :* < | + | :* <code>Sum[{x^2, x^3}]</code> gives you ''f(x) = x<sup>2</sup> + x<sup>3</sup>''. |
− | :* < | + | :* <code>Sum[Sequence[i,i,1,100]]</code> gives you the number ''a = 5050''. |
− | :* < | + | :* <code>Sum[{(1, 2), (2, 3)}]</code> gives you the point ''A = (3, 5)''. |
− | :* < | + | :* <code>Sum[{(1, 2), 3}]</code> gives you the point ''B = (4, 2)''. |
− | :* < | + | :* <code>Sum[{"a","b","c"}]</code> gives you the text ''"abc"''.}} |
; Sum[List, Number n of Elements]: Calculates the sum of the first ''n'' list elements. | ; Sum[List, Number n of Elements]: Calculates the sum of the first ''n'' list elements. | ||
: {{Note| This command works for numbers, points, vectors, text, and functions.}} | : {{Note| This command works for numbers, points, vectors, text, and functions.}} | ||
− | : {{Example| 1=< | + | : {{Example| 1=<code>Sum[{1, 2, 3, 4, 5, 6}, 4]</code> gives you the number ''a = 10''.}} |
Revision as of 12:38, 24 February 2011
- Sum[List]
- Calculates the sum of all list elements.
- Note: This command works for numbers, points, vectors, text, and functions.
- Example:
Sum[{1, 2, 3}]
gives you the number a = 6.Sum[{x^2, x^3}]
gives you f(x) = x2 + x3.Sum[Sequence[i,i,1,100]]
gives you the number a = 5050.Sum[{(1, 2), (2, 3)}]
gives you the point A = (3, 5).Sum[{(1, 2), 3}]
gives you the point B = (4, 2).Sum[{"a","b","c"}]
gives you the text "abc".
- Sum[List, Number n of Elements]
- Calculates the sum of the first n list elements.
- Note: This command works for numbers, points, vectors, text, and functions.
- Example:
Sum[{1, 2, 3, 4, 5, 6}, 4]
gives you the number a = 10.