and also 9/14/22 optional practice because I forgot to put it here
So, Recursive Functions.
Recursive Functions always look something along the lines of this->
Given f(x) or maybe f(x,y), find a number related to that So, let's say that I'm trying to find f(5) in this sample question. Because 5 is greater than 1, then it falls into the second category. So f(5) = f(4) + f(3) Now we find f(4) and f(3) f(4) = f(3) + f(2)
f(3) = f(2) + f(1)
f(2) = f(1) + f(0) f(1) = 1
f(0) = 0
And then you fill it up with the info you know
f(2) = f(1) + f(0) = 1 + 0 = 1
f(3) = f(2) + f(1) = 1 + 1 = 2
f(4) = f(3) + f(2) = 2 + 1 = 3
f(5) = f(4) + f(3) = 3 + 2 = 5 Therefore, f(5) = 5
Homework:
other homework for 9/14 bc i forgor 💀
64
525