Recursive Functions

8 questions

Q1
If f(x)=x+f(x2)f(x) = x + f(x-2) when x>1x > 1, f(0)=0f(0) = 0, and f(1)=1f(1) = 1, what is f(7)f(7)?
Q2
If f(x,y)=f(x1,y)+f(x,y1)f(x,y) = f(x-1,y) + f(x,y-1), f(0,y)=yf(0,y) = y, f(x,0)=xf(x,0) = x, find f(2,3)f(2,3).
Q3
If g(x)=g(x1)+2g(x2)g(x) = g(x-1) + 2 \cdot g(x-2) and g(0)=1g(0) = 1, g(1)=1g(1) = 1, find g(5)g(5).
Q4
If f(x)=2f(x) = 2 when x0x \leq 0, and f(x)=f(x1)+f(x3)f(x) = f(x-1) + f(x-3) otherwise, find f(5)f(5).
Q5
If f(n)f(n) returns f(n/2)+1f(n/2) + 1 when n>1n > 1, and f(1)=0f(1) = 0, what is f(32)f(32)?
Q6
If h(x)=h(x1)h(x2)h(x) = h(x-1) \cdot h(x-2) with h(1)=2h(1) = 2 and h(2)=3h(2) = 3, what is h(5)h(5)?
Q7
If f(x)=3f(x1)+2f(x) = 3 \cdot f(x-1) + 2 and f(0)=1f(0) = 1, find f(4)f(4).
Q8
If f(x)=f(x1)+f(x3)f(x) = f(x-1) + f(x-3), f(1)=1f(1) = 1, f(2)=1f(2) = 1, f(3)=1f(3) = 1, find f(7)f(7).