Difference between revisions of "Sum Command"

From GeoGebra Manual
Jump to: navigation, search
m (Text replace - "<div class="box info"> 48px|left This page is part of the official manual for print and pdf. For structural reasons normal users can't edit this page. If you found any errors on this page please contact )
Line 4: Line 4:
 
:Calculates the sum of all list elements.
 
:Calculates the sum of all list elements.
 
:{{examples|1=<div>
 
:{{examples|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''.
:* <code><nowiki>Sum[{x^2,  x^3}]</nowiki></code> yields ''f(x) = x<sup>2</sup> + x<sup>3</sup>''.
+
:* <code><nowiki>Sum[ {x^2,  x^3} ]</nowiki></code> yields ''f(x) = x<sup>2</sup> + x<sup>3</sup>''.
:* <code><nowiki>Sum[Sequence[i, i, 1, 100]]</nowiki></code> yields the number ''a = 5050''.
+
:* <code><nowiki>Sum[ Sequence[ i, i, 1, 100 ] ]</nowiki></code> yields the number ''a = 5050''.
:* <code><nowiki>Sum[{(1, 2), (2, 3)}]</nowiki></code> yields the point ''A = (3, 5)''.
+
:* <code><nowiki>Sum[ {(1, 2), (2, 3)} ]</nowiki></code> yields the point ''A = (3, 5)''.
:* <code><nowiki>Sum[{(1, 2), 3}]</nowiki></code> yields the point ''B = (4, 2)''.
+
:* <code><nowiki>Sum[ {(1, 2), 3} ]</nowiki></code> yields the point ''B = (4, 2)''.
:* <code><nowiki>Sum[{"a", "b", "c"}]</nowiki></code> yields the text ''"abc"''.</div>}}
+
:* <code><nowiki>Sum[ {"a", "b", "c"} ]</nowiki></code> yields the text ''"abc"''.</div>}}
 
:{{note| 1=This command works for numbers, points, vectors, text, and functions.}}
 
:{{note| 1=This command works for numbers, points, vectors, text, and functions.}}
  
  
;Sum[ <List>, <Number n of Elements> ]
+
;Sum[ <List>, <Number of Elements> ]
 
:Calculates the sum of the first ''n'' list elements.  
 
:Calculates the sum of the first ''n'' list elements.  
 
:{{example| 1=<code>Sum[{1, 2, 3, 4, 5, 6}, 4]</code> yields the number ''a = 10''.}}
 
:{{example| 1=<code>Sum[{1, 2, 3, 4, 5, 6}, 4]</code> yields the number ''a = 10''.}}
Line 19: Line 19:
  
  
; Sum[ <List of Numbers>, <List of Frequencies> ]
+
;Sum[ <List>, <List of Frequencies> ]
 
: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 ''40''.</div>}}
 
: {{example|1=<div><code><nowiki>Sum[{1, 2, 3, 4, 5},{3, 2, 4, 4, 1}]</nowiki></code> yields ''40''.</div>}}
Line 33: Line 33:
 
:* <code><nowiki>Sum[{a, b, c}]</nowiki></code> yields ''a + b + c''.</div>}}
 
:* <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>, <Variable>, <Start Value>, <End Value> ]
:Computes sum <math>\sum_{t=s}^{e}f(t)</math>. End value might be infinity.
+
:Computes sum <math>\sum_{t=Start Value}^{End Value}f(t)</math>. End value might be infinity.
 
:{{examples|1=<div>
 
:{{examples|1=<div>
 
:* <code><nowiki>Sum[i^2, i, 1, 3]</nowiki></code>  yields ''14''.
 
:* <code><nowiki>Sum[i^2, i, 1, 3]</nowiki></code>  yields ''14''.
 
:* <code><nowiki>Sum[r^i, i, 0, n]</nowiki></code>  yields ''<math>\frac{r^{n+1} - 1}{r - 1}</math>''.
 
:* <code><nowiki>Sum[r^i, i, 0, n]</nowiki></code>  yields ''<math>\frac{r^{n+1} - 1}{r - 1}</math>''.
 
:* <code><nowiki>Sum[(1/3)^i, i, 0, Infinity]</nowiki></code>  yields ''<math>\frac{3}{2}</math>''.</div>}}
 
:* <code><nowiki>Sum[(1/3)^i, i, 0, Infinity]</nowiki></code>  yields ''<math>\frac{3}{2}</math>''.</div>}}

Revision as of 09:51, 18 July 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, 2).
  • Sum[ {"a", "b", "c"} ] yields the text "abc".
Note: This command works for numbers, points, vectors, text, and functions.


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.
Note: This command works for numbers, points, vectors, text, and functions.


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 40.



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} - 1}{r - 1}.
  • Sum[(1/3)^i, i, 0, Infinity] yields \frac{3}{2}.
© 2021 International GeoGebra Institute