Solutions to the exercises due Wednesday, October 27, 2004 1. Write a command that returns the maximum of two numbers: (define (max_two a b) (if (> a b) a b)) > (max_two 1 2) 2 2. Using the 'factorial' function as a model, write a function that takes a list of numbers and returns the largest number. (define (factorial n) (if (= n 1) 1 (* n (factorial (- n 1))))) (- n 1) => (null? (rest lst)) 1 => (first lst) * => max_two n => (first lst) factorial => my_max (- n 1) => (rest lst) (define (my_max lst) (if (null? (rest lst)) (first lst) (max_two (first lst) (my_max (rest lst))))) > (my_max '(1 2 3)) 3 > (my_max '(4 7 3 9 2 11 4)) 11