Difference between revisions of "Product Command"

From GeoGebra Manual
Jump to: navigation, search
(command syntax: changed [ ] into ( ))
 
(15 intermediate revisions by 10 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.0}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|cas=true|algebra}}
{{command|list}}
+
;Product( &lt;List of Raw Data> )
; Product[List of Numbers]: Calculates the product of all numbers in the list.
+
:Calculates the product of all numbers in the list.
; Product[List of Numbers, Number of Elements]:Calculates the product of the first ''n'' list elements.  
+
:{{example|1=<div><code><nowiki>Product({2, 5, 8})</nowiki></code> yields ''80''.</div>}}
{{example|1=<code>Product[{1,2,3,4},3]</code> gives you the number 6.}}
+
;Product( &lt;List of Numbers>, <Number of Elements> )
==CAS Specific Syntax==
+
:Calculates the product of the first ''n'' elements in the list.  
In [[CAS View]] only the following syntax is allowed:
+
:{{example|1=<div><code><nowiki>Product({1, 2, 3, 4}, 3)</nowiki></code> yields ''6''.</div>}}
; Product[<List>]: Calculates the product of all elements in the list.
+
;Product( &lt;List of Numbers>, &lt;List of Frequencies> )
; Product[<Expression>, <Variable>, <Start>, <End>]: Calculates the product of the expressions that are obtained by replacing the given variable with every integer from ''start'' to ''end''.
+
:Calculates the product of all elements in the ''list of numbers'' raised to the value given in the ''list of frequencies'' for each one of them.
 
+
:{{examples|1=<br><code><nowiki>Product({20, 40, 50, 60}, {4, 3, 2, 1})</nowiki></code> yields ''1536000000000000''<br><code><nowiki>Product({sqrt(2), cbrt(3), sqrt(5), cbrt(-7)}, {4, 3, 2, 3})</nowiki></code> yields ''-420''
:{{Example|1=&nbsp;
+
}}
:* <code>Product[{1,2,x}]</code> gives you ''6''.
+
:{{note|The two lists must have the same length.}}
:* <code>Product[x+1, x, 2, 3]</code> gives you ''12''.}}
+
==CAS Syntax==
 +
;Product( &lt;List of Expressions> )
 +
:Calculates the product of all elements in the list.
 +
:{{example|1=<div><code><nowiki>Product({1, 2, x})</nowiki></code> yields ''2x''.</div>}}
 +
;Product( <Expression>, <Variable>, <Start Index>, <End Index> )
 +
:Calculates the product of the expressions that are obtained by replacing the given variable with every integer from ''start'' to ''end''.
 +
:{{example|1=<div><code><nowiki>Product(x + 1, x, 2, 3)</nowiki></code> yields ''12''.</div>}}

Latest revision as of 11:25, 6 October 2017


Product( <List of Raw Data> )
Calculates the product of all numbers in the list.
Example:
Product({2, 5, 8}) yields 80.
Product( <List of Numbers>, <Number of Elements> )
Calculates the product of the first n elements in the list.
Example:
Product({1, 2, 3, 4}, 3) yields 6.
Product( <List of Numbers>, <List of Frequencies> )
Calculates the product of all elements in the list of numbers raised to the value given in the list of frequencies for each one of them.
Examples:
Product({20, 40, 50, 60}, {4, 3, 2, 1}) yields 1536000000000000
Product({sqrt(2), cbrt(3), sqrt(5), cbrt(-7)}, {4, 3, 2, 3}) yields -420
Note: The two lists must have the same length.

CAS Syntax

Product( <List of Expressions> )
Calculates the product of all elements in the list.
Example:
Product({1, 2, x}) yields 2x.
Product( <Expression>, <Variable>, <Start Index>, <End Index> )
Calculates the product of the expressions that are obtained by replacing the given variable with every integer from start to end.
Example:
Product(x + 1, x, 2, 3) yields 12.
© 2024 International GeoGebra Institute