I think Guido was wise to start his tutorial by showing how we might use Python as a calculator. We might assume many students in this day and age are quite familiar with this device, and even if they're not, the text might project one, show a picture on the screen, if what these things used to look like (still do). However, one thing calculators lack over the old wood pulp textbooks are trig tables with multiple rows showing a lot of data at the same time. Their small "chat window" does not permit much data to be seen at one time. Back in the day, a student could run her finger down the rows, as the number of angular degrees increase from 0 to 60 and onward to 90, perhaps all the way around to 360. Going across the row, one would have sine and cosine, perhaps tangent. Having all the data visible at once, or spread across a few pages, inspired some insights and understanding, as one could see the trends in the numbers, plus these "click stop" rows where the numbers would suddenly be super easy, like 1/2 and 1/2 for both sine and cosine. Calculators don't give us that kind of output, but earlier office computing machines did have paper i/o, called a tape, usually a scroll mounted on a spool and fed through a small printer. As one added numbers, one printed to tape, perhaps a running total. The tape itself was a valuable item (especially once it had the data on it). Large computers came with line printers that hit on continuous feed paper with holes along both sides, often with green and white stripes. I will not try to recapitulate the long history of printing devices, except to point out that computers inherited them while slide rules and calculators did not. The equivalent in Python is stdout and/or some file in storage, on the hard drive or memory stick. The program output shown below would be an example of this kind of i/o. Notice that unless a file name is given (optional), the data is to stdout. I'm going to do a full 90 degrees, just to remind myself of the patterns students got in the old days, before trig tables were replaced with calculators, much as dial watches were replaced with digital ones (not necessarily a smart move in all cases).
imp.reload(newprint) <module 'newprint' from 'C:\Python26\lib\site-packages\newprint.py'> newprint.trigtable(range(91), "trigtable.txt")
The contents of trigtable.txt: 0 1.000000000 0.000000000 0.000000e+00 1 0.999847695 0.017452406 1.745506e-02 2 0.999390827 0.034899497 3.492077e-02 3 0.998629535 0.052335956 5.240778e-02 4 0.997564050 0.069756474 6.992681e-02 5 0.996194698 0.087155743 8.748866e-02 6 0.994521895 0.104528463 1.051042e-01 7 0.992546152 0.121869343 1.227846e-01 8 0.990268069 0.139173101 1.405408e-01 9 0.987688341 0.156434465 1.583844e-01 10 0.984807753 0.173648178 1.763270e-01 11 0.981627183 0.190808995 1.943803e-01 12 0.978147601 0.207911691 2.125566e-01 13 0.974370065 0.224951054 2.308682e-01 14 0.970295726 0.241921896 2.493280e-01 15 0.965925826 0.258819045 2.679492e-01 16 0.961261696 0.275637356 2.867454e-01 17 0.956304756 0.292371705 3.057307e-01 18 0.951056516 0.309016994 3.249197e-01 19 0.945518576 0.325568154 3.443276e-01 20 0.939692621 0.342020143 3.639702e-01 21 0.933580426 0.358367950 3.838640e-01 22 0.927183855 0.374606593 4.040262e-01 23 0.920504853 0.390731128 4.244748e-01 24 0.913545458 0.406736643 4.452287e-01 25 0.906307787 0.422618262 4.663077e-01 26 0.898794046 0.438371147 4.877326e-01 27 0.891006524 0.453990500 5.095254e-01 28 0.882947593 0.469471563 5.317094e-01 29 0.874619707 0.484809620 5.543091e-01 30 0.866025404 0.500000000 5.773503e-01 31 0.857167301 0.515038075 6.008606e-01 32 0.848048096 0.529919264 6.248694e-01 33 0.838670568 0.544639035 6.494076e-01 34 0.829037573 0.559192903 6.745085e-01 35 0.819152044 0.573576436 7.002075e-01 36 0.809016994 0.587785252 7.265425e-01 37 0.798635510 0.601815023 7.535541e-01 38 0.788010754 0.615661475 7.812856e-01 39 0.777145961 0.629320391 8.097840e-01 40 0.766044443 0.642787610 8.390996e-01 41 0.754709580 0.656059029 8.692867e-01 42 0.743144825 0.669130606 9.004040e-01 43 0.731353702 0.681998360 9.325151e-01 44 0.719339800 0.694658370 9.656888e-01 45 0.707106781 0.707106781 1.000000e+00 46 0.694658370 0.719339800 1.035530e+00 47 0.681998360 0.731353702 1.072369e+00 48 0.669130606 0.743144825 1.110613e+00 49 0.656059029 0.754709580 1.150368e+00 50 0.642787610 0.766044443 1.191754e+00 51 0.629320391 0.777145961 1.234897e+00 52 0.615661475 0.788010754 1.279942e+00 53 0.601815023 0.798635510 1.327045e+00 54 0.587785252 0.809016994 1.376382e+00 55 0.573576436 0.819152044 1.428148e+00 56 0.559192903 0.829037573 1.482561e+00 57 0.544639035 0.838670568 1.539865e+00 58 0.529919264 0.848048096 1.600335e+00 59 0.515038075 0.857167301 1.664279e+00 60 0.500000000 0.866025404 1.732051e+00 61 0.484809620 0.874619707 1.804048e+00 62 0.469471563 0.882947593 1.880726e+00 63 0.453990500 0.891006524 1.962611e+00 64 0.438371147 0.898794046 2.050304e+00 65 0.422618262 0.906307787 2.144507e+00 66 0.406736643 0.913545458 2.246037e+00 67 0.390731128 0.920504853 2.355852e+00 68 0.374606593 0.927183855 2.475087e+00 69 0.358367950 0.933580426 2.605089e+00 70 0.342020143 0.939692621 2.747477e+00 71 0.325568154 0.945518576 2.904211e+00 72 0.309016994 0.951056516 3.077684e+00 73 0.292371705 0.956304756 3.270853e+00 74 0.275637356 0.961261696 3.487414e+00 75 0.258819045 0.965925826 3.732051e+00 76 0.241921896 0.970295726 4.010781e+00 77 0.224951054 0.974370065 4.331476e+00 78 0.207911691 0.978147601 4.704630e+00 79 0.190808995 0.981627183 5.144554e+00 80 0.173648178 0.984807753 5.671282e+00 81 0.156434465 0.987688341 6.313752e+00 82 0.139173101 0.990268069 7.115370e+00 83 0.121869343 0.992546152 8.144346e+00 84 0.104528463 0.994521895 9.514364e+00 85 0.087155743 0.996194698 1.143005e+01 86 0.069756474 0.997564050 1.430067e+01 87 0.052335956 0.998629535 1.908114e+01 88 0.034899497 0.999390827 2.863625e+01 89 0.017452406 0.999847695 5.728996e+01 90 0.000000000 1.000000000 1.633124e+16 Here's the print function I used to generate the above. print("{0:>5g} {1:.9f} {2:.9f} {3:e}".format( row, cos(theta), sin(theta),tan(theta)), end="\n", file= thefile) My module starts with: from __future__ import printfunction which is why I get to use this in 2.6 So why use Python as a calculator again? Because it's more like an old office machine with a tape, and that restores some of what was lost when lookup tables went out of style. I should do log10 next, using range with a step or something.... Also, the trig tape should probably be 0-360 but I didn't want to waste paper. :) Kirby
[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 where =. is assignment i. creates a list of consecutive numbers starting at 0. NB. is the comment marker o. x is pi times x % x is reciprocal of x, so o. % 180 is pi/180 |: is transpose , appends an array to another. It turns a list into a table in order to match dimensions. 1 2 3 o. x gives sine, cosine, tangent of x / 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. 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. J is no-charge software from JSoftware.com. We are discussing the possibility of a GPLed version. When you do such function tables, it is extremely helpful to show the first differences. The differences of sine are approximately proportional to cosine, and of cosine are proportional to the negatives of sine. On Thu, Apr 8, 2010 at 10:43, kirby urner <kirby.urner@gmail.com> wrote:
I think Guido was wise to start his tutorial by showing how we might use Python as a calculator.
We might assume many students in this day and age are quite familiar with this device, and even if they're not, the text might project one, show a picture on the screen, if what these things used to look like (still do).
However, one thing calculators lack over the old wood pulp textbooks are trig tables with multiple rows showing a lot of data at the same time. Their small "chat window" does not permit much data to be seen at one time.
Back in the day, a student could run her finger down the rows, as the number of angular degrees increase from 0 to 60 and onward to 90, perhaps all the way around to 360.
Going across the row, one would have sine and cosine, perhaps tangent. Having all the data visible at once, or spread across a few pages, inspired some insights and understanding, as one could see the trends in the numbers, plus these "click stop" rows where the numbers would suddenly be super easy, like 1/2 and 1/2 for both sine and cosine.
Calculators don't give us that kind of output, but earlier office computing machines did have paper i/o, called a tape, usually a scroll mounted on a spool and fed through a small printer.
As one added numbers, one printed to tape, perhaps a running total. The tape itself was a valuable item (especially once it had the data on it).
Large computers came with line printers that hit on continuous feed paper with holes along both sides, often with green and white stripes. I will not try to recapitulate the long history of printing devices, except to point out that computers inherited them while slide rules and calculators did not.
The equivalent in Python is stdout and/or some file in storage, on the hard drive or memory stick. The program output shown below would be an example of this kind of i/o.
Notice that unless a file name is given (optional), the data is to stdout.
I'm going to do a full 90 degrees, just to remind myself of the patterns students got in the old days, before trig tables were replaced with calculators, much as dial watches were replaced with digital ones (not necessarily a smart move in all cases).
imp.reload(newprint) <module 'newprint' from 'C:\Python26\lib\site-packages\newprint.py'> newprint.trigtable(range(91), "trigtable.txt")
The contents of trigtable.txt:
0 1.000000000 0.000000000 0.000000e+00 1 0.999847695 0.017452406 1.745506e-02 2 0.999390827 0.034899497 3.492077e-02 3 0.998629535 0.052335956 5.240778e-02 4 0.997564050 0.069756474 6.992681e-02 5 0.996194698 0.087155743 8.748866e-02 6 0.994521895 0.104528463 1.051042e-01 7 0.992546152 0.121869343 1.227846e-01 8 0.990268069 0.139173101 1.405408e-01 9 0.987688341 0.156434465 1.583844e-01 10 0.984807753 0.173648178 1.763270e-01 11 0.981627183 0.190808995 1.943803e-01 12 0.978147601 0.207911691 2.125566e-01 13 0.974370065 0.224951054 2.308682e-01 14 0.970295726 0.241921896 2.493280e-01 15 0.965925826 0.258819045 2.679492e-01 16 0.961261696 0.275637356 2.867454e-01 17 0.956304756 0.292371705 3.057307e-01 18 0.951056516 0.309016994 3.249197e-01 19 0.945518576 0.325568154 3.443276e-01 20 0.939692621 0.342020143 3.639702e-01 21 0.933580426 0.358367950 3.838640e-01 22 0.927183855 0.374606593 4.040262e-01 23 0.920504853 0.390731128 4.244748e-01 24 0.913545458 0.406736643 4.452287e-01 25 0.906307787 0.422618262 4.663077e-01 26 0.898794046 0.438371147 4.877326e-01 27 0.891006524 0.453990500 5.095254e-01 28 0.882947593 0.469471563 5.317094e-01 29 0.874619707 0.484809620 5.543091e-01 30 0.866025404 0.500000000 5.773503e-01 31 0.857167301 0.515038075 6.008606e-01 32 0.848048096 0.529919264 6.248694e-01 33 0.838670568 0.544639035 6.494076e-01 34 0.829037573 0.559192903 6.745085e-01 35 0.819152044 0.573576436 7.002075e-01 36 0.809016994 0.587785252 7.265425e-01 37 0.798635510 0.601815023 7.535541e-01 38 0.788010754 0.615661475 7.812856e-01 39 0.777145961 0.629320391 8.097840e-01 40 0.766044443 0.642787610 8.390996e-01 41 0.754709580 0.656059029 8.692867e-01 42 0.743144825 0.669130606 9.004040e-01 43 0.731353702 0.681998360 9.325151e-01 44 0.719339800 0.694658370 9.656888e-01 45 0.707106781 0.707106781 1.000000e+00 46 0.694658370 0.719339800 1.035530e+00 47 0.681998360 0.731353702 1.072369e+00 48 0.669130606 0.743144825 1.110613e+00 49 0.656059029 0.754709580 1.150368e+00 50 0.642787610 0.766044443 1.191754e+00 51 0.629320391 0.777145961 1.234897e+00 52 0.615661475 0.788010754 1.279942e+00 53 0.601815023 0.798635510 1.327045e+00 54 0.587785252 0.809016994 1.376382e+00 55 0.573576436 0.819152044 1.428148e+00 56 0.559192903 0.829037573 1.482561e+00 57 0.544639035 0.838670568 1.539865e+00 58 0.529919264 0.848048096 1.600335e+00 59 0.515038075 0.857167301 1.664279e+00 60 0.500000000 0.866025404 1.732051e+00 61 0.484809620 0.874619707 1.804048e+00 62 0.469471563 0.882947593 1.880726e+00 63 0.453990500 0.891006524 1.962611e+00 64 0.438371147 0.898794046 2.050304e+00 65 0.422618262 0.906307787 2.144507e+00 66 0.406736643 0.913545458 2.246037e+00 67 0.390731128 0.920504853 2.355852e+00 68 0.374606593 0.927183855 2.475087e+00 69 0.358367950 0.933580426 2.605089e+00 70 0.342020143 0.939692621 2.747477e+00 71 0.325568154 0.945518576 2.904211e+00 72 0.309016994 0.951056516 3.077684e+00 73 0.292371705 0.956304756 3.270853e+00 74 0.275637356 0.961261696 3.487414e+00 75 0.258819045 0.965925826 3.732051e+00 76 0.241921896 0.970295726 4.010781e+00 77 0.224951054 0.974370065 4.331476e+00 78 0.207911691 0.978147601 4.704630e+00 79 0.190808995 0.981627183 5.144554e+00 80 0.173648178 0.984807753 5.671282e+00 81 0.156434465 0.987688341 6.313752e+00 82 0.139173101 0.990268069 7.115370e+00 83 0.121869343 0.992546152 8.144346e+00 84 0.104528463 0.994521895 9.514364e+00 85 0.087155743 0.996194698 1.143005e+01 86 0.069756474 0.997564050 1.430067e+01 87 0.052335956 0.998629535 1.908114e+01 88 0.034899497 0.999390827 2.863625e+01 89 0.017452406 0.999847695 5.728996e+01 90 0.000000000 1.000000000 1.633124e+16
Here's the print function I used to generate the above.
print("{0:>5g} {1:.9f} {2:.9f} {3:e}".format( row, cos(theta), sin(theta),tan(theta)), end="\n", file= thefile)
My module starts with:
from __future__ import printfunction
which is why I get to use this in 2.6
So why use Python as a calculator again? Because it's more like an old office machine with a tape, and that restores some of what was lost when lookup tables went out of style. I should do log10 next, using range with a step or something.... Also, the trig tape should probably be 0-360 but I didn't want to waste paper. :)
Kirby _______________________________________________ Edu-sig mailing list Edu-sig@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/
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). 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. Not very inclined to learn that.
where
=. is assignment i. creates a list of consecutive numbers starting at 0.
Who on earth would think of that without a manual?
NB. is the comment marker o. x is pi times x Why not pi? % x is reciprocal of x, so o. % 180 is pi/180 Don't think that is very useful. |: 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... 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. I like to learn new languages - up to a point. I don't see the added value of J in this case. Just my 2c Christian
The timing of this post was kind of one of those amazing cosmic coincidences, for all kinds of reasons. Thanks, Kirby. I got kicked in the teeth again by an administrator putting the brakes on starting a computational analysis course, the pseudo-arguments having to do with budget constraints. But the dream isn't dead ... I now have some support at the site level from some administrators and from parents who see that this really would be a good thing to do. Letters are being written to the board, lots of discussion fomenting. Way better than when I was completely alone. But an amazing amount of time has been sucked into having to constantly return to square one, or zero, in presenting the value of having a designated computational Math Analysis course. So .. in our regular Analysis class we were doing graphs of polar equations. The kids were a little confused about why certain graphs turned out as they did. Like - in r = sin(x), why is the circle 'all positive'? What happened to the negative sine values? They understood the basic meaning of (r, x), but the behavior of the graphs was bewildering. So I told them to think of a laser gun at the pole whose orientation was x and that fired a beam whose length was r(x). Then visualize the gun rotating through x = [0 .. 2*pi] firing beams of length r(x). (You also have to allow the gun to fire either forwards or backwards.) Then it hit me ... TURTLE! Forward, backward, right, left, ... polar coordinates! I wrote a little turtle module that drew segments from (0,0) to (r(x), x) plotting a little circle at (r(x), x). Very simple. Just a loop setting the turtle heading, calculating the distance, and then going forward (or backward). It beautifully illustrates the laser gun model, because you can actually see it happening. You don't just get a finished graph all at once. Rather, you can actually observe the process of little beams sequentially emanating from the center. I enhanced it by making each beam receive a randomly chosen color. The resulting graphs are really pretty - imagine a polar graph generated by a dense cluster of multi-colored rays from the pole - and the kids totally loved it. There were all kinds of OOOH and AHHHH around the lab the first time I said, "Ready? OK ... run it!" and they got a psychedelic Archimedean spiral. They were then to experiment with different functions for r(x) to create spirals, circles, rose curves, limacons and whatever ... I wanted them to see how they could duplicate the stuff in the text but also explore completely bizarre things on their own. Same loop, but different results depending on r(x). The cool thing was ... this was totally easy. I basically wrote the module - all the kids had to do was experiment with different functions of r(x). But since they had the source code sitting in front of them, they were free to experiment with it, and I encouraged them to do so. So one kid changed the radius of the little circles that were plotting the points. He made it REALLY BIG, and the resulting graphs were fantastic! So all the other kids wanted to do that too. The reason Kirby's post was such a cosmic coincidence is that it appeared on the VERY DAY that I decided to do this with my Analysis kids. Not that I was dealing with tables per se, but we were dealing with trig and with using the Python shell *as a trig calculator*. The timing of all of this was perfect, as the kids really did think this was cool, and one of the kids happens to have a board member as a parent : ) . I was able to say to the kids, you see, I wrote this module for you, but if this was a class where you learned to program from the beginning, you could create this kind of module yourself! So, I really enjoy the way the universe unfolds. - Michel
I humbly disagree that this is the right place to start. I teach students with diverse backgrounds -- some extremely bright and others really behind in school and using Python as a calculator is one thing they would all agree is terrifically boring and not so compelling. How many students have ever said "man, I really wish I had a trig table right now?" I agree that one way to sell programming is to incorporate it into math courses and maybe that kind of start is more appropriate there. It's not like I start with fireworks and fanfare but I'm thrilled to see Turtle be fun and compelling for students of all levels. Most of them discover Python can do math when they try to see whether they could pass in a scaling parameter and guess that multiplication is probably an asterisk. I mention order of operation and integer division and we move on. I enjoy reading this list and learn many interesting tidbits from it but, as I think I've mentioned before, I often find myself chuckling a bit. A lot of what is said on here is so incredibly esoteric and far from my students' realities! On Thu, Apr 8, 2010 at 7:43 AM, kirby urner <kirby.urner@gmail.com> wrote:
I think Guido was wise to start his tutorial by showing how we might use Python as a calculator.
We might assume many students in this day and age are quite familiar with this device, and even if they're not, the text might project one, show a picture on the screen, if what these things used to look like (still do).
However, one thing calculators lack over the old wood pulp textbooks are trig tables with multiple rows showing a lot of data at the same time. Their small "chat window" does not permit much data to be seen at one time.
Back in the day, a student could run her finger down the rows, as the number of angular degrees increase from 0 to 60 and onward to 90, perhaps all the way around to 360.
Going across the row, one would have sine and cosine, perhaps tangent. Having all the data visible at once, or spread across a few pages, inspired some insights and understanding, as one could see the trends in the numbers, plus these "click stop" rows where the numbers would suddenly be super easy, like 1/2 and 1/2 for both sine and cosine.
Calculators don't give us that kind of output, but earlier office computing machines did have paper i/o, called a tape, usually a scroll mounted on a spool and fed through a small printer.
As one added numbers, one printed to tape, perhaps a running total. The tape itself was a valuable item (especially once it had the data on it).
Large computers came with line printers that hit on continuous feed paper with holes along both sides, often with green and white stripes. I will not try to recapitulate the long history of printing devices, except to point out that computers inherited them while slide rules and calculators did not.
The equivalent in Python is stdout and/or some file in storage, on the hard drive or memory stick. The program output shown below would be an example of this kind of i/o.
Notice that unless a file name is given (optional), the data is to stdout.
I'm going to do a full 90 degrees, just to remind myself of the patterns students got in the old days, before trig tables were replaced with calculators, much as dial watches were replaced with digital ones (not necessarily a smart move in all cases).
imp.reload(newprint) <module 'newprint' from 'C:\Python26\lib\site-packages\newprint.py'> newprint.trigtable(range(91), "trigtable.txt")
The contents of trigtable.txt:
0 1.000000000 0.000000000 0.000000e+00 1 0.999847695 0.017452406 1.745506e-02 2 0.999390827 0.034899497 3.492077e-02 3 0.998629535 0.052335956 5.240778e-02 4 0.997564050 0.069756474 6.992681e-02 5 0.996194698 0.087155743 8.748866e-02 6 0.994521895 0.104528463 1.051042e-01 7 0.992546152 0.121869343 1.227846e-01 8 0.990268069 0.139173101 1.405408e-01 9 0.987688341 0.156434465 1.583844e-01 10 0.984807753 0.173648178 1.763270e-01 11 0.981627183 0.190808995 1.943803e-01 12 0.978147601 0.207911691 2.125566e-01 13 0.974370065 0.224951054 2.308682e-01 14 0.970295726 0.241921896 2.493280e-01 15 0.965925826 0.258819045 2.679492e-01 16 0.961261696 0.275637356 2.867454e-01 17 0.956304756 0.292371705 3.057307e-01 18 0.951056516 0.309016994 3.249197e-01 19 0.945518576 0.325568154 3.443276e-01 20 0.939692621 0.342020143 3.639702e-01 21 0.933580426 0.358367950 3.838640e-01 22 0.927183855 0.374606593 4.040262e-01 23 0.920504853 0.390731128 4.244748e-01 24 0.913545458 0.406736643 4.452287e-01 25 0.906307787 0.422618262 4.663077e-01 26 0.898794046 0.438371147 4.877326e-01 27 0.891006524 0.453990500 5.095254e-01 28 0.882947593 0.469471563 5.317094e-01 29 0.874619707 0.484809620 5.543091e-01 30 0.866025404 0.500000000 5.773503e-01 31 0.857167301 0.515038075 6.008606e-01 32 0.848048096 0.529919264 6.248694e-01 33 0.838670568 0.544639035 6.494076e-01 34 0.829037573 0.559192903 6.745085e-01 35 0.819152044 0.573576436 7.002075e-01 36 0.809016994 0.587785252 7.265425e-01 37 0.798635510 0.601815023 7.535541e-01 38 0.788010754 0.615661475 7.812856e-01 39 0.777145961 0.629320391 8.097840e-01 40 0.766044443 0.642787610 8.390996e-01 41 0.754709580 0.656059029 8.692867e-01 42 0.743144825 0.669130606 9.004040e-01 43 0.731353702 0.681998360 9.325151e-01 44 0.719339800 0.694658370 9.656888e-01 45 0.707106781 0.707106781 1.000000e+00 46 0.694658370 0.719339800 1.035530e+00 47 0.681998360 0.731353702 1.072369e+00 48 0.669130606 0.743144825 1.110613e+00 49 0.656059029 0.754709580 1.150368e+00 50 0.642787610 0.766044443 1.191754e+00 51 0.629320391 0.777145961 1.234897e+00 52 0.615661475 0.788010754 1.279942e+00 53 0.601815023 0.798635510 1.327045e+00 54 0.587785252 0.809016994 1.376382e+00 55 0.573576436 0.819152044 1.428148e+00 56 0.559192903 0.829037573 1.482561e+00 57 0.544639035 0.838670568 1.539865e+00 58 0.529919264 0.848048096 1.600335e+00 59 0.515038075 0.857167301 1.664279e+00 60 0.500000000 0.866025404 1.732051e+00 61 0.484809620 0.874619707 1.804048e+00 62 0.469471563 0.882947593 1.880726e+00 63 0.453990500 0.891006524 1.962611e+00 64 0.438371147 0.898794046 2.050304e+00 65 0.422618262 0.906307787 2.144507e+00 66 0.406736643 0.913545458 2.246037e+00 67 0.390731128 0.920504853 2.355852e+00 68 0.374606593 0.927183855 2.475087e+00 69 0.358367950 0.933580426 2.605089e+00 70 0.342020143 0.939692621 2.747477e+00 71 0.325568154 0.945518576 2.904211e+00 72 0.309016994 0.951056516 3.077684e+00 73 0.292371705 0.956304756 3.270853e+00 74 0.275637356 0.961261696 3.487414e+00 75 0.258819045 0.965925826 3.732051e+00 76 0.241921896 0.970295726 4.010781e+00 77 0.224951054 0.974370065 4.331476e+00 78 0.207911691 0.978147601 4.704630e+00 79 0.190808995 0.981627183 5.144554e+00 80 0.173648178 0.984807753 5.671282e+00 81 0.156434465 0.987688341 6.313752e+00 82 0.139173101 0.990268069 7.115370e+00 83 0.121869343 0.992546152 8.144346e+00 84 0.104528463 0.994521895 9.514364e+00 85 0.087155743 0.996194698 1.143005e+01 86 0.069756474 0.997564050 1.430067e+01 87 0.052335956 0.998629535 1.908114e+01 88 0.034899497 0.999390827 2.863625e+01 89 0.017452406 0.999847695 5.728996e+01 90 0.000000000 1.000000000 1.633124e+16
Here's the print function I used to generate the above.
print("{0:>5g} {1:.9f} {2:.9f} {3:e}".format( row, cos(theta), sin(theta),tan(theta)), end="\n", file= thefile)
My module starts with:
from __future__ import printfunction
which is why I get to use this in 2.6
So why use Python as a calculator again? Because it's more like an old office machine with a tape, and that restores some of what was lost when lookup tables went out of style. I should do log10 next, using range with a step or something.... Also, the trig tape should probably be 0-360 but I didn't want to waste paper. :)
Kirby _______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
This thread is very interesting. As a mater of fact, I've been trying to get 2 new course approvals at my High School for several years now and suddenly I have the go ahead for both! For more info on all the python related projects I'm involved with as summarized below, please see my blog: http://calcpage.tripod.com/shadowfax 1) Computer Math: I have run this pre AP Computer Science class for nearly 30 years. Its an introduction to programming via BASIC incorporating concepts from Discrete Mathematics. I've used every form of BASIC that ever existed (console, gui, windows, linux, etc). It was time for a change. Next year I'm using a new text by Gary & Maria Litvin called "Mathematics for the Digital Age.". This book covers all the same topics my own home-grown text does but uses python! Also, I'll be using SAGE (http://www.sagenb.org) to write the programs. 2) Calculus Research Lab: This is a course in Scientific Computing. I will take students already taking Calculus and meet with them an additional period every other day like a Science lab. We will be using online Calculus texts in pdf format on the SAGE website (http://www.sagemath.org) to reinforce concepts they learn in AP Calculus AB and AP Calculus BC class. Needless to say, I'll be using SAGE here too, but we will be more focused on Computer Algebra Systems. This course was approved last year, but the guidance counselors messed up scheduling several new courses so it didn't run this year, but we have enrollment for next year! HTH, A. Jorge Garcia http://calcpage.tripod.com Teacher & Professor Applied Mathematics, Physics & Computer Science Baldwin Senior High School & Nassau Community College
Christian Mascher 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). 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. Not very inclined to learn that.
I agree. Clarity is important, especially with young students (and us old guys who have trouble remembering Java classes :>). from math import sin, cos, tan, pi rad_per_degree = pi/180 pattern = "{0:>5g} {1:.9f} {2:.9f} {3:e}" def print_trig_table(start, stop, step): . for degrees in range(start, stop, step): . theta = degrees * rad_per_degree . data = ( degrees, cos(theta), sin(theta), tan(theta) ) . print( pattern.format(*data) ) The only thing a little non-intuitive about this is the construct pattern.format(*data). It's the same problem as with "".join(list). It feels backwards until you really grasp the concept of these methods being associated with string objects, not with the data, which can be any of various object types. Back to the subject of Python as a calculator, I have offered to mentor a proposal in Google Summer of Code seeking to improve IDLE. A key item is adding the ability to display graphics. This should be as easy as just pressing the GRAPH button, but also not limit students who want the full sophistication of a package like matplotlib. Suggestions are welcome.
On Fri, Apr 9, 2010 at 9:41 AM, Edward Cherlin <echerlin@gmail.com> 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
where
=. is assignment i. creates a list of consecutive numbers starting at 0. NB. is the comment marker o. x is pi times x % x is reciprocal of x, so o. % 180 is pi/180 |: is transpose , appends an array to another. It turns a list into a table in order to match dimensions. 1 2 3 o. x gives sine, cosine, tangent of x / creates a table with the given function (o.) applied to two list arguments
Thanks Ed. Nostalgia trip. Yeah, my first reaction was similar to Christians: if we need to learn a whole new language to do a trig table, that's hardly productive-seeming. How to use the tools we already know? And yet I've suggested a minimum of two languages, even if foreground emphasis is given to just one. The other might be purposely off-beat, like COBOL or something. REBOL anyone? Or it might be a closer relative to Python, such as JavaScript (for which Alan Kay has a lot of respect). NB. for nota bene as I recall. I always treasure the Italian influence. APL was (is) like Greek. Below is the source for the trig table generator, a snap shot. The inner circle on this one, which includes Chairman Steve, is debating whether TypeError should really be caught. On the "aff side" (as debaters say, when arguing in the affirmative), a capricious, not necessarily malicious user might feed in a filename of like 3, or type([ ]). That's not a filename at all, so catch it with TypeError. On the "neg side", there's a school of thought which says exceptions are about catching "honest mistakes" i.e. the exception suite is showing what one might legitimately expect as an error: in this case an IOError because the file cannot be created (e.g. is write-protected, is specified in a non-existent directory or something of that nature). I forget how J handles exceptions of this nature (wrong path, write-protected file) -- I seem to recall a bunch of system call features, but it has been some years... Kirby === def trigtable(therange, fileout = None): """ Print a trig table, to stdout or to a file http://mail.python.org/pipermail/edu-sig/2010-April/009890.html Rewrite with "with statement"? """ if fileout: try: thefile = open(fileout, 'w') #lets hope for a legal filename (optional path part) except (TypeError, IOError) as exc: print("Unable to open file: {0}".format(fileout)) raise else: thefile = sys.stdout for row in therange: theta = radians(row) print("{0:>5g} {1:.9f} {2:.9f} {3:e}".format( row,cos(theta),sin(theta),tan(theta)),file= thefile) if fileout: thefile.close()
The result is a 91 row, 4 column table of angles and trig function values.
-- 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/
On Sat, Apr 10, 2010 at 9:23 AM, Helene Martin <lognaturel@gmail.com> wrote:
I humbly disagree that this is the right place to start. I teach students with diverse backgrounds -- some extremely bright and others really behind in school and using Python as a calculator is one thing they would all agree is terrifically boring and not so compelling. How many students have ever said "man, I really wish I had a trig table right now?"
Yes Helen, I really do understand this concern. It's a concern that somewhat worries me though. Maybe the problem is students aren't being paid to be there. Should we offer frequent flyer miles for assignments turned in? On Delta?
I agree that one way to sell programming is to incorporate it into math courses and maybe that kind of start is more appropriate there.
Ah, now I see the problem. There's this notion of trying to "sell programming" whereas world class schools already mix computer programming with math. Speaking of which, check out this cool steampunk monitor: http://steampunkworkshop.com/lcd.shtml
It's not like I start with fireworks and fanfare but I'm thrilled to see Turtle be fun and compelling for students of all levels. Most of them discover Python can do math when they try to see whether they could pass in a scaling parameter and guess that multiplication is probably an asterisk. I mention order of operation and integer division and we move on.
My students know they likely won't be taken seriously if they boast of math skills and yet evidence no ability to think like computer scientists. Knowing how to program is just one of those "goes with the territory" kinds of skills associated with STEM. My bias derives from literature funded in some measure by DARPA-with-a-backwards-R -- for "radical" (a CP4E commercial). Why is OLPC / G1G1 is so important: to help kids elsewhere from suffering the same fate.
I enjoy reading this list and learn many interesting tidbits from it but, as I think I've mentioned before, I often find myself chuckling a bit. A lot of what is said on here is so incredibly esoteric and far from my students' realities!
I teach Pythonic Math off and on through a nonprofit backed by Silicon Forest interests. The view of many Silicon Foresters is that the traditional math education being provided in high schools is simply a forced march in the wrong direction. My students have been highly diverse, including a Goth girl who hated school (wicked smart though), many with English as a 2nd language, many home schoolers. Lots of disaffected, refugees. Those doing well on the calculator / calculus track may see no reason to leave The Matrix. Kirby
(Speaking as a high school teacher with ~120 students in 3 different levels of computer science courses in a public school in Seattle) I guess my point is that computer science in general and programming specifically have so much opportunity to be exciting for both the majority of students who are burned out on "traditional classes" as well as the minority of students who "know they likely won't be taken seriously if they boast of math skills and yet evidence no ability to think like computer scientists" (come on, that requires a high level of intellectual sophistication and is REALLY rare). I think we need to exploit that opportunity to its full potential. I steer away from purely math-oriented examples because they alienate the majority of my students. It's a tricky balancing act and I certainly can't claim to have figured it out. Selfishly, I'd like to see the brilliant minds in this group sharing examples or ideas that the average 13-18 year old would find exciting and worthy of further exploration. For example, a while back, Gregor Lingl shared a Turtle Graphics example in which a turtle performs a random walk collecting "coins" as it goes. There are lots of interesting mathematical concepts to discuss in there and it requires students to use a lot of programming tools and ideas but it also has a "cool" factor. Furthermore, the basic idea is reasonably simple to understand and to see a use for (we can simulate other kinds of real-world situations, etc). I agree that we as educators are not entertainers and that learning is important for the sake of learning but at the same time, we need to be careful not to on one hand deplore the fact that students aren't taking computing courses while on the other creating courses which are dry and esoteric. Again, I don't claim to have figured it out. I say all this but at the same time, I'm wary of courses which expose students to computing applications without giving them many skills (programming/critical thinking/math/algorithmics) or which rely entirely on one application space (animation, games, personal robots, whatever) to be "sexy" and capture students' attention. I suppose it's all about goals. One potential goal for using Python in teaching is to reinforce and develop mathematical reasoning skills and it seems like that's the focus of a lot of the people on this list. I believe that's a worthy goal and I try to accomplish some of that in my courses as well, but it's not my primary goal. I guess my primary goal is to encourage students to see software as something they can be a part of rather than simply as something they consume or are forced to live with. I don't have a ton of concrete ideas on how to do that -- I think I've somehow crafted successful courses on intuition more than anything else and can't really formally express what I'm doing yet -- but I really do see it as a very different goal that leads to very different types of courses. And maybe I'm the only one who sees the majority of examples and ideas on this list as esoteric! It's something I often find myself thinking so I thought I'd try to describe and explain a bit of my discomfort. Not sure I really expressed myself very well -- sorry! Hélène. On Sat, Apr 10, 2010 at 4:06 PM, kirby urner <kirby.urner@gmail.com> wrote:
On Sat, Apr 10, 2010 at 9:23 AM, Helene Martin <lognaturel@gmail.com> wrote:
I humbly disagree that this is the right place to start. I teach students with diverse backgrounds -- some extremely bright and others really behind in school and using Python as a calculator is one thing they would all agree is terrifically boring and not so compelling. How many students have ever said "man, I really wish I had a trig table right now?"
Yes Helen, I really do understand this concern. It's a concern that somewhat worries me though. Maybe the problem is students aren't being paid to be there. Should we offer frequent flyer miles for assignments turned in? On Delta?
I agree that one way to sell programming is to incorporate it into math courses and maybe that kind of start is more appropriate there.
Ah, now I see the problem. There's this notion of trying to "sell programming" whereas world class schools already mix computer programming with math. Speaking of which, check out this cool steampunk monitor: http://steampunkworkshop.com/lcd.shtml
It's not like I start with fireworks and fanfare but I'm thrilled to see Turtle be fun and compelling for students of all levels. Most of them discover Python can do math when they try to see whether they could pass in a scaling parameter and guess that multiplication is probably an asterisk. I mention order of operation and integer division and we move on.
My students know they likely won't be taken seriously if they boast of math skills and yet evidence no ability to think like computer scientists. Knowing how to program is just one of those "goes with the territory" kinds of skills associated with STEM. My bias derives from literature funded in some measure by DARPA-with-a-backwards-R -- for "radical" (a CP4E commercial). Why is OLPC / G1G1 is so important: to help kids elsewhere from suffering the same fate.
I enjoy reading this list and learn many interesting tidbits from it but, as I think I've mentioned before, I often find myself chuckling a bit. A lot of what is said on here is so incredibly esoteric and far from my students' realities!
I teach Pythonic Math off and on through a nonprofit backed by Silicon Forest interests. The view of many Silicon Foresters is that the traditional math education being provided in high schools is simply a forced march in the wrong direction. My students have been highly diverse, including a Goth girl who hated school (wicked smart though), many with English as a 2nd language, many home schoolers. Lots of disaffected, refugees. Those doing well on the calculator / calculus track may see no reason to leave The Matrix. Kirby
On Sat, Apr 10, 2010 at 9:25 PM, Helene Martin <lognaturel@gmail.com> wrote:
(Speaking as a high school teacher with ~120 students in 3 different levels of computer science courses in a public school in Seattle)
That's hard work and you have my respect for it. I started out as a full time high school teacher, mostly math, but only stayed with St. Dominic Academy (Jersey City) for two years. Later I wound up at McGraw-Hill and looked from the text book publisher angle (I was on the 28th floor of a skyscraper in Rockefeller Center, commuting from my friend Ray Simon's apartment in Brooklyn.
I guess my point is that computer science in general and programming specifically have so much opportunity to be exciting for both the majority of students who are burned out on "traditional classes" as well as the minority of students who "know they likely won't be taken seriously if they boast of math skills and yet evidence no ability to think like computer scientists" (come on, that requires a high level of intellectual sophistication and is REALLY rare). I think we need to exploit that opportunity to its full potential.
I steer away from purely math-oriented examples because they alienate the majority of my students. It's a tricky balancing act and I certainly can't claim to have figured it out. Selfishly, I'd like to see the brilliant minds in this group sharing examples or ideas that the average 13-18 year old would find exciting and worthy of further exploration. For example, a while back, Gregor Lingl shared a Turtle Graphics example in which a turtle performs a random walk collecting "coins" as it goes. There are lots of interesting mathematical concepts to discuss in there and it requires students to use a lot of programming tools and ideas but it also has a "cool" factor. Furthermore, the basic idea is reasonably simple to understand and to see a use for (we can simulate other kinds of real-world situations, etc).
Yes, and I would not want to get in your way. What I like to do in some of my classes (I still get teaching gigs through the private sector) is show up with an XO or two, those One Laptop per Child gizmos that Ed does Turtle Art for. Our XO HQS in Portland, Oregon is one Duke's Landing on SE Belmont, where Michael D. is tending mine among others, got me a developer's key and everything, upgraded me to the latest Sugar. http://www.flickr.com/search/?q=XO&w=17157315@N00 (tagged with XO in my Photostream) http://www.flickr.com/photos/17157315@N00/4104822975/ http://www.flickr.com/photos/17157315@N00/4105591168/ (at Duke's specifically) The Python application that puts Python most in one's scope is called Pippy. The fact that Sugar itself is a Python program will escape notice unless they somehow get access to this lore, through a teacher or other peer, perhaps via the Web. The last gig I did was for a Free School event near Duke's, a place called Flipside around the corner from Muddy Water's. http://worldgame.blogspot.com/2010/03/radical-math.html Anyway, that's a lot of Portland geography most people here won't know (check Google Earth if curious, or Google Street Views -- here's Duke's http://preview.tinyurl.com/ydeyzjl ). Also, in the public sector, I took the whole of Winterhaven's 8th grade for a spin. Winterhaven is a one of Portland public's and a kind of geek Hogwarts for some families. It only goes up through middle school though (8th grade). What I taught there was a mixture of Python and GIS/GPS subjects, per recommendations from other faculty. The thinking has evolved since then to where we might adapt this for high schools by having kids actually venture forth from their buildings in teams, riding the buses and such, following various clues -- a kind of geocaching as an organized sport, but also an academic exercise. I could send links, but this is already pretty long. Here's a peak at some of the work that we accomplished at Winterhaven. http://www.4dsolutions.net/ocn/winterhaven/
I agree that we as educators are not entertainers and that learning is important for the sake of learning but at the same time, we need to be careful not to on one hand deplore the fact that students aren't taking computing courses while on the other creating courses which are dry and esoteric.
What we're trying to get off the ground in Oregon are pilot classes that go towards the 3 year math requirement (mandatory for a h.s. diploma) yet include computer programming as a part of the content, maybe (I personally would hope) more of this GIS/GPS stuff. It's a math course in other words, and yet Python might be used for a language, like if teachers go with the Litvins' text, which I highly recommend, among others. In a hands-on music class, students pick an instrument. In hands-on math, you pick a computer language (at least one, but one leads to another if a student gets curious). I just got a mailing from Saturday Academy today in fact, listing some of my students for such a class at Reed College (just a short pilot). I call my portion Martian Math and have pages on Wikieducator about it. These will be younger students than I'm used to. My associate Glenn Stockton is doing Neolithic Math and Tai Chi with the same group. Neolithic Math, like Martian Math, is just branding we're using, hoping to keep things interesting. In terms of content, you'd want to look at the write-up, but it includes Euclidean basics such as the Vesica Pices and generating edge lengths with string and stick (compass and ruler), using these edges in constructions (such as polyhedra). You may have seen the polyhedra go by in a short script here recently. Obviously some of this material is further down the timeline than either the Paleolithic, Neolithic or Mesolithic eras. Some of it is downright futuristic, which is where my Martian Math stuff kicks in. We try to provide some continuity in our students' experience, picking up on some cues from Ralph Abraham at the Oregon Math Summit in 1997, Sir Roger Penrose a keynote. He suggested a more time-line based approach, more direct linking to history.
Again, I don't claim to have figured it out. I say all this but at the same time, I'm wary of courses which expose students to computing applications without giving them many skills (programming/critical thinking/math/algorithmics) or which rely entirely on one application space (animation, games, personal robots, whatever) to be "sexy" and capture students' attention.
I'm wary of math classes that use boring calculators. When I say lets use Python as a calculator instead of using a calculator, I'm talking about stopping using calculators in math class and using Python instead. Picture the NCTM conference with a Ruby booth, a Scheme booth, a J booth and so on. This is the National Council of Teachers of Mathematics and yet industrial strength computer languages are treated on a par with the calculators. What a concept! Hooray for less bigotry against thinking like computer scientists. 'Concrete Mathematics' broke some ice maybe.
I suppose it's all about goals. One potential goal for using Python in teaching is to reinforce and develop mathematical reasoning skills and it seems like that's the focus of a lot of the people on this list. I believe that's a worthy goal and I try to accomplish some of that in my courses as well, but it's not my primary goal. I guess my primary goal is to encourage students to see software as something they can be a part of rather than simply as something they consume or are forced to live with. I don't have a ton of concrete ideas on how to do that -- I think I've somehow crafted successful courses on intuition more than anything else and can't really formally express what I'm doing yet -- but I really do see it as a very different goal that leads to very different types of courses.
I appreciate your commitment to keeping interest levels high. You rightly point out how I risk coming across as some kind of killjoy by wanting to take a colorful bright computer and make it seem like a boring old calculator. Of all the fun and interesting things one might do... But I'm not talking about using it *exclusively* in that way.
And maybe I'm the only one who sees the majority of examples and ideas on this list as esoteric! It's something I often find myself thinking so I thought I'd try to describe and explain a bit of my discomfort. Not sure I really expressed myself very well -- sorry!
Hélène.
I think "esoteric" and/or "avant-garde" are fair characterizations. I'm glad you've joined us here, as a fully participating individual and professional, Seattle-based -- just 3.5 hours from here by car on I-5, for those of you unfamiliar with this bio-region. I'm wondering if you've gone through Allen Downey's work, and/or Jeff Elkner's: http://www.greenteapress.com/thinkpython/thinkpython.html This book is free to public schools (is free period). If a school is spending big bucks on a textbook about programming, this could be a savings, especially with Python itself being both free and open source. Here's a rave review by Hong Feng of Allen's book in the series about Java. http://www.free-soft.org/FSM/english/issue01/bookreview.html Whereas I'm a huge fan of Python, I wouldn't discourage using some Java or JavaScript in a math class as well. I'm all about leaving it to local faculties to create their own courseware. As long as teachers retain their professional freedom to innovate, I think we'll gradually see more of these math and computer science hybrids that include more geography (Google Earth etc.). Kirby
On Sat, Apr 10, 2010 at 09:33, Christian Mascher <christian.mascher@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@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/
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@gmail.com> wrote:
On Sat, Apr 10, 2010 at 09:33, Christian Mascher <christian.mascher@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@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@python.org http://mail.python.org/mailman/listinfo/edu-sig
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.
Fibonacci's Liber Abaci introduced the Indian/Arabic number system, based on the abacus. The place value system corresponds to the rods of the abacus, with the zero corresponding to a rod with no beads (a place holder). Roman numerals, in contrast, have nothing to do with abacus notation and have no place value e.g XIV for 14 or MMMCCC for 3300. http://www.novaroma.org/via_romana/numbers.html Roman numbers suck for arithmetic operations of any kind IMO.
numbers =. i. 11 NB. 0..10
...similar to Python's range built-in.
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.
One could argue any computer language comprises a math notation. Also, one could argue that all creatures are mathematicians in some innate way (Keith Devlin's point). Carving out a special caste of humans and calling them "mathematicians" is a practice within various institutions. I've noticed many of these institutions promote a kind of snobbery, but then such is the human ego.
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.
Note that numpy shares some of APL's and J's ability to shape data into multi-dimensional objects with rank.
import numpy a = numpy.array(range(10)) a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) a.reshape((2,5)) array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) a = a.reshape((2,5)) a array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) numpy.concatenate((a,a)) array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) numpy.concatenate((a,a), axis=1) array([[0, 1, 2, 3, 4, 0, 1, 2, 3, 4], [5, 6, 7, 8, 9, 5, 6, 7, 8, 9]])
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.
Math notations, like music notations, are the common heritage of humankind, not the special property of an elite caste of human. That being said, many math notations, including computer languages, are quite opaque until deciphered. Those already "in the know" may exult in their exclusive knowledge, that's been true since time immemorial. Those cryptic expressions on a T-shirt from the MIT gift shop serve as mnemonics, are reminders of long hours spent unpacking the meanings. To a non-initiate, it all looks like so much unreadable APL. :) Of course non-math notations share in these encrypting / compacting capabilities. You needn't use math notations to create operational systems (institutions) with their respective insiders and outsiders, with insiders often ranked according to their "degree" of inner-ness. We've not really defined "mathematics", "mathematician" or "math notation" for the purposes of this thread, so maybe one could argue that all notations are inherently mathematical in that they're aids to thought processes, which processes by their very nature are computational in some degree. Is Chinese a math notation? Write a 500 word essay on why it is. Write another 500 word essay on why it isn't.
They are constantly inventing more of it. What you call math notation is known to mathematicians as "arithmetic".
Iverson called APL an executable math notation (MN). MNs were divided into machine-executable and not. Leibniz dreamed of machine-executable logical languages. We have them now, call them "computer languages".
There is no standard math notation.
Nor is there a strongly fixed meaning to the concept of "math notation". Is Python a math notation? One could argue that it is. Or call it a machine-executable logic.
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.
"Like" may not be the operative word in all cases. Some people just don't have the privilege to study that much. I wish that they did. Socrates worked with that slave boy to show how intelligence was innate, but he didn't manage to abolish slavery. This is clearly a Python list, so I'm never going to apologize for showing a Pythonic solution or implementation that could just as well be done in another language in far fewer steps. I'm happy to have APL and J mentioned for comparing and contrasting (I mention them myself), but if one judges one needs to stick with Python for a given task (because it's what they know, and because the task is looming), then it's hardly my place to judge them mentally and/or morally deficient in some way.
Just my 2c
Christian
Thanks for your remarks Christian. Don't let this Ed character bully or intimidate you. He likes to show off, which is fine, but he lacks diplomatic skills IMO. But then some say the same about me. Kirby
_______________________________________________ Edu-sig mailing list Edu-sig@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@python.org http://mail.python.org/mailman/listinfo/edu-sig
Edward Cherlin wrote:
On Sat, Apr 10, 2010 at 09:33, Christian Mascher <christian.mascher@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
<snip>
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.
I think what Christian means to say is that Python is much nearer to a notation (pseudocode) that might be used by scientists and engineers who are trying to express an idea involving computation, without relying on a specific language. Of course, there is no "standard" pseudocode, but if you look at textbooks that are most successful at expressing algorithms this way (my examples would be from engineering - Hachtel & Somenzi on Logic Synthesis, Stinson on Cryptography) what you see is a notation very close to Python. Pseudocode has to be self-explanatory. There is no introductory chapter on how to read it. Likewise, an introductory computer language should be close to self-explanatory. It will be difficult to get math and science teachers to accept it, if they have to make extra efforts explaining the notation. Getting math and science teachers to accept computation as a vital part of their curricula is my current focus, so I wouldn't try to push something like your example above. Python is just a means to an end, the closest thing we have to pseudocode. When someone who favors another language (typically Java) asks me why Python, I find the comparison to pseudocode to be the best answer. Specific examples, like the absence of type declarations, tends to invite unthinking reactions. (Students will make too many errors.) Even something as simple as requiring correct indentation is not obvious to someone who hasn't used Python. (Although that one does have some appeal to teachers who have had to read sloppy student code.) Ultimately, it is word-of-mouth, one teacher telling another, that I think will decide which language gets used. -- Dave ************************************************************ * * David MacQuigg, PhD email: macquigg at ece.arizona.edu * * * Research Associate phone: USA 520-721-4583 * * * * ECE Department, University of Arizona * * * * 9320 East Mikelyn Lane * * * * http://purl.net/macquigg Tucson, Arizona 85710 * ************************************************************ *
Well put David. My choices are always about me and a particular situation. I would not teach J to beginners or to people not crunching a lot of mathematical stuff regularly, but for the professional statisticians and electronic traders I know, J is a fabulous language, and very worth the modest learning curve. J is an interesting case. Iverson did not totally open up the source. JSoftware still sells that to big users who want extra insurance for the future of their codebase, but the very powerful language is freely available. The statisticians in my university are talking about dumping traditional massively expensive statistical environments, not for a switch to some Python tool, but to J and its freely available libraries. I fear I sometimes push Python in ways that can easily be interpreted as meaning for essentially all people and all situations. I know that inside my head I am not thinking about so general a situation, but I think I could often communicate it better. Andy On Sun, Apr 11, 2010 at 6:50 PM, David MacQuigg <macquigg@ece.arizona.edu>wrote:
Edward Cherlin wrote:
On Sat, Apr 10, 2010 at 09:33, Christian Mascher <christian.mascher@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
<snip>
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.
I think what Christian means to say is that Python is much nearer to a notation (pseudocode) that might be used by scientists and engineers who are trying to express an idea involving computation, without relying on a specific language. Of course, there is no "standard" pseudocode, but if you look at textbooks that are most successful at expressing algorithms this way (my examples would be from engineering - Hachtel & Somenzi on Logic Synthesis, Stinson on Cryptography) what you see is a notation very close to Python.
Pseudocode has to be self-explanatory. There is no introductory chapter on how to read it. Likewise, an introductory computer language should be close to self-explanatory. It will be difficult to get math and science teachers to accept it, if they have to make extra efforts explaining the notation. Getting math and science teachers to accept computation as a vital part of their curricula is my current focus, so I wouldn't try to push something like your example above.
Python is just a means to an end, the closest thing we have to pseudocode. When someone who favors another language (typically Java) asks me why Python, I find the comparison to pseudocode to be the best answer. Specific examples, like the absence of type declarations, tends to invite unthinking reactions. (Students will make too many errors.) Even something as simple as requiring correct indentation is not obvious to someone who hasn't used Python. (Although that one does have some appeal to teachers who have had to read sloppy student code.) Ultimately, it is word-of-mouth, one teacher telling another, that I think will decide which language gets used.
-- Dave
************************************************************ * * David MacQuigg, PhD email: macquigg at ece.arizona.edu * * * Research Associate phone: USA 520-721-4583 * * * * ECE Department, University of Arizona * * * * 9320 East Mikelyn Lane * * * * http://purl.net/macquigg Tucson, Arizona 85710 * ************************************************************ *
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- Andrew N. Harrington Director of Academic Programs Computer Science Department Loyola University Chicago 512B Lewis Towers (office) Snail mail to Lewis Towers 416 820 North Michigan Avenue Chicago, Illinois 60611 http://www.cs.luc.edu/~anh Phone: 312-915-7982 Fax: 312-915-7998 gpd@cs.luc.edu for graduate administration upd@cs.luc.edu for undergrad administration aharrin@luc.edu as professor
On Sun, Apr 11, 2010 at 04:50:34PM -0700, David MacQuigg wrote:
Python is just a means to an end, the closest thing we have to pseudocode.
I agree with you. I've heard people say that Scheme is the most like algebra. I don't know exactly what that means or if that means Scheme is the simplest introductory language. My hunch is that Python is better. cs
As a Computer Science teacher, I am used to teaching my students a number of introductory languages before they get to AP CS. I am never satisfied with just one approach. I am going to dump all that in favor of python next year. So, if Computer Science teachers end up using python, I will be in the odd position of teaching only python for 2 years of High School. You know, that wouldn't be all bad, my students would then have a lot more experience with python before the AP exam. As a Math teacher, this scenario is also appealing as I would have more time fo math topics too (Discrete Math or Pythonic Math)! HTH, A. Jorge Garcia http://calcpage.tripod.com Teacher & Professor Applied Mathematics, Physics & Computer Science Baldwin Senior High School & Nassau Community College
On Sun, Apr 11, 2010 at 17:51, kirby urner <kirby.urner@gmail.com> wrote:
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.
The chapter on interest calculations in Liber Abaci was particularly important.
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.
Fibonacci's Liber Abaci introduced the Indian/Arabic number system, based on the abacus.
No, in spite of the title, not based on the abacus, any more than calculus is based on pebbles. http://faculty.evansville.edu/ck6/bstud/fibo.html Though the title of the book suggests the use of the abacus, in fact Fibonacci freed arithmetic from calculations using the abacus.
The place value system corresponds to the rods of the abacus, with the zero corresponding to a rod with no beads (a place holder).
Roman numerals, in contrast, have nothing to do with abacus notation and have no place value e.g XIV for 14 or MMMCCC for 3300.
The Japanese, Chinese, and Roman abacI use beads or pebbles (calculi) with values of 1 and 5. http://en.wikipedia.org/wiki/Abacus http://en.wikipedia.org/wiki/Roman_abacus The Roman notation uses letters with values of 1 and 5 times a power of 10, so that one can write down the Roman numeral for an abacus setting simply by writing the letter corresponding to each calculus on the board, or put a number on the board by placing a pebble for each letter. Adding and subtracting Roman numerals is isomorphic with manipulating an abacus. 7 --> 5+2 --> VII 3 --> 0+3 --> III VII + III --> VIIIII --> VV --> X 5+2 + 0+3 --> 5+5 --> 0+1,0+0 and similarly for LXX + XXX etc.
http://www.novaroma.org/via_romana/numbers.html
Roman numbers suck for arithmetic operations of any kind IMO.
numbers =. i. 11 NB. 0..10
...similar to Python's range built-in.
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.
One could argue any computer language comprises a math notation.
In the mathematical theory of languages, we can regard any Turing-complete symbol-and-rule set as a way to express all of mathematics, but that is outside the question of what language to teach or publish in, when the aim is communication with humans.
Also, one could argue that all creatures are mathematicians in some innate way (Keith Devlin's point).
So they are, beyond argument. So why are we telling them how they want to do math and computing? The mindset of "When I want to hear your opinion, I'll tell it to you" is what I hate most about education systems of the past and present.
Carving out a special caste of humans and calling them "mathematicians" is a practice within various institutions.
Mathematicians are not a caste, but a guild with stiff entry requirements. I am not a full member, since I quit after my BA and went to teach in the Peace Corps.
I've noticed many of these institutions promote a kind of snobbery, but then such is the human ego.
See The Theory of the Leisure Class, by Thorstein Veblen, and Buddhist teachings on no-self. Reverse snobbery is also a feature of human ego.
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.
Note that numpy shares some of APL's and J's ability to shape data into multi-dimensional objects with rank.
Yes. It would be more productive to discuss numpy here rather than fight a meaningless rwar.
import numpy a = numpy.array(range(10)) a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) a.reshape((2,5)) array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) a array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) a = a.reshape((2,5)) a array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) numpy.concatenate((a,a)) array([[0, 1, 2, 3, 4], [5, 6, 7, 8, 9], [0, 1, 2, 3, 4], [5, 6, 7, 8, 9]]) numpy.concatenate((a,a), axis=1) array([[0, 1, 2, 3, 4, 0, 1, 2, 3, 4], [5, 6, 7, 8, 9, 5, 6, 7, 8, 9]])
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.
Math notations, like music notations, are the common heritage of humankind, not the special property of an elite caste of human.
That being said, many math notations, including computer languages, are quite opaque until deciphered.
Those already "in the know" may exult in their exclusive knowledge, that's been true since time immemorial.
Those cryptic expressions on a T-shirt from the MIT gift shop serve as mnemonics, are reminders of long hours spent unpacking the meanings.
To a non-initiate, it all looks like so much unreadable APL. :)
Of course non-math notations share in these encrypting / compacting capabilities. You needn't use math notations to create operational systems (institutions) with their respective insiders and outsiders, with insiders often ranked according to their "degree" of inner-ness.
We've not really defined "mathematics", "mathematician" or "math notation" for the purposes of this thread, so maybe one could argue that all notations are inherently mathematical in that they're aids to thought processes, which processes by their very nature are computational in some degree.
Is Chinese a math notation? Write a 500 word essay on why it is. Write another 500 word essay on why it isn't.
They are constantly inventing more of it. What you call math notation is known to mathematicians as "arithmetic".
Iverson called APL an executable math notation (MN). MNs were divided into machine-executable and not.
Leibniz dreamed of machine-executable logical languages. We have them now, call them "computer languages".
There is no standard math notation.
Nor is there a strongly fixed meaning to the concept of "math notation". Is Python a math notation? One could argue that it is. Or call it a machine-executable logic.
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.
"Like" may not be the operative word in all cases. Some people just don't have the privilege to study that much. I wish that they did.
Socrates worked with that slave boy to show how intelligence was innate, but he didn't manage to abolish slavery.
This is clearly a Python list, so I'm never going to apologize for showing a Pythonic solution or implementation that could just as well be done in another language in far fewer steps.
I'm happy to have APL and J mentioned for comparing and contrasting (I mention them myself), but if one judges one needs to stick with Python for a given task (because it's what they know, and because the task is looming), then it's hardly my place to judge them mentally and/or morally deficient in some way.
Just my 2c
Christian
Thanks for your remarks Christian. Don't let this Ed character bully or intimidate you. He likes to show off, which is fine, but he lacks diplomatic skills IMO. But then some say the same about me.
I don't like to show off. I like to get facts straight. The lack of diplomatic skills is a symptom of my strong ADHD.
Kirby
_______________________________________________ Edu-sig mailing list Edu-sig@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/
On Sun, Apr 11, 2010 at 21:03, Andrew Harrington <aharrin@luc.edu> wrote:
Well put David.
My choices are always about me and a particular situation. I would not teach J to beginners
I would use the +-*% (+-×÷) subset of J in first grade for arithmetic, alongside Turtle Art (with stack tiles), and Etoys, including Scratch. By third grade, we could introduce programming in J/APL, Logo/LISP, FORTH, Python, and Smalltalk. At some point, we could show how each represents the same internal parse tree in quite different textual forms. What the LISPers call "syntactic sugar". This is a fundamental Computer Science concept.
or to people not crunching a lot of mathematical stuff regularly, but for the professional statisticians and electronic traders I know, J is a fabulous language, and very worth the modest learning curve.
J would enable children to crunch data sets easily, allowing a radical deepening of every subject. The learning curve would be very modest when integrated with arithmetic and elementary science, and applied to languages, history, geography, health, and gym.
J is an interesting case. Iverson did not totally open up the source.
There is a published version of the source for an earlier version of J, without the IDE, graphics, and so on. I have a copy. There has been some talk of creating a Free Software version, but no activity that I know of. However, Iverson's son Eric is considering GPLing some version of J in support of One Laptop Per Child and Sugar Labs. I need to bother him about it again, because I am about to apply for two XO 1.5 units to use in preparing an introductory text on electricity. It will use the built-in digital oscilloscope function (Measure) on the XO, among other things, and will explain how to build and take data from measuring instruments. I would be interested in working with Pythonistas on a version using numpy and scipy.
JSoftware still sells that to big users who want extra insurance for the future of their codebase, but the very powerful language is freely available. The statisticians in my university are talking about dumping traditional massively expensive statistical environments, not for a switch to some Python tool, but to J and its freely available libraries.
I fear I sometimes push Python in ways that can easily be interpreted as meaning for essentially all people and all situations. I know that inside my head I am not thinking about so general a situation, but I think I could often communicate it better.
Andy
On Sun, Apr 11, 2010 at 6:50 PM, David MacQuigg <macquigg@ece.arizona.edu> wrote:
Edward Cherlin wrote:
On Sat, Apr 10, 2010 at 09:33, Christian Mascher <christian.mascher@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
<snip>
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.
I think what Christian means to say is that Python is much nearer to a notation (pseudocode) that might be used by scientists and engineers who are trying to express an idea involving computation, without relying on a specific language. Of course, there is no "standard" pseudocode, but if you look at textbooks that are most successful at expressing algorithms this way (my examples would be from engineering - Hachtel & Somenzi on Logic Synthesis, Stinson on Cryptography) what you see is a notation very close to Python.
Pseudocode has to be self-explanatory. There is no introductory chapter on how to read it.
We consider pseudocode "self-explanatory" to those who already know the syntax of a similar language. But it is not so, any more than mousing and icons is "intuitive" for those who have never seen them. I consider my J example _with explanatory comments_ to be simpler than the Python I was starting from, where it must be assumed that students have had a prior introduction to the syntax.
Likewise, an introductory computer language should be close to self-explanatory. It will be difficult to get math and science teachers to accept it, if they have to make extra efforts explaining the notation. Getting math and science teachers to accept computation as a vital part of their curricula is my current focus, so I wouldn't try to push something like your example above.
There are a number of math, science, and Computer Science textbooks in which APL or J is the math notation throughout, being taught only as needed without interrupting the main sequence of ideas. I can give you citations. There is very little done in this manner in any other programming language. (If you have seen some, please send me the information.) I much prefer this approach to the usual one of teaching programming language syntax and semantics in a vacuum, with no systematic application to anything.
Python is just a means to an end, the closest thing we have to pseudocode.
APLers tend to find pseudocode irritating, because the APL is shorter and clearer to those who can read it.
When someone who favors another language (typically Java) asks me why Python, I find the comparison to pseudocode to be the best answer. Specific examples, like the absence of type declarations, tends to invite unthinking reactions. (Students will make too many errors.) Even something as simple as requiring correct indentation is not obvious to someone who hasn't used Python. (Although that one does have some appeal to teachers who have had to read sloppy student code.) Ultimately, it is word-of-mouth, one teacher telling another, that I think will decide which language gets used.
-- Dave
************************************************************ * * David MacQuigg, PhD email: macquigg at ece.arizona.edu * * * Research Associate phone: USA 520-721-4583 * * * * ECE Department, University of Arizona * * * * 9320 East Mikelyn Lane * * * * http://purl.net/macquigg Tucson, Arizona 85710 * ************************************************************ *
_______________________________________________ Edu-sig mailing list Edu-sig@python.org http://mail.python.org/mailman/listinfo/edu-sig
-- Andrew N. Harrington Director of Academic Programs Computer Science Department Loyola University Chicago 512B Lewis Towers (office) Snail mail to Lewis Towers 416 820 North Michigan Avenue Chicago, Illinois 60611
http://www.cs.luc.edu/~anh Phone: 312-915-7982 Fax: 312-915-7998 gpd@cs.luc.edu for graduate administration upd@cs.luc.edu for undergrad administration aharrin@luc.edu as professor
_______________________________________________ Edu-sig mailing list Edu-sig@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/
The chapter on interest calculations in Liber Abaci was particularly important.
I'm sure you're right. Euler added to the interest calculations literature as well. Nasty stuff, interest, really gets out of hand. But then nature is full of exponentially curved responses. I don't wonder that humans have a heckuva time figuring any of it out. Simulations have been helpful. Lets do more of those. Threading on math-teach about that (instead of "programming games" we're "programming simulations" -- then it's less trivial all of a sudden).
No, in spite of the title, not based on the abacus, any more than calculus is based on pebbles.
Understood: Fibonacci was showing algorithms that'd obviate the need for a contraption (device). I was simply pointing out that the Indian-Arabic numbers map to the abacus, with 0 holding a "no beads" position i.e. the symbolic sand-scribbles make up for not having a real device handy. You're saying Roman numerals mapped to the abacus too, which somewhat surprises me, as I don't see what they're using for a zero (no beads). It all seems really cumber- some, but I guess that's because I'm not Roman (I only lived in Rome for six years and by then most had converted to the new system -- I spent my first year learning about non-decimal money but that's cuz this was Junior English and I had to wear a tie).
In the mathematical theory of languages, we can regard any Turing-complete symbol-and-rule set as a way to express all of mathematics, but that is outside the question of what language to teach or publish in, when the aim is communication with humans.
One could argue that I suppose. I hail from the Wittgenstein camp. We don't necessarily boast of any "mathematical theory of languages". I consider the basis of mathematics more anthropological than logical, if ya know what I mean. When I teach Martian Math, it's all about Axiom Castles along the beach, picturing Oregon Coast. These sandcastles build on axiomatic foundations, but what underpins them all (sand) is not axiomatic and does not forbid multiple sandcastles. Is chess a mathematical language game? Must there be a 'right answer'? Must all mathematical structures be Axiom Castles? Good questions. Martian Math dispenses with a lot of 20th century "dimension talk" i.e. it uses the "dimension" concept differently. So what though? There are already multiple meanings after the shake-out, with Coxeter's not the same as Einstein's, per page 119 of 'Regular Polytopes' ( "tesseract not equal time machine" might be a fun way to memorize this fact). I bring in Karl Menger's "geometry of lumps" and link it to a minimum topology (the simplex) of unit volume, thereby getting a rationalized volumes table for the Platonics and their dual-combos. Fun game, works in Chinese as well, other languages. Lots of published literature, including in illuminated text. http://coffeeshopsnet.blogspot.com/2009/03/res-extensa.html Does this Martian Math threaten the other sandcastles? Not in Oregon it doesn't. We have that live and let live attitude. Euclideans go in peace among us, often unaware of our presence.
Also, one could argue that all creatures are mathematicians in some innate way (Keith Devlin's point).
So they are, beyond argument. So why are we telling them how they want to do math and computing? The mindset of "When I want to hear your opinion, I'll tell it to you" is what I hate most about education systems of the past and present.
Who is "we" here? Are you included?
Carving out a special caste of humans and calling them "mathematicians" is a practice within various institutions.
Mathematicians are not a caste, but a guild with stiff entry requirements. I am not a full member, since I quit after my BA and went to teach in the Peace Corps.
You might see it that way. Or maybe you found in the Peace Corps that all kinds of brilliant people never have the privilege to participate in any university system, given how the curriculum sucks so bad and everyone is way too over-specialized. If our curriculum were any good at all, the Global University would be far less FUBAR. Let's keep reminding ourselves and our teachers that we're not OK with this status quo. The mathematics must be seriously flawed, given how we're so messed up (is, I think, a responsible attitude, vs. trying to always render all practicing professionals above reproach, off the hook -- we have serious reforms to implement). One of the coolest mathematicians I work with is an HVAC engineer.
I've noticed many of these institutions promote a kind of snobbery, but then such is the human ego.
See The Theory of the Leisure Class, by Thorstein Veblen, and Buddhist teachings on no-self. Reverse snobbery is also a feature of human ego.
I miss Bhutan. Really cool people, great scenery (scary-big mountains).
Note that numpy shares some of APL's and J's ability to shape data into multi-dimensional objects with rank.
Yes. It would be more productive to discuss numpy here rather than fight a meaningless rwar.
I tend to agree with Wolfram that "intelligence", whatever it may be, should probably not be mapped to the human animal in any way exclusive to such. I call myself a Quaker animist and am a member of a science club that admits non-humans as honored members (some non-humans have military rank too I've noticed -- recalling a CBS News story). I agree with Wittgenstein when he says thinking "language" is distinct from the rest of what goes on is more superstition than a basis for logical thought.
Thanks for your remarks Christian. Don't let this Ed character bully or intimidate you. He likes to show off, which is fine, but he lacks diplomatic skills IMO. But then some say the same about me.
I don't like to show off. I like to get facts straight. The lack of diplomatic skills is a symptom of my strong ADHD.
Thanks for restoring some of my faith in Roman civilization, maybe there's hope for "us" yet. Lots of these queries, e.g. "what is mathematics?" or "is chess a mathematics?" are queries in the Quakerly sense: one speaks to them perennially but one does not answer them with certainty in some misguided attempt to make the questioning stop. The "having the right answer syndrome" is psychologically slowing so we don't want too much of that around impressionable young children do we? That being said, it's fun to have these strict interpreters, like J's, Logo's, Scheme's, APL's and yes, Python's. "Playing by the rules" is a mathematical exercise -- like being a guest in some Axiom Castle, learning how to think like a Roman when in Rome. "Keep the 'big questions' more open-ended and you'll be better off" is consistent with Constructivist philosophy don't ya think? I'm thinking Karplus was more successful with science education reforms than any counterpart in math education. I wrote a short essay about that. I learned about Karplus from his student and collaborator Dr. Bob Fuller, University of Nebraska at Lincoln. But then the sciences have been seen as experimental / empirical, whereas maths seem to hold out the possibility of synthetic judgments a priori. Authoritarians, in need of certainty, tend to gravitate to so-called "unquestionable" subjects (an occupational hazard). The drive to be super-specialized is somewhat similar (as in "no one will question me once my language is purely private"). I use "maths" in the plural advisedly. Congratulations on your many strong contributions here by the way, and on other lists we frequent. I liked that you expressed admiration for Parrot on math-thinking-l, even though many of these functional programmers dislike the very sound of OO birds chirping. You seem to transcend these divisions in your own approach, understand it's more about both/and, less about either/or. Kirby
-- 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/
On Sun, Apr 11, 2010 at 7:51 PM, Edward Cherlin <echerlin@gmail.com> wrote:
On Sun, Apr 11, 2010 at 21:03, Andrew Harrington <aharrin@luc.edu> wrote:
Well put David.
My choices are always about me and a particular situation. I would not teach J to beginners
I would use the +-*% (+-×÷) subset of J in first grade for arithmetic, alongside Turtle Art (with stack tiles), and Etoys, including Scratch. By third grade, we could introduce programming in J/APL, Logo/LISP, FORTH, Python, and Smalltalk. At some point, we could show how each represents the same internal parse tree in quite different textual forms. What the LISPers call "syntactic sugar". This is a fundamental Computer Science concept.
I'd like to see a school form around your druthers, with ways to facilitate turnover, so those most advantaged by this approach would have some chance to (a) discover this for themselves and (b) keep a slot in an initially rare environment. One would hope we might learn enough from your approach to transfer some of what's working to other sites. Your school of thought would spread in proportion to its achieving results, but without this stultifying demand that everything be proven risk-free before any pilots get started (as if the status quo were a result of such iron-clad assurances). A vicious circle: don't try anything until you can prove it's not in error. This results in paralysis, in nothing being tried. Nothing ventured, nothing gained -- we've all heard that a million times. Hey, I'd've provided you with space and a budget years ago. We'd be reading of your stellar results in the electronic papers by now! All that being said, I'd also sponsor other schools with quite different approaches. Television programming is even more powerful than computer programming in a lot of ways, as it feeds directly into the optic nerve thereby filling human memory banks, helping condition responses. What a powerful medium! Some schools need to put more focus on TV skills, lest all the effective recruiting commercials be for competing services. Maybe the math curriculum includes some J, but with a starry sky backdrop, with class content projected to a sheet strung between tree trunks (or is the sheet itself some kind of LCD?). You had to hike 20 miles to get here. A lot of the databases you study are about local flora and fauna. Some kind of boarding school? International students? Public? Federally funded? Lets fight early onset diabetes by ending discrimination against physical activity as intrinsically "non-mathematical". "Math is an outdoor sport" is one of our slogans.
or to people not crunching a lot of mathematical stuff regularly, but for the professional statisticians and electronic traders I know, J is a fabulous language, and very worth the modest learning curve.
J would enable children to crunch data sets easily, allowing a radical deepening of every subject. The learning curve would be very modest when integrated with arithmetic and elementary science, and applied to languages, history, geography, health, and gym.
Glad you mentioned health and gym. Doing the math around joules and calories, relating these to food values (content): lots of crunchy data sets to work with, as you say, lots of working out. The chemistry of food, digestion, and nutrition, includes cooking, learning to cook. Where those TV-making skills come in handy: producing cooking shows for the school servers. Using Python for a graphing calculator in math class need to not be special, extraordinary, honors or advanced. It's just the obvious and everyday thing we should be doing already. Besides, maybe we're not going to college right away? Other services calling, and offering their own training? Given how FUBAR the Global U is right now, one could understand why creating high debt for high tuitions simply to further over-specialize our students might be considered counter-productive. How about scholarships for veterans to enter nursing, other medical professions? The health professions are ravenous for computing and data services. My daughter is the Portland district champion debater at 15, having started her high school's team in the first place. I worry though: why waste her talents at some backward academy that doesn't even teach about tetrahedral mensuration? How many dead mineshaft canaries does it take I wonder? Maybe by the time she graduates we'll have some respectable colleges out there.
J is an interesting case. Iverson did not totally open up the source.
There is a published version of the source for an earlier version of J, without the IDE, graphics, and so on. I have a copy. There has been some talk of creating a Free Software version, but no activity that I know of. However, Iverson's son Eric is considering GPLing some version of J in support of One Laptop Per Child and Sugar Labs. I need to bother him about it again, because I am about to apply for two XO 1.5 units to use in preparing an introductory text on electricity. It will use the built-in digital oscilloscope function (Measure) on the XO, among other things, and will explain how to build and take data from measuring instruments. I would be interested in working with Pythonistas on a version using numpy and scipy.
I'm still pretty hands-off with the XO despite having two of them, and even though I promote OLPC extensively through most excellent photography and journaling. The XO is for young children whereas I tend to not have much opportunity to work with those age groups. I tend to work with teens and older. All youth should be working on motor skills, both gross and fine, so it's important to me that computers not mess up the diet and exercise balance. The idea of a hand-cranked XO was always intriguing. Didactic challenge courses involving interactive electronics that double as physical work-outs -- designers getting into that are in on the ground floor of something big? Kirby
Edward Cherlin wrote:
On Sun, Apr 11, 2010 at 21:03, Andrew Harrington <aharrin@luc.edu> wrote:
My choices are always about me and a particular situation. I would not teach J to beginners
I would use the +-*% (+-×÷) subset of J in first grade for arithmetic, alongside Turtle Art (with stack tiles), and Etoys, including Scratch. By third grade, we could introduce programming in J/APL, Logo/LISP, FORTH, Python, and Smalltalk. At some point, we could show how each represents the same internal parse tree in quite different textual forms. What the LISPers call "syntactic sugar". This is a fundamental Computer Science concept.
or to people not crunching a lot of mathematical stuff regularly, but for the professional statisticians and electronic traders I know, J is a fabulous language, and very worth the modest learning curve.
J would enable children to crunch data sets easily, allowing a radical deepening of every subject. The learning curve would be very modest when integrated with arithmetic and elementary science, and applied to languages, history, geography, health, and gym.
<snip>
David MacQuigg wrote:
Edward Cherlin wrote:
Christian Mascher 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
<snip>
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.
I think what Christian means to say is that Python is much nearer to a notation (pseudocode) that might be used by scientists and engineers who are trying to express an idea involving computation, without relying on a specific language. Of course, there is no "standard" pseudocode, but if you look at textbooks that are most successful at expressing algorithms this way (my examples would be from engineering - Hachtel & Somenzi on Logic Synthesis, Stinson on Cryptography) what you see is a notation very close to Python.
Pseudocode has to be self-explanatory. There is no introductory chapter on how to read it.
We consider pseudocode "self-explanatory" to those who already know the syntax of a similar language. But it is not so, any more than mousing and icons is "intuitive" for those who have never seen them. I consider my J example _with explanatory comments_ to be simpler than the Python I was starting from, where it must be assumed that students have had a prior introduction to the syntax.
You may have a good point here. The C family of languages (C, Java, Python, ... ) has so permeated our culture that we now have a bias to that way of thinking, and difficulty understanding languages from the APL family (APL, J, K). I don't see any signs that the world is moving to APL-think, LISP-think, or any other programming paradigm, so if students are introduced to programming in some other style, there will be a problem in transition to C-think, a much bigger leap than moving from Python to Java. There must be a real, demonstrable benefit to an alternative paradigm, or it isn't worth the added effort of learning two. Note: I am talking about the majority of students, not those truly interested in CS, for whom learning the alternatives is a great benefit. Personally, I love exploring alternatives, and have even participated in an attempt to one-up Python (Prothon). It's interesting to speculate whether there will ever be another major improvement in programming, a step beyond Python, or if Python will simply incorporate any good ideas that come along (as it did with our @ syntax). I would bet on the latter.
Likewise, an introductory computer language should be close to self-explanatory. It will be difficult to get math and science teachers to accept it, if they have to make extra efforts explaining the notation. Getting math and science teachers to accept computation as a vital part of their curricula is my current focus, so I wouldn't try to push something like your example above.
There are a number of math, science, and Computer Science textbooks in which APL or J is the math notation throughout, being taught only as needed without interrupting the main sequence of ideas. I can give you citations. There is very little done in this manner in any other programming language. (If you have seen some, please send me the information.) I much prefer this approach to the usual one of teaching programming language syntax and semantics in a vacuum, with no systematic application to anything.
I agree that the earliest introduction to programming should be in math and science classes, without interrupting the main sequence of ideas, or forcing any more programming than is helpful to support the subject being taught. Later, we can add a little more than the minimum, not to train future programmers, but with the motivation that "computational thinking" is good for all students. The availability of good textbooks (not just programming manuals) is one of Python's advantages (compared to other agile languages like Ruby). I don't teach high-school, so others on this list may have better recommendations, but if I were teaching at that level, I would chose either Elkner's How to Think Like a Computer Scientist (http://openbookproject.net/thinkCSpy/index.html) or Litvin's Mathematics for the Digital Age. The latter seems like an especially good example of integrating computational thinking into the existing curriculum. I might start with that, then for students who are really interested in CS, maybe Elkner, or Zelle's Python Programming, An Introduction to Computer Science, or even my personal favorite - Goldwasser's Object-Oriented Programming (a bit more advanced, but surely no more difficult than senior calculus).
Python is just a means to an end, the closest thing we have to pseudocode.
APLers tend to find pseudocode irritating, because the APL is shorter and clearer to those who can read it.
When someone who favors another language (typically Java) asks me why Python, I find the comparison to pseudocode to be the best answer. Specific examples, like the absence of type declarations, tends to invite unthinking reactions. (Students will make too many errors.) Even something as simple as requiring correct indentation is not obvious to someone who hasn't used Python. (Although that one does have some appeal to teachers who have had to read sloppy student code.) Ultimately, it is word-of-mouth, one teacher telling another, that I think will decide which language gets used.
Interesting discussion. -- Dave
On Mon, Apr 12, 2010 at 09:30:50AM -0700, David MacQuigg wrote:
We consider pseudocode "self-explanatory" to those who already know the syntax of a similar language. But it is not so, any more than mousing and icons is "intuitive" for those who have never seen them.
That is emminently reasonable but I'm not sure it is true. My children seemed to pick up using a mouse without any instruction IIRC. Geometry, motion & pictures seem to tap a very primitive part of our brains...much deeper than the symbology of algebra and pseudocode. I wonder if there are methods of communication that don't need much explanation because that is how are brains are naturally wired.
It's interesting to speculate whether there will ever be another major improvement in programming, a step beyond Python, or if Python will simply incorporate any good ideas that come along (as it did with our @ syntax). I would bet on the latter.
Well that is exciting for me as I know Python and don't want to learn a new language every 3 months. cs
Hi all, thanks for your reactions. Just wanted to clarify a bit, although most of you seemed to have understood me quite well.
Sorry, I don't know J (Kirby does), but this is exactly the reason I prefer Python. Readability counts (for me).
Of course this was a bit offensive, telling someone who is really in love with something (in this case J) that you're not that interested. Gives rise to some hard feeling. Every teacher experiences this. I work as a teacher - I know how it feels, when students don't share your own enthusiasm. And they never semm to have good reasons ;-), just "feelings". Every teacher knows these questions: Oh, why do we have to learn this? I will never need this. What will we do next? When will we start with something different? Real students tend to ask these questions, communicating: "This is hard stuff, I have other things on my mind I consider more important...". And now sometimes I find myself in a similar position; although I consider myself a person who is constantly learning new things. But my time is limited and I can choose my interests now. When I studied physics in university (got a diploma in physics, 5 years of study) I had chosen a subject with lots of maths (mostly together with the mathematicians), I really liked it. I like maths. But that level is esoteric for most other peaople and more scary: most of it is far away and esoteric stuff for me now, too. Last week because I needed some space in my workplace I stacked away lots of university textbooks. In over ten years as a high-school teacher I never needed most of them, especially the highly mathematical texts. It was kind of sad, but I said farewell to them as I realized I would probably never in my life use them anymore. (I kept Feynman lectures though.)
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.
Thats how it is. I can't be an knowledgable in everything. So many things I can just talk about as an outsider. In the past years I have taught myself Python, Java and Smalltalk in my free time together with OO-thinking, Linux,... . I have also looked into Scheme/Lisp a bit. Smalltalk was the most interesting experience, the famous "syntax table on a postcard". But while Python is a tool I actually use, Smalltalk was considerably harder to get to grips with. In school we use Java (with BlueJ) in the upper classes. For my personal bio I decided to switch interests away from programming for a while.
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.
No, nothing is intuitive when you start from scratch. I can understand people who don't (want to?) learn Python, although I would always say it is useful and looks easy for me. But I had to invest there too.
% x is reciprocal of x, so o. % 180 is pi/180 Don't think that is very useful.
I meant: if I have a division operator then I don't have to learn about another special symbol for the reciprocal.
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.
I don't stand in your way. Go ahead. But I like math, believe it or not ;-).
Lost you there... I put this in in remembrance of the late Arthur Siegel. Hope he doesn't mind... But he could have posted this.
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.
or !=. High-schoolers tend to forget that and write only one side of an equation -p/2 +- sqrt((p/2)**2-q) when they actually want to solve a quadratic equation. I have to correct
Every mathematician (person who creates maths) is free to invent the symbols he finds useful. Still: I often think of mathematics as a language, at least as hard to learn as latin. You can use it to think (communicate with yourself) or to express your ideas in the most clear way for others to follow the reasoning. Over the years some symbols have proven to be more useful than others (think of d/dx Leibniz versus Newton). Some symbols are just handy because they are more or less universally agreed upon (like the indo-arabic numerals, function names sin(), mathematical constants e, pi, ...). For starting to learn maths I have to teach pupils the most common vocabulary, and the correct way to express yourself. For instance: An expression carries no meaning if it doesn't contain a =, <, this, because it is like a sentence without a verb. Mathematics as a language is more than just the vocabulary. Mathematicians have agreed about what counts as a proof (on levels of rigorousness) for instance. All the best to you, sorry for the long post, -- Christian
On Mon, Apr 12, 2010 at 12:36 AM, kirby urner <kirby.urner@gmail.com> wrote: << SNIP >>
How about scholarships for veterans to enter nursing, other medical professions?
The health professions are ravenous for computing and data services.
My daughter is the Portland district champion debater at 15, having started her high school's team in the first place. I worry though: why waste her talents at some backward academy that doesn't even teach about tetrahedral mensuration? How many dead mineshaft canaries does it take I wonder?
Maybe by the time she graduates we'll have some respectable colleges out there.
Of course the above won't make a whole lot of sense if you're just tuning in, as what means "tetrahedral mensuration" and why should any respectable college -- such as Earlham in Indiana (the topic of a cell phone conversation from the Pauling House this morning) -- include that on a syllabus? The following three posts may provide some elucidation, plus they are using Python (the 1st shows execution, the 2nd shows source code) and so are especially apropos on edu-sig: http://groups.yahoo.com/group/synergeo/message/58259 http://groups.yahoo.com/group/synergeo/message/58260 http://groups.yahoo.com/group/synergeo/message/58262 Basically I'm using the Decimal type to give the flavor of some extended precision "arithmetic" regarding some basic polyhedral relationships. As some of you know, our subculture (ethnicity) has a unit volume tetrahedron, per this TV segment outline (more storyboarding for CSN): http://coffeeshopsnet.blogspot.com/2010/04/smart-bar-lcds.html Also here: http://groups.google.com/group/mathfuture/browse_thread/thread/4aa4b568e87ba... A problem with the Synergeo archive, however, is it doesn't support significant whitespace, whereas this Mailman archive does, making it much better for sharing actual source code. Therefore I am taking the liberty of reposting that here: #===== import decimal from decimal import Decimal import re print """ I will now give you the radius of a rhombic triacontahedron of volume five, computing in tetra- volumes. """ myothercontext = decimal.Context(prec=100, rounding=decimal.ROUND_HALF_DOWN) decimal.setcontext(myothercontext) print decimal.getcontext() # long limo vip numbers one = Decimal('1.000000000000000000000000000000000000000000000000000000000000') two = Decimal('2.000000000000000000000000000000000000000000000000000000000000') three = Decimal('3.000000000000000000000000000000000000000000000000000000000000') five = Decimal('5.000000000000000000000000000000000000000000000000000000000000') print "Five: %s" % five radical2 = two.sqrt() radical3 = three.sqrt() radical5 = five.sqrt() print "2nd root of 2: %s" % radical2 phi = (one + radical5) / two print "Phi: %s" % phi scalefactor = (two/three) ** (one/three) print "Shrink by: %s" % scalefactor print "Radius: %s" % ((phi / radical2) * scalefactor, ) """ phi to a 100K places (potentially, check this resource: http://goldennumber.net/PhiTo100000Places.txt ) """ phi_million = "1.618033988749894848204586834365638117720309179805762862135448..." # add more digits for a match strphi = str(phi) results = re.match(strphi, phi_million) if results: print "Successful match for phi value: %s" % (results.span(), ) # (( ),) returns tuple as single %s else: print "No match with phi_million" #===== Kirby
It's interesting to speculate whether there will ever be another major improvement in programming, a step beyond Python, or if Python will simply incorporate any good ideas that come along (as it did with our @ syntax). I would bet on the latter.
Python has served me well for many years, but it is pretty poor at handling concurrency, which is widely considered to be the hot issue that future languages will need to solve. I am skeptical that Python will be able to absorb these improvements into its existing infrastructure. I would almost certainly bet that Python will be superseded by superior languages, although possibly it has another 10 or so more years of popularity to look forward to. Some food for thought: http://research.sun.com/projects/plrg/Publications/ICFPAugust2009Steele.pdf The "Let's Add a Bunch of Numbers" slide is a great example of how Python's style naturally encourages us to write code in exactly the worst possible way from a concurrency standpoint. Translating the slide to Python: total = 0 for i in range(1000000): total = total+i return total Programmers will eventually need to unlearn this kind of process-one-at-a-time linear thinking. We will need programming languages with lots of built-in rich tree-like structures, and a way for specifying computations in a way that can be easily parallelized. Lots of great experimentation is happening in this area -- it's only a matter of time before the next language revolution. In the meantime, I think that a strong emphasis on topics like trees, recursion, immutable data structures, and divide-and-conquer algorithms is a great way to future-proof our students and prepare them for the "next big thing".
On Mon, Apr 12, 2010 at 12:53, <chris@seberino.org> wrote:
On Mon, Apr 12, 2010 at 09:30:50AM -0700, David MacQuigg wrote:
We consider pseudocode "self-explanatory" to those who already know the syntax of a similar language. But it is not so, any more than mousing and icons is "intuitive" for those who have never seen them.
That is eminently reasonable but I'm not sure it is true. My children seemed to pick up using a mouse without any instruction IIRC.
Let me clarify. Moving the mouse pointer is automatic and inevitable. Clicking is inevitable, but most clicks will fail to do anything. Moving the pointer to an icon and clicking is obvious if you see someone else do it, without formal instruction. So far, so good. Now what about click and drag (menu selection, open submenu, move, resize, rotate, draw) right click (context menu) middle click (or left and right click simultaneously. Various effects) hover (hint, alt text, popup, short menu) hover longer (longer menu) double click (open, run) shift click and drag (selection) triple click (larger selection, line or paragraph) control click (no standard) alt click (no standard) etc. Gamers learn many more combinations, sometimes including complex chords, on special gamer controls. Emacsers only use the mouse to change virtual terminals, if that, and do everything else with key combinations (EMACS = Escape, Meta, Alt, Control, Shift) My experience is that all of these mouse actions need to be taught, particularly the multi-use actions like shift click. This may consist of demonstrating each usage once, if the result is sufficiently rewarding and immediate. With very young children, I hold the x mouse key for them on the XO at first, to let them get the hang of click and drag in stages. Large numbers of adults are completely unaware of triple click. I personally hate delayed hover menus, especially doubly-delayed expanding hover menus, as in Sugar. This is being redesigned.
Geometry, motion & pictures seem to tap a very primitive part of our brains...much deeper than the symbology of algebra and pseudocode. I wonder if there are methods of communication that don't need much explanation because that is how are brains are naturally wired.
Try Scratch, which applies Smalltalk to multimedia. Editing movies is just drag and drop. Also Turtle Art. Sugar has a version in Python which supports adding functions in Python. I have done a presentation on teaching Python in elementary schools using these tools. You can put a Python expression into a graphing tile, for example, or grab math examples from Pippy the Python editor and tell the turtle to map out primes, or Fibonacci numbers, or the Pascal triangle. (Mod 2, it gives a Sierpinski fractal.)
It's interesting to speculate whether there will ever be another major improvement in programming, a step beyond Python, or if Python will simply incorporate any good ideas that come along (as it did with our @ syntax). I would bet on the latter.
I bet against you. This is not a new idea. See The Next 700 Programming Languages, by Landin. He proposed absorbing everything into LISPish language structures.
Well that is exciting for me as I know Python and don't want to learn a new language every 3 months.
A gentle introduction to APL concepts without the syntax and symbols is available in numpy. I propose to teach children the basics of the essential features used in all of the major languages, in primary school. My short list of really major concepts includes arithmetic (prefix in LISP, postfix in FORTH, infix everywhere else) variable names are pronouns namespaces Boolean algebra sets permutations, sorting, and searching combinatorics lists of lists (LISP, SCHEME) arrays (APL) forests (arrays of trees, J) OOP (Smalltalk, Python) minimal syntaxes with neither parentheses nor precedence parse trees first-class functions functional programming number base/polynomial equivalence data/program equivalence database topological (dependence) sorting for spreadsheets Then they will recognize that new languages differ mostly in syntax, which is no big deal for those who understand how computing really works. _You_, on the other hand, don't need to learn a new language more often than every two or three years in order to start catching up. Obviously, we can't give third-graders that list of terminology. The idea is to present real examples of these ideas, and only introduce the names later--the opposite of the age-old tradition in textbooks, but a match to the way infants learn before they acquire language. BTW, did you know that infants can learn four or more languages simultaneously without ever finding out that it's supposed to be hard to do?
cs _______________________________________________ Edu-sig mailing list Edu-sig@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/
<< snip >> Ed Cherlin wrote:
I propose to teach children the basics of the essential features used in all of the major languages, in primary school. My short list of really major concepts includes
arithmetic (prefix in LISP, postfix in FORTH, infix everywhere else) variable names are pronouns namespaces Boolean algebra sets permutations, sorting, and searching combinatorics lists of lists (LISP, SCHEME) arrays (APL) forests (arrays of trees, J) OOP (Smalltalk, Python) minimal syntaxes with neither parentheses nor precedence parse trees first-class functions functional programming number base/polynomial equivalence data/program equivalence database topological (dependence) sorting for spreadsheets
I'd be interested in an adaptation of this curriculum for teens to adults. Or maybe we'd use the elementary comix or cartoons or whatever you're using, in addition to the various languages. Adults learn a lot from kid-oriented materials (Sesame Street for example -- teaches a lot about how to make cool YouTubes, lightning talks). I'm looking to advance adult / child understanding and appreciation for polyhedra as well, a traditional Renaissance focus. The five Platonics and their duals (the five Platonics) plus dual-combos (combining duals to get new polys): that's a theme for anime in bars as well as schools. http://coffeeshopsnet.blogspot.com/2010/04/smart-bar-lcds.html Kirby
kirby urner wrote:
However, one thing calculators lack over the old wood pulp textbooks are trig tables with multiple rows showing a lot of data at the same time. Their small "chat window" does not permit much data to be seen at one time.
Back in the day, a student could run her finger down the rows, as the number of angular degrees increase from 0 to 60 and onward to 90, perhaps all the way around to 360.
Going across the row, one would have sine and cosine, perhaps tangent. Having all the data visible at once, or spread across a few pages, inspired some insights and understanding, as one could see the trends in the numbers, plus these "click stop" rows where the numbers would suddenly be super easy, like 1/2 and 1/2 for both sine and cosine.
There is a fascinating article on the history of mathematical tables in the latest ACM. http://cacm.acm.org/opinion/articles/81487-be-careful-what-you-wish-for/full... People made careers out of producing these tables! They hired armies of human calculators (all women) grinding out these numbers. Made me think of my first experiences with the sine function. I used one of these books to make a giant plot of a sine wave. I was fascinated by the shape, and the beauty of it. I practiced drawing sine waves like an artist would, looking ahead at the point where you want your pencil to go. I had a question which didn't get answered until years later. Why do generators make sine waves? I was familiar with the construction of generators, having read about them, and taken one apart at age 14, working on my first car. I had an oscilloscope, with which I could see the sine waves coming out of the outlet in my bedroom. But it was a mystery how something so crude as a generator could make something as precise and beautiful as a sine wave. Python could have answered my question. Maybe at age 14, instead of spending my time hanging out with the juvenile delinquents in my neighborhood, I could have been playing with simulations of power systems, and seeing how waveforms are made up of sinusoidal components. I was into amateur radio at the time, so I knew about modulation and sidebands, but again, so many unanswered questions. How can you *add* power to a transmitted wave by simply twiddling the voltage on the grid of a vacuum tube? Again, Python would have helped.
The contents of trigtable.txt:
0 1.000000000 0.000000000 0.000000e+00 1 0.999847695 0.017452406 1.745506e-02 2 0.999390827 0.034899497 3.492077e-02 3 0.998629535 0.052335956 5.240778e-02 4 0.997564050 0.069756474 6.992681e-02 5 0.996194698 0.087155743 8.748866e-02 6 0.994521895 0.104528463 1.051042e-01 7 0.992546152 0.121869343 1.227846e-01 8 0.990268069 0.139173101 1.405408e-01 9 0.987688341 0.156434465 1.583844e-01 10 0.984807753 0.173648178 1.763270e-01 11 0.981627183 0.190808995 1.943803e-01 12 0.978147601 0.207911691 2.125566e-01 13 0.974370065 0.224951054 2.308682e-01 14 0.970295726 0.241921896 2.493280e-01 15 0.965925826 0.258819045 2.679492e-01 16 0.961261696 0.275637356 2.867454e-01 17 0.956304756 0.292371705 3.057307e-01 18 0.951056516 0.309016994 3.249197e-01 19 0.945518576 0.325568154 3.443276e-01 20 0.939692621 0.342020143 3.639702e-01 21 0.933580426 0.358367950 3.838640e-01 22 0.927183855 0.374606593 4.040262e-01 23 0.920504853 0.390731128 4.244748e-01 24 0.913545458 0.406736643 4.452287e-01 25 0.906307787 0.422618262 4.663077e-01 26 0.898794046 0.438371147 4.877326e-01 27 0.891006524 0.453990500 5.095254e-01 28 0.882947593 0.469471563 5.317094e-01 29 0.874619707 0.484809620 5.543091e-01 30 0.866025404 0.500000000 5.773503e-01 31 0.857167301 0.515038075 6.008606e-01 32 0.848048096 0.529919264 6.248694e-01 33 0.838670568 0.544639035 6.494076e-01 34 0.829037573 0.559192903 6.745085e-01 35 0.819152044 0.573576436 7.002075e-01 36 0.809016994 0.587785252 7.265425e-01 37 0.798635510 0.601815023 7.535541e-01 38 0.788010754 0.615661475 7.812856e-01 39 0.777145961 0.629320391 8.097840e-01 40 0.766044443 0.642787610 8.390996e-01 41 0.754709580 0.656059029 8.692867e-01 42 0.743144825 0.669130606 9.004040e-01 43 0.731353702 0.681998360 9.325151e-01 44 0.719339800 0.694658370 9.656888e-01 45 0.707106781 0.707106781 1.000000e+00 46 0.694658370 0.719339800 1.035530e+00 47 0.681998360 0.731353702 1.072369e+00 48 0.669130606 0.743144825 1.110613e+00 49 0.656059029 0.754709580 1.150368e+00 50 0.642787610 0.766044443 1.191754e+00 51 0.629320391 0.777145961 1.234897e+00 52 0.615661475 0.788010754 1.279942e+00 53 0.601815023 0.798635510 1.327045e+00 54 0.587785252 0.809016994 1.376382e+00 55 0.573576436 0.819152044 1.428148e+00 56 0.559192903 0.829037573 1.482561e+00 57 0.544639035 0.838670568 1.539865e+00 58 0.529919264 0.848048096 1.600335e+00 59 0.515038075 0.857167301 1.664279e+00 60 0.500000000 0.866025404 1.732051e+00 61 0.484809620 0.874619707 1.804048e+00 62 0.469471563 0.882947593 1.880726e+00 63 0.453990500 0.891006524 1.962611e+00 64 0.438371147 0.898794046 2.050304e+00 65 0.422618262 0.906307787 2.144507e+00 66 0.406736643 0.913545458 2.246037e+00 67 0.390731128 0.920504853 2.355852e+00 68 0.374606593 0.927183855 2.475087e+00 69 0.358367950 0.933580426 2.605089e+00 70 0.342020143 0.939692621 2.747477e+00 71 0.325568154 0.945518576 2.904211e+00 72 0.309016994 0.951056516 3.077684e+00 73 0.292371705 0.956304756 3.270853e+00 74 0.275637356 0.961261696 3.487414e+00 75 0.258819045 0.965925826 3.732051e+00 76 0.241921896 0.970295726 4.010781e+00 77 0.224951054 0.974370065 4.331476e+00 78 0.207911691 0.978147601 4.704630e+00 79 0.190808995 0.981627183 5.144554e+00 80 0.173648178 0.984807753 5.671282e+00 81 0.156434465 0.987688341 6.313752e+00 82 0.139173101 0.990268069 7.115370e+00 83 0.121869343 0.992546152 8.144346e+00 84 0.104528463 0.994521895 9.514364e+00 85 0.087155743 0.996194698 1.143005e+01 86 0.069756474 0.997564050 1.430067e+01 87 0.052335956 0.998629535 1.908114e+01 88 0.034899497 0.999390827 2.863625e+01 89 0.017452406 0.999847695 5.728996e+01 90 0.000000000 1.000000000 1.633124e+16
participants (11)
-
Andrew Harrington -
calcpage@aol.com -
Charles Cossé -
chris@seberino.org -
Christian Mascher -
David MacQuigg -
Edward Cherlin -
Helene Martin -
kirby urner -
Mark Engelberg -
michel paul