208k views
13 votes
Determine the value for the following recursive method when x = 19.

Determine the value for the following recursive method when x = 19.-example-1
User Tbrisker
by
3.2k points

1 Answer

13 votes

Answer:


f(19) = 2

Step-by-step explanation:

Given


f(x) = f(x - 5)+ 2 ---
x > 9


f(x) = -2 ---
x \le 9

Required

Find f(19)

f(19) implies that: x = 19

Since 19 > 9, we make use of:


f(x) = f(x - 5)+ 2


f(19) = f(19 - 5) + 2


f(19) = f(14) + 2 ----- (1)

Calculate f(14)

f(14) implies that: x = 14

Since 14 > 9, we make use of:


f(x) = f(x - 5)+ 2


f(14) = f(14 - 5) + 2


f(14) = f(9) + 2 ------ (2)

Calculate f(9)

f(9) implies that: x = 14

Since
9 \le 9, we make use of:


f(x) = -2


f(9) = -2

So:


f(14) = f(9) + 2


f(14) = -2 + 2


f(14) = 0


f(19) = f(14) + 2


f(19) = 0 + 2


f(19) = 2

User Danmactough
by
3.2k points