# SICP Solutions

### Chapter 5, Computing with Register Machines

#### Exercise 5.26

(Note that i reverted all the changes made in previous exercises in the evaluator because lazy evaluator results in different number of stack-pushes)

Lets first check the for some values of n:

(a) Clearly maximum-depth = 10. Note that this is not a mathamttical argument that maximum-depth = 10 independent of n. For that we need to go into the code of evaluator while executing each instruction of fibonacci. Well, this is not asked and neither it’s interesting so i will skip that :)

(b) Well, again from the observation we can see the formulae is $\, \text{total-pushes} = 35n + 29 \,$. Again this is not mathematical proof. For that we first need to prove that each invocation of an iterative procedure results in a constant number of stack pushes. And then we can just directly use the observation above ti come up with formulae.