[Tutor] [Edu-sig] school physics/math courses
bob gailer
bgailer at gmail.com
Sat Oct 18 18:06:46 CEST 2008
Edward Cherlin wrote:
> [snip]
>
> As a teacher, I know very well what it means. Some representations are
> easier to understand, or easier to work with, or easier to learn from.
> Various thinkers, including Babbage, Whitehead, and Iverson, have
> commented on the effects of the way we represent problems on our
> ability to think about them, and not only they but luminaries from
> Fibonacci to Einstein have labored to invent or teach new notations
> and representations.
>
I'm glad to see Iverson amongst Babbage and Whitehead. In 1974 I was
introduced to his invention: APL. That transformed how I thought about
problems and expressed algorithms. I still wish for some way to bring
some of that magic into Python.
I found it interesting to hear (in the migration to Python 3) that the
Python reduce function was not used a lot or well understood. I
certainly use and understand it.
A brief tutorial for any who have read this far and are curious: In
Python one may combine the elements of a list using sum() (if the sum is
desired). For other functions one uses reduce. To get the product of the
elements of a list Y: reduce(operator.mul, Y). In APL reduce is / and
multiply is x so one writes x/Y. (Classic APL had only upper case for
names).
I can write and comprehend x/Y much faster than the wordy equivalent.
And Y can be an array of 0 or more dimensions. +/Y computes the "row
sum" giving an array of one less dimensions*. So if Y were:
1 2 3
4 5 6
the row sum is 6 15.
* if the number of dimensions is 0 (a "scalar" value) the result is the
scalar value unchanged.
--
Bob Gailer
Chapel Hill NC
919-636-4239
When we take the time to be aware of our feelings and
needs we have more satisfying interatctions with others.
Nonviolent Communication provides tools for this awareness.
As a coach and trainer I can assist you in learning this process.
What is YOUR biggest relationship challenge?
More information about the Tutor
mailing list