Difference between revisions of "Product Command"
From GeoGebra Manual
(Product is included in the Algebra Commands category, not in the List one even it works with lists of numbers or list of expressions. There are sintaxis only available in CAS View but all of them are allowed,) |
|||
Line 5: | Line 5: | ||
;Product[ <List of Numbers>, <Number of Elements>]:Calculates the product of the first ''n'' list elements. | ;Product[ <List of Numbers>, <Number of Elements>]:Calculates the product of the first ''n'' list elements. | ||
:{{example|1=<div><code><nowiki>Product[{1, 2, 3, 4}, 3]</nowiki></code> yields ''6''.</div>}} | :{{example|1=<div><code><nowiki>Product[{1, 2, 3, 4}, 3]</nowiki></code> yields ''6''.</div>}} | ||
− | ;Product[ <List of Numbers>, <List of Frequencies> ]:Calculates the product of all elements in the list raised to the value given in the ''list of frequencies'' for each one of them | + | ;Product[ <List of Numbers>, <List of Frequencies> ]:Calculates the product of all elements in the list 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'' | :{{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'' | ||
}} | }} | ||
==CAS Specific Syntax== | ==CAS Specific Syntax== | ||
− | |||
;Product[ <List of expressions> ]:Calculates the product of all elements in the list. | ;Product[ <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>}} | :{{example|1=<div><code><nowiki>Product[{1, 2, x}]</nowiki></code> yields ''2x''.</div>}} | ||
;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''. | ;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''. | ||
:{{example|1=<div><code><nowiki>Product[x + 1, x, 2, 3]</nowiki></code> yields ''12''.</div>}} | :{{example|1=<div><code><nowiki>Product[x + 1, x, 2, 3]</nowiki></code> yields ''12''.</div>}} |
Revision as of 11:48, 18 December 2012
- Product[ <List of Numbers> ]
- 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:
Product[{1, 2, 3, 4}, 3]
yields 6.
- Product[ <List of Numbers>, <List of Frequencies> ]
- Calculates the product of all elements in the list 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 1536000000000000Product[ {sqrt(2), cbrt(3), sqrt(5), cbrt(-7)}, {4, 3, 2, 3} ]
yields -420
CAS Specific 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>, <End> ]
- 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.