[Edu-sig] Re: Python Anxiety

Kirby Urner urnerk@qwest.net
Sun, 06 Apr 2003 12:56:08 -0700


--=====================_156226351==.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed

At 10:17 AM 4/6/2003 -0500, Arthur wrote:

>But he also seems to admit that he himslef would be uncomfortable with too
>much math in a programming related curriculum. He seems clearly concerned
>that linking the curriculum too closely will turn off students who have a 
>purer
>interest in programming.

Yeah, I mostly come from the other side of the fence.  It's
a math class, so math is clearly what's up, but we want to
dabble in a programming language, to experiment and explore
the concepts.  This'd be impractical were the programming
language really time-consuming to learn, as they were in
the old days.  But now we have such creatures as Python,
so this is now a more practical goal.

>
>(My best counter is that 3d graphics is a area of everyday computing of 
>interest
>to many younger  - and some older - folks.  Why shouldn't it be approached 
>in as
>low a level a way as possible.  It appears the Elkner's students get 
>pretty low level
>into networking issues, e.g.  The fact that 3d graphics at anything much 
>below the
>point and click level is math intensive, is a fact of life.  Are his 
>students willing to
>write-off the possibility of doing anything truly interesting in that 
>realm?  Maybe
>some are.  I can't believe most are.)

Or even 2D graphics.  Fractals, turtle spirograph stuff,
cellular automata, polygons, and of course ordinary xy
graphs (functions, parametric equations, bar graphs etc.).
I've been looking more into PythonCard recently (wxPython-
based) and admiring what it does in the 2D realm.

But yes, of course 3D too.  'Beyond Flatland' -- one of my
major themes (and the forte of your PyGeo).

>
> >To start using a computer language in an early math curriculum
> >looks like the harbinger of nothing good:  it means math will
> >become mixed up with all kinds incompatible grammars which come
> >and go, vs. the staying power of a more stable, core notation.
>
>What level or age is Shelley thinking about?  Personally, I am not too 
>keen at introducing
>any of this too early in the game - except in the atypical case, where a 
>child has expressed
>a specfic interest.  Like the recent 11 year old on python-list. But in 
>those cases the child
>seems to find their own way to pursue what interests them, and it may be 
>best, if it is
>going to be apporached formally at all, as an enrichment program of some 
>sort, rather
>than anything near the core.

I think pretty early, like in teaching algebra.  The example
she gave was just around showing composition of functions.
Like this (my own examples, but similar):

  >>> def f(x): return x+2

  >>> def g(x): return x**2

  >>> f(g(10))
  102

  >>> g(f(10))
  144

  >>> f(f(10))
  14

  >>> g(g(f(g(f(g(g(g(f(6)))))))))
  6277107721700063361361066218651271080020693109731680584976L

I'm imagining a classroom with a data projector fixed to the
ceiling, a computer up front.  The teacher simply switches it
on and dashes off some of these lines, in place of using a
chalkboard.  That'd be a minimal case.  Similarly she could do
graphs etc. on the fly.

Her idea was that this stuff is interactive, and close enough
to standard math notation to be readable.  But the more
conservative faculty were turned off by the colons and returns.
In "real math" they'd write something like f: x-> x+2 I suppose.
Looks more like Haskell :-D.

>The main point here, however, is that it seems clear that the program is 
>aimed at exceptional
>students - exceptional either in their general aptitudes (and in need of 
>enrichment), or exceptional
>in their specific interest in a programming related extra-curricula activity.

The Scheme stuff seems aimed more at students studying programming
who might happen to use some math, vs. math students who might
happen to use some programming.  But I agree that Scheme could be
used in the later context as well.

>
>Which, IMO, is one way the CP4E "religion" is a problem.  An approach 
>aimed at the gifted and
>a self-selected group of the highly motivated, seems to me a much more 
>realistic approach and
>one with which there should be no shame associated.
>

Another branch thread here is what math topics do the most to
explicate computer stuff?  In computer languages, we make lots of
use of bases 2 and 16, boolean operators, data structures.
There's the question of what topics to emphasize in early
mathematics -- independent of whether we're using a computer
language.

   >>> int(0xFF)
   255

   >>> int('101001010100',2)
   2644

We tend to use calculators for some of this today, but calculators
can't do this:

   >>> bytes = binascii.hexlify("The rain in Spain stays mainly in the plain")
   >>> bytes
   '546865207261696e20696e20537061696e207374617973206d61696e6c7920696e2
   074686520706c61696e'
   >>> bignum = eval('0x'+bytes)
   >>> bignum
   11815744420694793501812329697776864896346269902373465542189059127618
   705148732921630756455756149486086510L

That shows how words may be converted to big integers -- a first step
in many cryptography algorithms.

   >>> binascii.unhexlify(hex(bignum)[2:-1])  # strip 0x, ending L
   'The rain in Spain stays mainly in the plain'

Here we have the notion of function and inverse function.

f:    phrase -> number
finv: number -> phrase



>It also is relevant - to me - that the Schemers program does much with 3d 
>graphics, and is not
>programming language dogmatic, in that it specfically includes a path from 
>Scheme to C++ as
>part of its approach.

Python-based curricula could/should also contain bridges to other
languages, for those coming from or headed towards.  It's interesting
to see language comparisons.

  >>> def tonum(phrase):
          bytes = binascii.hexlify(phrase)
          return eval('0x'+bytes)

  >>> def towords(num):
          return binascii.unhexlify(hex(num)[2:-1])

  >>> asnum = tonum("This is my test phrase")
  >>> towords(asnum)
  'This is my test phrase'

   >>> towords(tonum("The inverse of f undoes what f does"))
   'The inverse of f undoes what f does'

I favor more such alphanumeric blends, as more representative of how
text and numbers interface in the real world (through unicode and ascii).
But it's a math topic.  We're talking functions:  mapping a domain
(of words) to a range (of numbers) and vice versa.

>Also at PyCon, another high school level teacher made this point.  The 
>curriculum he designed was
>based, at least in part, on what he knew.  Obviously teachers cannot teach 
>what they don't know.  Having
>done some presentation (PyGeo related) to college level math instructors, 
>I was surprised how little was
>known about even basic programming concepts, even at that level. To me 
>that's just pure anachronism -
>someone with a math Phd. knowing nothing about programming - in a Very 
>High Level Language, at least.

Yes, math is seen as very much a distinct topic, different from
compsci or any kind of engineering.  However, especially at the
early levels, I believe we should be embracing inputs from a great
many disciplines, not over-specializing too early -- which is why
introductory numeracy materials should be a mix, taking from math,
compsi, engineering, the physical sciences, and the humanities.

>
>I have always seen the niche of teaching teachers as Kirby's truer 
>calling, BTW.

That'd be fun.

>Some progress, at least.
>
>Art

Yes, some progress.

Kirby


--=====================_156226351==.ALT
Content-Type: text/html; charset="us-ascii"

<html>
<body>
At 10:17 AM 4/6/2003 -0500, Arthur wrote:<br><br>
<blockquote type=cite class=cite cite><font face="arial">But he also
seems to admit that he himslef would be uncomfortable with too
</font><br>
<font face="arial">much math in a programming related curriculum. He
seems clearly concerned </font><br>
<font face="arial">that linking the curriculum too closely will turn off
students who have a purer </font><br>
<font face="arial">interest in programming.</font></blockquote><br>
Yeah, I mostly come from the other side of the fence.&nbsp; It's<br>
a math class, so math is clearly what's up, but we want to<br>
dabble in a programming language, to experiment and explore<br>
the concepts.&nbsp; This'd be impractical were the programming<br>
language really time-consuming to learn, as they were in <br>
the old days.&nbsp; But now we have such creatures as Python,<br>
so this is now a more practical goal.<br><br>
<blockquote type=cite class=cite cite>&nbsp;<br>
<font face="arial">(My best counter is that 3d graphics is a area of
everyday computing of interest </font><br>
<font face="arial">to many younger&nbsp; - and some older - folks.&nbsp;
Why shouldn't it be approached in as </font><br>
<font face="arial">low a level a way as possible.&nbsp; It appears the
Elkner's students get pretty low level </font><br>
<font face="arial">into networking issues, e.g.&nbsp; The fact that 3d
graphics at anything much below the </font><br>
<font face="arial">point and click level is math intensive, is a fact of
life.&nbsp; Are his students willing to </font><br>
<font face="arial">write-off the possibility of doing anything truly
interesting in that realm?&nbsp; Maybe </font><br>
<font face="arial">some are.&nbsp; I can't believe most
are.)</font></blockquote><br>
Or even 2D graphics.&nbsp; Fractals, turtle spirograph stuff, <br>
cellular automata, polygons, and of course ordinary xy <br>
graphs (functions, parametric equations, bar graphs etc.).<br>
I've been looking more into PythonCard recently (wxPython-<br>
based) and admiring what it does in the 2D realm.<br><br>
But yes, of course 3D too.&nbsp; 'Beyond Flatland' -- one of my<br>
major themes (and the forte of your PyGeo).<br><br>
<blockquote type=cite class=cite cite>&nbsp;<br>
<font face="arial">&gt;To start using a computer language in an early
math curriculum<br>
&gt;looks like the harbinger of nothing good:&nbsp; it means math
will<br>
&gt;become mixed up with all kinds incompatible grammars which come<br>
&gt;and go, vs. the staying power of a more stable, core
notation.</font><br>
&nbsp;<br>
<font face="arial" size=2>What level or age is Shelley thinking
about?&nbsp; Personally, I am not too keen at introducing </font><br>
<font face="arial" size=2>any of this too early in the game - except in
the atypical case, where a child has expressed </font><br>
<font face="arial" size=2>a specfic interest.&nbsp; Like the recent 11
year old on python-list. But in those cases the child </font><br>
<font face="arial" size=2>seems to find their own way to pursue what
interests them, and it may be best, if it is </font><br>
<font face="arial" size=2>going to be apporached formally at all, as an
enrichment program of some sort, rather </font><br>
<font face="arial" size=2>than anything near the core.&nbsp;
</font></blockquote><br>
I think pretty early, like in teaching algebra.&nbsp; The example<br>
she gave was just around showing composition of functions.&nbsp; <br>
Like this (my own examples, but similar):<br><br>
&nbsp;&gt;&gt;&gt; def f(x): return x+2<br><br>
&nbsp;&gt;&gt;&gt; def g(x): return x**2<br><br>
&nbsp;&gt;&gt;&gt; f(g(10))<br>
&nbsp;102<br><br>
&nbsp;&gt;&gt;&gt; g(f(10))<br>
&nbsp;144<br><br>
&nbsp;&gt;&gt;&gt; f(f(10))<br>
&nbsp;14<br><br>
&nbsp;&gt;&gt;&gt; g(g(f(g(f(g(g(g(f(6)))))))))<br>
&nbsp;6277107721700063361361066218651271080020693109731680584976L<br><br>
I'm imagining a classroom with a data projector fixed to the<br>
ceiling, a computer up front.&nbsp; The teacher simply switches it<br>
on and dashes off some of these lines, in place of using a <br>
chalkboard.&nbsp; That'd be a minimal case.&nbsp; Similarly she could
do<br>
graphs etc. on the fly.<br><br>
Her idea was that this stuff is interactive, and close enough<br>
to standard math notation to be readable.&nbsp; But the more <br>
conservative faculty were turned off by the colons and returns.<br>
In &quot;real math&quot; they'd write something like f: x-&gt; x+2 I
suppose.<br>
Looks more like Haskell :-D.<br>
<font face="arial">&nbsp;<br>
</font><blockquote type=cite class=cite cite><font face="arial" size=2>The
main point here, however, is that it seems clear that the program is
aimed at exceptional </font><br>
<font face="arial" size=2>students - exceptional either in their general
aptitudes (and in need of enrichment), or exceptional </font><br>
<font face="arial" size=2>in their specific interest in a programming
related extra-curricula activity.</font></blockquote><br>
The Scheme stuff seems aimed more at students studying programming<br>
who might happen to use some math, vs. math students who might<br>
happen to use some programming.&nbsp; But I agree that Scheme could
be<br>
used in the later context as well.<br><br>
<blockquote type=cite class=cite cite><font face="arial">&nbsp;<br>
</font><font face="arial" size=2>Which, IMO, is one way the CP4E
&quot;religion&quot; is a problem.&nbsp; An approach aimed at the gifted
and </font><br>
<font face="arial" size=2>a self-selected group of the highly motivated,
seems to me a much more realistic approach and </font><br>
<font face="arial" size=2>one with which there should be no shame
associated. </font><font face="arial"><br>
&nbsp;</font></blockquote><br>
Another branch thread here is what math topics do the most to <br>
explicate computer stuff?&nbsp; In computer languages, we make lots
of<br>
use of bases 2 and 16, boolean operators, data structures.<br>
There's the question of what topics to emphasize in early <br>
mathematics -- independent of whether we're using a computer<br>
language.<br><br>
&nbsp; &gt;&gt;&gt; int(0xFF)<br>
&nbsp; 255<br><br>
&nbsp; &gt;&gt;&gt; int('101001010100',2)<br>
&nbsp; 2644<br><br>
We tend to use calculators for some of this today, but calculators<br>
can't do this:<br><br>
&nbsp; &gt;&gt;&gt; bytes = binascii.hexlify(&quot;The rain in Spain
stays mainly in the plain&quot;)<br>
&nbsp; &gt;&gt;&gt; bytes<br>
&nbsp;
'546865207261696e20696e20537061696e207374617973206d61696e6c7920696e2<br>
&nbsp; 074686520706c61696e'<br>
&nbsp; &gt;&gt;&gt; bignum = eval('0x'+bytes)<br>
&nbsp; &gt;&gt;&gt; bignum<br>
&nbsp;
11815744420694793501812329697776864896346269902373465542189059127618<br>
&nbsp; 705148732921630756455756149486086510L<br><br>
That shows how words may be converted to big integers -- a first step
<br>
in many cryptography algorithms.<br><br>
&nbsp; &gt;&gt;&gt; binascii.unhexlify(hex(bignum)[2:-1])&nbsp; # strip
0x, ending L<br>
&nbsp; 'The rain in Spain stays mainly in the plain'<br><br>
Here we have the notion of function and inverse function.&nbsp; 
<br><br>
f:&nbsp;&nbsp;&nbsp; phrase -&gt; number <br>
finv: number -&gt; phrase<br><br>
<br><br>
<blockquote type=cite class=cite cite><font face="arial" size=2>It also
is relevant - to me - that the Schemers program does much with 3d
graphics, and is not </font><br>
<font face="arial" size=2>programming language dogmatic, in that it
specfically includes a path from Scheme to C++ as </font><br>
<font face="arial" size=2>part of its approach.</font></blockquote><br>
Python-based curricula could/should also contain bridges to other<br>
languages, for those coming from or headed towards.&nbsp; It's
interesting<br>
to see language comparisons.<br><br>
&nbsp;&gt;&gt;&gt; def tonum(phrase):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bytes =
binascii.hexlify(phrase)<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
eval('0x'+bytes)<br><br>
&nbsp;&gt;&gt;&gt; def towords(num):<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return
binascii.unhexlify(hex(num)[2:-1])<br><br>
&nbsp;&gt;&gt;&gt; asnum = tonum(&quot;This is my test 
phrase&quot;)<br>
&nbsp;&gt;&gt;&gt; towords(asnum)<br>
&nbsp;'This is my test phrase'<br><br>
&nbsp; &gt;&gt;&gt; towords(tonum(&quot;The inverse of f undoes what f
does&quot;))<br>
&nbsp; 'The inverse of f undoes what f does'<br><br>
I favor more such alphanumeric blends, as more representative of 
how<br>
text and numbers interface in the real world (through unicode and
ascii).<br>
But it's a math topic.&nbsp; We're talking functions:&nbsp; mapping a
domain<br>
(of words) to a range (of numbers) and vice versa.<br>
&nbsp;<br>
<blockquote type=cite class=cite cite><font face="arial" size=2>Also at
PyCon, another high school level teacher made this point.&nbsp; The
curriculum he designed was </font><br>
<font face="arial" size=2>based, at least in part, on what he knew.&nbsp;
Obviously teachers cannot teach what they don't know.&nbsp; Having
</font><br>
<font face="arial" size=2>done some presentation (PyGeo related) to
college level math instructors, I was surprised how little was
</font><br>
<font face="arial" size=2>known about even basic programming concepts,
even at that level. To me that's just pure anachronism - </font><br>
<font face="arial" size=2>someone with a math Phd. knowing nothing about
programming - in a Very High Level Language, at least.&nbsp;
</font></blockquote><br>
Yes, math is seen as very much a distinct topic, different from <br>
compsci or any kind of engineering.&nbsp; However, especially at the
<br>
early levels, I believe we should be embracing inputs from a great<br>
many disciplines, not over-specializing too early -- which is why<br>
introductory numeracy materials should be a mix, taking from math,<br>
compsi, engineering, the physical sciences, and the humanities.<br><br>
<blockquote type=cite class=cite cite><font face="arial">&nbsp;<br>
</font><font face="arial" size=2>I have always seen the niche of teaching
teachers as Kirby's truer calling, BTW. </font><font face="arial"><br>
</font></blockquote><br>
That'd be fun.<br>
<font face="arial">&nbsp;<br>
</font><blockquote type=cite class=cite cite><font face="arial" size=2>Some
progress, at least.</font><font face="arial"><br>
&nbsp;<br>
</font><font face="arial" size=2>Art</font><font face="arial"><br>
</font></blockquote><br>
Yes, some progress.<br><br>
Kirby<br>
</body>
<br>
</html>

--=====================_156226351==.ALT--