

Subject:
Help with cheking excercise solutions
Category: Computers > Programming Asked by: mott85ga List Price: $10.00 
Posted:
26 Sep 2004 13:42 PDT
Expires: 26 Oct 2004 13:42 PDT Question ID: 406585 
I am trying to teach myself scheme so I have the book Structure and interpretation of computer programs Second edition by Harold Abelson and Gerald Jay Sussman. I have done some sample exercises however this book provides no answers to check myself. Is there somewhere I can get the answers to exercises 1.30 1.36 and 1.40? I would like to see if I am on the right track. Thanks 

Subject:
Re: Help with cheking excercise solutions
Answered By: googleexpertga on 26 Sep 2004 14:36 PDT Rated: 
Hi mott85, Here are the solutions to the exercises you listed (list 1.30 1.36 1.40): 1.30 (define (sum term a next b) (define (iter a result) (if (> a b) result (iter (next a) (+ (term a) result)))) (iter a 0)) Source Page: http://utwe.net/~emerald/program/sicp/1.3.html 1.36 (define (printfixedpoint f firstguess) (define (closeenough? a b) (< (abs ( a b)) tolerance)) (define (print x) (display x) (newline) (try x)) (define (try guess) (let ((next (f guess))) (if (closeenough? guess next) next (print next)))) (try firstguess)) Source Page: http://utwe.net/~emerald/program/sicp/1.3.html 1.40 (define tolerance 0.00001) (define dx 0.00001) (define (fixedpoint f firstguess) (define (closeenough? v1 v2) (< (abs ( v1 v2)) tolerance)) (define (try guess) (let ((next (f guess))) (if (closeenough? guess next) next (try next)))) (try firstguess)) (define (deriv g) (lambda (x) (/ ( (g (+ x dx)) (g x)) dx))) (define (newtontransform g) (lambda (x) ( x (/ (g x) ((deriv g) x))))) (define (newtonsmethod g guess) (fixedpoint (newtontransform g) guess)) (define (cubic a b c) (lambda (x) (+ (* x x x) (* a (* x x)) (* b x) c))) Source Page: http://www.cs.wpi.edu/~cs2135/2000a/HW/solutions_homework3.html [Search Strategy] (define querylist (list (list 1.30 1.36 1.40) (list 'site:.com) (list 'cdr 'define 'car 'fixedpoint 'display) )) I'm not familiar with the looping functions in Scheme, but basically I selected an element from each of the 3 lists in querylist. If you have anymore questions, please don't hesistate to ask. googleexpert 
mott85ga rated this answer: 

Subject:
Re: Help with cheking excercise solutions
From: googleexpertga on 26 Sep 2004 20:49 PDT 
Thanks for the 5star rating! Greatly appreciated it. 
If you feel that you have found inappropriate content, please let us know by emailing us at answerssupport@google.com with the question ID listed above. Thank you. 
Search Google Answers for 
Google Home  Answers FAQ  Terms of Service  Privacy Policy 