def f1(t):
if t < 0:
return 0
result = 0
result = 1.5 * f2(t-1) + 3.5 * f1(t-1)
return result
def f2(t):
if t < 0:
return 1
result = 0
result = 1.5 * f1(t-1) + 3.5 * f2(t-1)
return result
for i in range(10):
result = 0
result = f1(i) + f2(i)
print(result)
Running the above code takes a lot of time. I want to limit the number of executions of f1() and f2() to 10 executions each for every iteration in the for-loop, then proceed to the next for-loop value. How to do so?
Edit: 1.original pseudo code for this part 2.actual functions