[Edu-sig] using Python as a calculator

Helene Martin lognaturel at gmail.com
Sun Apr 11 22:54:16 CEST 2010


Since I've been vocal over the past few days, I'd like to point out
that this is a very negative post.  Here's what I got out of it: "You
don't know math, you don't know this list of programming languages so
you're not a True Member of the Computation World and if you knew
anything about this, you clearly wouldn't say such foolish things."  I
know that's not exactly what you said, but read over your post to see
how it may be the case that that's how it comes across, starting with
the sigh of exasperation in your original post.

Christian makes frequent interesting and intelligent posts so why not
assume that his opinion is grounded in valid experience?  I found his
remarks very important because they're trying to mitigate some of the
esoteric nature of the conversation.

I take particular offense to your closing statement -- "I don't
consider anybody educated in computing without knowing something of
languages from the LISP, APL, FORTH, OOP, and scalar language
families."  First of all, you've just called many of us uneducated
which I'd argue somewhat lacks in tact.  You're also reinforcing the
idea that computing is this select club that only people with specific
experiences and interests have access to.  Do the majority of computer
scientists care much about APL/MATLAB/J/etc?  I know several who use
it all the time and several others, myself included, who really
haven't had much of a need for those.  I take it we are out of the
club?  Keep in mind you're excluding lots of folks with PhDs and
interesting projects under their belt.

As an educator, I find this attitude troubling, though I know that's
less relevant to you since you're not currently in the classroom.
Think about the effect this kind of attitude can have on folks who are
just starting to develop an interest in computing, especially those
who have reasons to think they don't belong right off the bat (women,
minorities).  Something to consider.

On Sun, Apr 11, 2010 at 12:00 PM, Edward Cherlin <echerlin at gmail.com> wrote:
> On Sat, Apr 10, 2010 at 09:33, Christian Mascher
> <christian.mascher at gmx.de> wrote:
>> Edward Cherlin wrote:
>>>
>>> [sigh]
>>>
>>> Do math tables in a math array language.
>>>
>>> degrees =. i. 91  NB. 0..90
>>>
>>> radians =. degrees * o. % 180
>>>
>>> table =. |: degrees, 1 2 3 o./ radians
>>
>> Sorry, I don't know J (Kirby does), but this is exactly the reason I prefer
>> Python. Readability counts (for me).
>
> That's what they said to Fibonacci when he tried to explain why Arabic
> numerals were better for math than Roman numerals. But Roman numerals
> are better in readability and algorithmic complexity if you rarely do
> anything but add and subtract, as merchants did before interest
> payments became critical. Roman numerals are precisely equivalent to
> abacus notation. It is odd that the distinction between math/science
> programming and business programming is nearly a thousand years old,
> but there it is.
>
> In fact, APL is the only computer language that uses the same symbols,
> + - × ÷, as first grade arithmetic texts. (Presumably, with the
> acceptance of Unicode, this will change someday.) Back in the 1960s,
> Ken Iverson successfully taught teachers how to teach children
> arithmetic on IBM Selectric terminals connected to a loaned 360
> mainframe. An addition table up to 10 is simply
>
> numbers =. i. 11  NB. 0..10
>
> numbers +/ numbers
>
> or, with a bit more complexity or a bit more simplicity, depending on
> your viewpoint,
>
> +/~ i. 11
>
> where f~ x is x f x .
>
>> For creating a table, most people would
>> probably use a spreadsheet anyway, but as I happen to know Python, I use it
>> for such tasks from time to time. I can even remember the syntax without
>> having used Python for months. Don't think that would be the case with J.
>
> This turns out not to be the case. The complete syntax table for J
> consists of 12 lines. You are talking glibly about a topic on which
> you have no information.
>
>> Not very inclined to learn that.
>
> Obviously.
>
>>> where
>>>
>>> =. is assignment
>>> i. creates a list of consecutive numbers starting at 0.
>>
>> Who on earth would think of that without a manual?
>
> And without a lesson? Do you believe that Python syntax is intuitive,
> and can be guessed without a manual or lessons? In i., the i stands
> for index. It is easy to learn, and reasonably mnemonic.
>
>>> NB. is the comment marker o. x is pi times x
>>
>> Why not pi?
>
> Why?
>
>>> % x is reciprocal of x, so o. % 180 is pi/180
>>
>> Don't think that is very useful.
>
> These objections are trivial and uninformed. You aren't a
> mathematician, you don't like math and math notation, so there is
> nothing more to say, except please stand out of the way of people who
> can benefit from it and want it.
>
>>> |: is transpose
>>
>> Another very special symbol.
>>>
>>> , appends an array to another. It turns a list into a table in order
>>> to match dimensions.
>>
>> Lost you there...
>
> You can append a table to a table if they have a dimension in common.
> You can't append a table to a list unless the list is turned into a
> one-row table.
>
>>> 1 2 3 o. x gives sine, cosine, tangent of x
>>
>> Why don't they use sin(), cos(), tan() like the rest of the mathematical
>> world?
>>>
>>> / creates a table with the given function (o.) applied to two list
>>> arguments
>>>
>>> The result is a 91 row, 4 column table of angles and trig function values.
>>>
>> Impressive ;-))
>>>
>>> I can easily give you a short sequence of lessons leading to this
>>> level, introducing some other arithmetic, transcendental, and
>>> array-handling functions along the way, and a little more about
>>> operating on functions to define new functions.
>>
>> Python is much nearer to standard Math-notation, that is a good thing.
>
> LOL. Math notation is what mathematicians use, not schoolchildren.
> They are constantly inventing more of it. What you call math notation
> is known to mathematicians as "arithmetic".
>
> There is no standard math notation.
>
> Polish: + 1 2
> Infix: 1 + 2
> Reverse Polish: 1 2 +
>
> Reverse Polish is one of the two standard calculator input systems,
> the one used by engineers, from HP. Polish is standard in LISP and
> combinatory logic. Neither requires parentheses. Infix notation, as on
> TI and related calculators, requires parentheses, and is much more
> difficult for complex expressions.
>
>> I
>> like to learn new languages - up to a point. I don't see the added value of
>> J in this case.
>
> I like to learn languages a lot more than you, then. I don't consider
> anybody educated in computing without knowing something of languages
> from the LISP, APL, FORTH, OOP, and scalar language families.
>
>> Just my 2c
>>
>> Christian
>>
>> _______________________________________________
>> Edu-sig mailing list
>> Edu-sig at python.org
>> http://mail.python.org/mailman/listinfo/edu-sig
>>
>
>
>
> --
> Edward Mokurai (默雷/धर्ममेघशब्दगर्ज/دھرممیگھشبدگر ج) Cherlin
> Silent Thunder is my name, and Children are my nation.
> The Cosmos is my dwelling place, the Truth my destination.
> http://www.earthtreasury.org/
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>


More information about the Edu-sig mailing list