Computational Processes differ from each other in many respects one of those and probably one of the most important of those is the rate at which they consume the computational resources like the CPU cycle and the RAM.

To measure this as a parameter we use the concept of order of growth, which gives gross measure of the resources required by a process as a function of its input size. for most part order of growth in computers measures time required which is proportional to the amount of elementary machine operations to be performed by the process.

Let us see an example of exponentiation : raising b to the power of n

(define (expt b n) (if (= n 0) 1 (* b (expt b (- n 1)))))

this is a linear recursive process which grows linearly with the value of n. both in time and space. i.e as the value of n increases the process has to do as many recursions and thus time consumed in it is proportional to n. therefore it requires θ(n) steps and θ(n) space.

The iterative equivalent of the same takes θ(n) steps and θ(1) space.

Now let us see a fast-exponentiation algorithm with does the same job but is different from the above code.

(define (fast-expt b n) (cond ((= n 0) 1) ((even? n) (square (fast-expt b (/ n 2)))) (else (* b (fast-expt b (- n 1))))))

This algorithm of fast-exponentiation takes a different approach than before it repetitively reduces the exponent to half the value and squares the calculated term later thus reducing the number of steps to half.

If we observe the fast-exponentiation algorithm keenly we would observe that this algorithm doubles the size of exponent we can compute with every multiplication. Thus the algorithm grows logarithmically with the value of n instead of linearly growing with it.

This algorithm takes θ(log n) steps to compute the exponentiation.

The difference between θ(n) growth and θ(log n) growth becomes very significant when we deal with large values of n.

Due to this reason the importance of finding computationally cheaper methods of performing tasks has been a very interesting field of work for Programmers and Mathematicians for ages. Just to give you perspective see the below image and try to grasp the extent of this thing. (consider space here analogous to computations required.)

Image taken from Facebook Page of Math: An Integral Part of Happiness.