Difference between revisions of "Iteration 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 )
(:<code>Iteration(a^2+1,a,{(1+ί)/(sqrt(2))},5)</code> will do a repeated iteration on a complex number)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
<noinclude>{{Manual Page|version=4.2}}</noinclude>
+
<noinclude>{{Manual Page|version=5.0}}</noinclude>{{command|function}}
{{command|function}}
+
;Iteration( <Function>, <Start Value>, <Number of Iterations> )
;Iteration[ <Function>, <Number x0>, <Number n> ]:Iterates the function ''n'' times using the given start value ''x0''.
+
:Iterates the function ''n'' times (''n'' = number of iterations) using the given start value.
:{{Examples|1=<br><br>After defining <code>f(x) = x^2</code> the command <code>Iteration[f, 3, 2]</code> gives you the result ''(3<sup>2</sup>)<sup>2</sup>=81'';<br><br>Another example of the use of this command is the repeated addition of 7 to the number 3: <br />Let g(x) = x+7.  The command <code>Iteration[g, 3, 4]</code> yields the result (((3+7) +7) +7) +7 = 31.}}
+
:{{Examples| 1=<div>
 +
:*After defining <code>f(x) = x^2</code> the command <code>Iteration(f, 3, 2)</code> gives you the result (3<sup>2</sup>)<sup>2</sup> = 81.
 +
:*''Repeated addition'': To obtain the repeated addition of 7 to the number 3, define <code>g(x) = x + 7</code>, then <code>Iteration(g, 3, 4)</code> yields (((3+7) +7) +7) +7 = 31.</div>}}
 +
 
 +
;Iteration( <Expression>, <Variable Name>, ..., <Start Values>, <Number of Iterations> )
 +
:Iterates the expression ''n'' times (''n'' = number of iterations) using the given start value. The result is then the last element of the output of [[IterationList Command]], with the same parameters.
 +
:{{Example| 1=
 +
:<code>Iteration(a^2+1,a,{(1+ί)/(sqrt(2))},5)</code> will do a repeated iteration on a complex number
 +
}}
 +
{{Note|See [[IterationList Command]] for further details.}}

Latest revision as of 23:24, 17 July 2018


Iteration( <Function>, <Start Value>, <Number of Iterations> )
Iterates the function n times (n = number of iterations) using the given start value.
Examples:
  • After defining f(x) = x^2 the command Iteration(f, 3, 2) gives you the result (32)2 = 81.
  • Repeated addition: To obtain the repeated addition of 7 to the number 3, define g(x) = x + 7, then Iteration(g, 3, 4) yields (((3+7) +7) +7) +7 = 31.


Iteration( <Expression>, <Variable Name>, ..., <Start Values>, <Number of Iterations> )
Iterates the expression n times (n = number of iterations) using the given start value. The result is then the last element of the output of IterationList Command, with the same parameters.
Example: :Iteration(a^2+1,a,{(1+ί)/(sqrt(2))},5) will do a repeated iteration on a complex number
Note: See IterationList Command for further details.
© 2024 International GeoGebra Institute