[taos-glug] Re: Question 1.46

  • From: Philip Ansteth <pansteth@xxxxxxxxxxx>
  • To: taos-glug@xxxxxxxxxxxxx
  • Date: Wed, 13 Aug 2003 09:58:14 -0600

Jon,

I'll buy your solution.   I didn't try that exercise, nor 1.45.

However, I am curious about something.   I get slightly different answers
with different initial guesses.   Or I think that's what's going on.   Maybe
you can explain it easily.  Here's what I did to get the following:

You have 5 as an initial guess.   I thought, Why not pass that as a 
user-definable
parameter?   Besides, I wanted to make sure that that's what the 5 actually 
was--although
later I saw that you had commented to that effect.

guile> (square-root 33 .001)           ; your routine as is
5.74456265264727

Next I changed the argument list:  (define square-root (lambda (number 
precision my-guess)
And changed 5 to my-guess.   That yielded the same result with 5:

guile> (square-root 33 .001 5)         
5.74456265264727

But when I tried other numbers I got slightly different results.

guile>  (square-root 33 .001 1)
5.74456264846024
guile> (square-root 33 .001 3)
5.74456274840839
guile> (square-root 33 .001 -1)
-5.74456264846024
guile> 

I didn't pursue it any farther than that.

I'm trying to keep moving forward.  The summer project is about to run out of 
summer,
with 500 pages still to go.   Today I'm going to look at electrical resistance 
problem
in Section 2.1.4, first to see if it looks like a worthwhile project, and then 
maybe
to try it.

Philip


Other related posts: