Name: Anonymous 2009-03-05 10:24
Exercise 1.11. A function f is defined by the rule that f(n) = n if n<3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n -
3) if n> 3. Write a procedure that computes f by means of a recursive process.
It gives me "The object 4 is not applicable".
Can you guys help me?
3) if n> 3. Write a procedure that computes f by means of a recursive process.
(define (f n)
(cond ((< n 3) n)
(else ((+ (f (- n 1))
(*
(f (- n 2)) 2)
(*
(f (- n 3)) 3))))))It gives me "The object 4 is not applicable".
Can you guys help me?