Difference between revisions of "Sequence 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 1: Line 1:
 
<noinclude>{{Manual Page|version=4.2}}</noinclude>
 
<noinclude>{{Manual Page|version=4.2}}</noinclude>
 
{{command|cas=true|list}}
 
{{command|cas=true|list}}
; Sequence[ <Expression>, <Variable i>, <Number a>, <Number b>]
+
; Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b> ]
:Yields a list of objects created using the given expression and the index ''i'' that ranges from number ''a'' to number ''b''.
+
:Yields a list of objects created using the given expression and the index ''i'' that ranges from start value ''a'' to end value ''b''.
:{{example|1=<div><code><nowiki>L = Sequence[(2, i), i, 1, 5]</nowiki></code> creates a list of points whose ''y''-coordinates range from 1 to 5: <code><nowiki>L = {(2, 1), (2, 2), (2, 3), (2, 4), (2, 5)}</nowiki></code>.</div>}}
+
:{{example|1=<div><code><nowiki>Sequence[(2, i), i, 1, 5]</nowiki></code> creates a list of points whose ''y''-coordinates range from 1 to 5: ''{(2, 1), (2, 2), (2, 3), (2, 4), (2, 5)}''.</div>}}
;Sequence[ <Expression>, <Variable i>, <Number a>, <Number b>, <Increment>]
+
; Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b>, <Increment> ]
:Yields a list of objects created using the given expression and the index ''i'' that ranges from number ''a'' to number ''b'' with given increment.
+
:Yields a list of objects created using the given expression and the index ''i'' that ranges from start value ''a'' to end value ''b'' with given increment.
:{{example|1=<div><code><nowiki>L = Sequence[(2, i), i, 1, 3, 0.5]</nowiki></code> creates a list of points whose ''y''-coordinates range from 1 to 3 with an increment of 0.5: <code><nowiki>L = {(2, 1), (2, 1.5), (2, 2), (2, 2.5), (2, 3)}</nowiki></code>.</div>}}
+
:{{example|1=<div><code><nowiki>Sequence[(2, i), i, 1, 3, 0.5]</nowiki></code> creates a list of points whose ''y''-coordinates range from 1 to 3 with an increment of ''0.5'': ''{(2, 1), (2, 1.5), (2, 2), (2, 2.5), (2, 3)}''.</div>}}
 
:{{note| 1=Since the parameters ''a'' and ''b'' are dynamic you could use [[Slider Tool|slider]] variables in both cases above as well.}}
 
:{{note| 1=Since the parameters ''a'' and ''b'' are dynamic you could use [[Slider Tool|slider]] variables in both cases above as well.}}
; Sequence[ <Number b> ]
+
; Sequence[ <End Value b> ]
:Creates list of numbers 1 to ''b'', e.g. {1, 2, ..., b}.  
+
:Creates list of numbers from 1 to end value ''b''.  
:{{example| 1=<div><code><nowiki>L = 2^Sequence[4]</nowiki></code> creates list ''{2, 4, 8, 16}''.</div>}}
+
:{{example| 1=<div>
 +
:*<code><nowiki>Sequence[4]</nowiki></code> creates list ''{1, 2, 3, 4}''.
 +
:*<code><nowiki>2^Sequence[4]</nowiki></code> creates list ''{2, 4, 8, 16}''.</div>}}
 
:{{note| 1=See [[Lists]] for more information on list operations.}}
 
:{{note| 1=See [[Lists]] for more information on list operations.}}
 
==CAS Syntax==
 
==CAS Syntax==
;Sequence[ <Expression>, <Variable i>, <Number a>, <Number b> ]
+
;Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b> ]
:Yields a list of objects created using the given expression and the index ''i'' that ranges from number ''a'' to number ''b''.
+
:Yields a list of objects created using the given expression and the index ''i'' that ranges from start value ''a'' to end value ''b''.
 
:{{example|1=<div><code><nowiki>Sequence[x^i, i, 1, 10]</nowiki></code> generates the sequence ''{x, x², x³, x⁴, x⁵, x⁶, x⁷, x⁸, x⁹, x¹⁰}''.</div>}}
 
:{{example|1=<div><code><nowiki>Sequence[x^i, i, 1, 10]</nowiki></code> generates the sequence ''{x, x², x³, x⁴, x⁵, x⁶, x⁷, x⁸, x⁹, x¹⁰}''.</div>}}
;Sequence[ <Expression>, <Variable i>, <Number a>, <Number b>, <Increment>]
+
;Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b>, <Increment> ]
:Yields a list of objects created using the given expression and the index ''i'' that ranges from number ''a'' to number ''b'' with given increment.
+
:Yields a list of objects created using the given expression and the index ''i'' that ranges from start value ''a'' to end value ''b'' with given increment.
 
:{{example|1=<div><code><nowiki>Sequence[x^i, i, 1, 10, 2]</nowiki></code> generates the sequence ''{x, x³, x⁵, x⁷, x⁹}''.</div>}}
 
:{{example|1=<div><code><nowiki>Sequence[x^i, i, 1, 10, 2]</nowiki></code> generates the sequence ''{x, x³, x⁵, x⁷, x⁹}''.</div>}}
;Sequence[ <Number b> ]
+
:{{note| 1=Since the parameters ''a'' and ''b'' are dynamic you could use [[Slider Tool|slider]] variables in both cases above as well.}}
:Creates list of numbers 1 to ''b'', e.g. {1, 2, ..., b}.  
+
;Sequence[ <End Value b> ]
 +
:Creates list of numbers 1 to end value ''b''.  
 
:{{example|1=<div><code><nowiki>Sequence[5]</nowiki></code> generates the sequence ''{1, 2, 3, 4, 5}''.</div>}}
 
:{{example|1=<div><code><nowiki>Sequence[5]</nowiki></code> generates the sequence ''{1, 2, 3, 4, 5}''.</div>}}
 +
:{{note| 1=See [[Lists]] for more information on list operations.}}

Revision as of 11:03, 24 May 2013



Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b> ]
Yields a list of objects created using the given expression and the index i that ranges from start value a to end value b.
Example:
Sequence[(2, i), i, 1, 5] creates a list of points whose y-coordinates range from 1 to 5: {(2, 1), (2, 2), (2, 3), (2, 4), (2, 5)}.
Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b>, <Increment> ]
Yields a list of objects created using the given expression and the index i that ranges from start value a to end value b with given increment.
Example:
Sequence[(2, i), i, 1, 3, 0.5] creates a list of points whose y-coordinates range from 1 to 3 with an increment of 0.5: {(2, 1), (2, 1.5), (2, 2), (2, 2.5), (2, 3)}.
Note: Since the parameters a and b are dynamic you could use slider variables in both cases above as well.
Sequence[ <End Value b> ]
Creates list of numbers from 1 to end value b.
Example:
  • Sequence[4] creates list {1, 2, 3, 4}.
  • 2^Sequence[4] creates list {2, 4, 8, 16}.
Note: See Lists for more information on list operations.

CAS Syntax

Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b> ]
Yields a list of objects created using the given expression and the index i that ranges from start value a to end value b.
Example:
Sequence[x^i, i, 1, 10] generates the sequence {x, x², x³, x⁴, x⁵, x⁶, x⁷, x⁸, x⁹, x¹⁰}.
Sequence[ <Expression>, <Variable i>, <Start Value a>, <End Value b>, <Increment> ]
Yields a list of objects created using the given expression and the index i that ranges from start value a to end value b with given increment.
Example:
Sequence[x^i, i, 1, 10, 2] generates the sequence {x, x³, x⁵, x⁷, x⁹}.
Note: Since the parameters a and b are dynamic you could use slider variables in both cases above as well.
Sequence[ <End Value b> ]
Creates list of numbers 1 to end value b.
Example:
Sequence[5] generates the sequence {1, 2, 3, 4, 5}.
Note: See Lists for more information on list operations.
© 2024 International GeoGebra Institute