혼자 공부하면서 풀어본 것입니다. 그런만큼 오류가 많을 것이라 생각합니다. 문제 있는 부분은 알려주시면 고맙겠습니다.
펼쳐두기..
펼쳐두기..
Exercise 1.10. The following procedure computes a mathematical function called Ackermann's function.
(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1)
(A x (- y 1))))))
What are the values of the following expressions?
(A 1 10)
펼쳐두기..
펼쳐두기..
펼쳐두기..
Consider the following procedures, where A is the procedure defined above:
(define (f n) (A 0 n))
(define (g n) (A 1 n))
(define (h n) (A 2 n))
(define (k n) (* 5 n n))
Give concise mathematical definitions for the functions computed by the procedures f, g, and h for positive integer values of n. For example, (k n) computes 5n2.
펼쳐두기..
Exercise 1.9. Each of the
following two procedures defines a method for adding two positive integers
in terms of the procedures inc, which increments its argument
by 1, and dec, which decrements its argument by 1.
(define (+ a b)
(if (= a 0)
b
(inc (+ (dec a) b))))
(define (+ a b)
(if (= a 0)
b
(+ (dec a) (inc b))))
Using the substitution model, illustrate the process generated by each procedure in evaluating (+ 4 5). Are these processes iterative or recursive?
펼쳐두기..
펼쳐두기..

Use this formula to implement a cube-root procedure analogous to the square-root procedure. (In section 1.3.4 we will see how to implement Newton's method in general as an abstraction of these square-root and cube-root procedures.)
펼쳐두기..