scheme drracket

a. 3 points Write a procedure (nmult n) that takes one argument. a positive integer, and
produces the number of multiplications required to raise something to that power using
fast-expt. You must write the program nmult with Dr.Racket and test your progran
with n=1, 5, 7, 8. Submit your program to TA. fast-expt is defined as follows:
(define (fast-expt
(cond ((= n 0)
((even? n) (square (fast-exot
(fast-exot
b. 2 points Can you determine a more concise description of the function computed by the
procedure nmult than the program itself? Write vour description in our definition window
with comments (using.
c. [2 points] Show that tor n >1, (numlt n) ≤ 3 log n (to the base 2).
Write your solution in your definition window with comments (using ;).
2. [3 points] Louis Reasoner is having great difficulty with the nmult procedure he wrote for
the exercise above. No matter what argument n he gives it, it tells him that n multiplications
are required to raise something to the nth power using fast-expt. Louis calls his friend
Eva Lu Ator over to helo. When thev examine Louis’s code. thev find that he has rewritter
the fast-exot procedure to use an explicit multiplication. rather than calling square
(define (fast-erot b n’
(mond (en a 1
( (even? n)
(fast-expt
(fast-exot b
(else (* b (fast-exot
(/ n 2)) ))
His nmult procedure is based on this implementation. “I don’t see what difference that could
make.” says Lois. “I do.” says Eva. “By writing the procedure like that. vou have transformed
the O(log n) process into an ©(n) process.
Explain. Write your explanation in your
definition window with comments (using: )
[4 points| Exercise 1.31 (a) on the page 60 of the text book (SICP 2nd Ed.).
You must define (product term a next b), (factorial n), and
(pi-product n) with Dr.Racket so that TA can test vour programs.
[3 points| Exercise 1.32 (b) on the page 61 of the textbook. Submit your program by email
You must define your function like the following template:
(define (accumulate combiner null-value term a next b
(define (accumulate-iter a result)
(accumulate-iter a null-value))
[3 points] Exercise 1.41 on the page 77 of the text book.
You must define (double fun) as specitied in the problem. Submit your program in the
same file ahove via email to TA