A function is a math equation that means for every 'x'
value, there is a 'y' value to graph on a cartesian coordinate plane.
(just a regular graph)
Well, a recursive function comes from a function that
contains more than 1 equation, and is repetitively substituting back into
itself until an answer is found. That is probably very hard to understand..
so let's look at an example.
(7) = ? where
(x) { (x-1) + 2
if x>5
{
6
if x<=5
(7) = (7-1) + 2
since 7 > 5 you use (x-1) + 2
= (6) + 2
now you need (6)
(6) = (6-1) + 2
since 6 > 5 you use f(x-1) + 2 again
= (5) + 2
now you need (5)
(5) = 6 since 5 = 5, you use 6.
now substite the answer to (5) into (6) like this:
(6) = (5) + 2
= 6 + 2
= 8
now substitute the answer to (6) into (7) like this:
(7) = (6) + 2
= 8 + 2
= 10
(7) = 10
Find (150) where
(x) = { (x-20)
+ 10
if x > 100
{ 3x
if x <= 100
Need help?