Difference between revisions of "Iteration Command"

From GeoGebra Manual
Jump to: navigation, search
m (examples format)
Line 1: Line 1:
 
<noinclude>{{Manual Page|version=4.2}}</noinclude>
 
<noinclude>{{Manual Page|version=4.2}}</noinclude>
 
{{command|function}}
 
{{command|function}}
;Iteration[ <Function>, <Number x0>, <Number n> ]:Iterates the function ''n'' times using the given start value ''x0''.
+
;Iteration[ <Function>, <Start Value>, <Number of Iterations> ]
:{{Examples|1=<div>
+
:Iterates the function ''n'' times using the given start value.
:*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''
+
:{{Example| 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.</div>}}
:*To obtain the repeated addition of 7 to the number 3: if g(x) = x+7 then <code>Iteration[g, 3, 4]</code> yields (((3+7) +7) +7) +7 = 31.</div>}}
+
:{{example|1='''repeated addition'''<div>To obtain the repeated addition of 7 to the number 3:</div> <div>Let <code>g(x) = x + 7</code>, then <code>Iteration[g, 3, 4]</code> yields ''(((3+7) +7) +7) +7 = 31''.</div>}}

Revision as of 10:48, 28 June 2013



Iteration[ <Function>, <Start Value>, <Number of Iterations> ]
Iterates the function n times using the given start value.
Example:
After defining f(x) = x^2 the command Iteration[f, 3, 2] gives you the result (32)2 = 81.
Example: repeated addition
To obtain the repeated addition of 7 to the number 3:
Let g(x) = x + 7, then Iteration[g, 3, 4] yields (((3+7) +7) +7) +7 = 31.
© 2024 International GeoGebra Institute