[taos-glug] variable name conventions for vectors; David Hum

  • From: Philip Ansteth <pansteth@xxxxxxxxxxx>
  • To: taos-glug@xxxxxxxxxxxxx
  • Date: Sun, 17 Aug 2003 12:56:32 -0600

In Exercise 2.37, the operation "dot-product" is defined in terms
of a 'v' and a 'w'.   'v' refers to a vector, which is defined
as a sequence of numbers.    But what does 'w' refer to?

The authors don't say.   This is an example of one of the flaws I
see in "The Structure and Interpretation of Computer Programs":  it is
unnecessarily difficult.

I think 'w' refers to a second vector, of the same length as 'v'.

If I'm right, then

(dot-product (list 100 100 100) (list 10 20 30))

yields 6000,

where dot-product is defined as

(define (dot-product v w)
        (accumulate + 0 (map * v w)))

and 'map' is the version described in footnote 12 of Chapter 2.

=======================================================================

If the authors had just said, "where v and w are vectors", then
it would have saved me probably fifteen minutes or half an hour.

This complaint ties into a long-time theory of mine that typical math classes
and books make the subject harder than it needs to be.

I didn't find anything easily at my usual reference source for math questions,
http://mathworld.wolfram.com/   (The most obvious definition of dot product
at that site involved cosines.)

So I did a Google search on "matrix algebra dot product" and came up with
http://www.mathworks.de/access/helpdesk/help/toolbox/finance/fintut7b.shtml
It's definition of dot product included an example having to do with stock
portfolios.

In my case, I have enough experience to know not to get frustrated or
give up when encountering the Wolfram cosine complications.   But would a
high school student?

I sometimes think math teachers, and writers of math textbooks, get up in 
the morning every day, put on their pants, and say to themselves, "Today
I will make sure that only the most talented students understand."

I won't insist on that assessment of math teachers as a group, but I will
say that I have been reminded once again that I can only manage
SICP when I adopt just the right attitude toward it.

My tendency is to get impatient, read too quickly and then miss things.  I
have to consciously slow down, and work through each detail.   Then it
begins to make sense.

I'm reminded of a passage from David Hume:

"There is an inconvenience which attends all abstruse reasoning. that it
may silence, without convincing an antagonist, and requires the same
intense study to make us sensible of its force, that was at first
requisite for its invention."  A Treatise of Human Nature,
Book III, Part I, Section I.

Could it be that reading SICP is as difficult as writing it
was?  Or maybe even more difficult, since as readers we have to learn it
all at once, while the writers had years to collect their material and
test it on students?


Other related posts: