[Edu-sig] Math + Python: reviewing some themes (long)
kirby.urner at gmail.com
Sun Jan 24 10:12:33 CET 2010
Greetings edu-sig folks:
I've got a somewhat long one here. I encourage any responders not to quote
the whole thing, just go for the gusto and quote the one thing you wanna do
a thread on? I welcome changes to the subject line. One of my bad habits
is to introduce new topics in response to a pre-existing thread.
An entreaty that usa.pycon 2010 education track events get some chronicling
here, by those lucky enough to attend.
I'll be following remotely.
I've just submitted a proposal to OSCON for an education track talk in that
Portland venue this summer.
I'll let you know how that goes. There's no explicit education track in
that conference I'm pretty sure.
More thoughts on 'Mathematics for the Digital Age' (MFTDA):
This could obviously be used at the college level as a discrete math course
The introduction clearly links it to 'Concrete Mathematics' which we used to
discuss on this list. Tim Peters first brought it to my attention as I
recall, whereas most other subscribers likely already knew of it. CM
is used at Stanford (even today?) as a kind of on-ramp to TAOCP by Knuth.
In fact, Knuth is a co-author of CM -- not news to many subscribers here I'm
What I'd forgetten entirely, and what the MFTDA introduction reminds me of,
is that 'Concrete Mathematics' is an amalgam of "CONtinuous" and "disCRETE"
-- hence CONCRETE.
3.a: DISCRETE AND/OR DIGITAL?
In my thread with Gary Litvin, this was one of my chief concerns: are we
boxing ourselves in, by calling it discrete math?
In taking Python (or any computer language) into the math classroom, we're
*not* wanting to exclude topics simply because they're not traditionally
considered "discrete math" topics, right?
Consider calculators. They're digital devices just as surely as computers
are, and they permeate the math curriculum at all levels. Teachers use
those TIs and Casios to study continuous curves in one or more variables, to
explore calculus concepts. Consider Mathematica, likewise digital....
Some of us have been hoping to interest local community colleges in serving
as venues for these teacher training programs that in some cases equip math
teachers already in the field with some of these new skills. The idea, as
I've posted about already, was laid out during a workshop last summer: lets
add a new high school course that satisfies a math requirement, isn't an
As such, this course wouldn't be on the CS AP track. Trying to prepare
students to pass some AP CS test would just take too much time away from the
math we want to study.
Or could there be a new test, call it AP something else?
I doubt ETS has much interest in new categories of AP (not that all of us
care that much about US tracks in the first place).
I've been hyping "digital mathematics" as a kind of niche marketing term,
as distinct from "discrete" but is this wise?
Per math-thinking-l (another list), I'd say I'm in the distinct minority in
thinking "digital math" is a good term. It's unexplored, not conservative,
whereas discrete math is already accepted and entrenched.
To try going in with some "digital math" is just stacking the deck against
one's own efforts, increasing the odds against success. Still, we need to
call it something. Computer Math? Computational Math? Discrete Math?
3.b WHAT LEVEL OF DIFFICULTY?
Back to the Litvin text, which has a lot going for it, I think it might be
too difficult for some of the students we're hoping to reach.
Phillips Academy is one of the most prestigious, reminiscent of Catlin Gabel
or Oregon Episcopal in our neck of the woods (I could rattle off a few
more). The text comes across as "early college" i.e. college level for high
schoolers, or at least as a kind of advanced Algebra 2 (thinking of the
chapter on polynomials in particular).
It goes all the way through RSA (public key crypto) as I've typically
advocated we do.
The good news is MFTDA (Math for the Digital Age) could be like TAOCP or
SICP by Abelson, Sussman & Sussman, by forming the nucleus of a genre. In
additional to full blown texts, we'll perhaps see a growing inventory of
cyberspace assets contributed directly by teachers and students?
That's hardly a hypothetical question actually, as those materials already
exist in abundance (including as Youtubes in some cases), just need to be
organized, glued together, and connected into curricula more successfully.
For example, I often circle 'Warriors of the Net' as a great little cartoon
about TCP/IP. But then do we want to get into those guts?
MFTDA takes the more traditional route in diving into CPU / registers /
memory, offers 8088 assembler, relates these to byte codes running on a VM
ala Java and Python, other so-called interpreted languages. It's not either
/ or though: dig down to the chip on the one hand, dig down to bits over
the wire on the other.
The way I heard some of the teachers talk at our workshop on Aug 7, was more
in terms of serving a refugee population feeling burned out on more
traditional fare. They do Algebra 1, Geometry... and then decide against
These first two courses haven't been all that successful necessarily,
meaning the motivation to continue along the pre-calc/ calculus track may
not be present, and yet a 3rd year of math is required for that high school
diploma. A computer science elective wouldn't satisfy that requirement. A
discrete math offering would.
So.... where do we go with this? What topics? In what depth? What
solutions are already out there?
3.c WHAT KILLED CODING?
http://www.salon.com/tech/feature/2006/09/14/basic/ (related reading)
Some of the advice I get from math teachers on math-teach (a list at the
Math Forum) is to just forget about using a computer language. That was
trendy in the 1980s maybe, but went out of fashion for a reason.
I'm not clear on exactly those reasons were myself. In the 1980s, I was
working in computer literacy for McGraw-Hill and it looked like Logo and
BASIC would be moving in big time.
A typical linear algebra text of that era, Wayne Bishop a co-author (one of
the math-teach mainstays), had these BASIC programs in the back for
multiplying and reducing matrices. That seemed the wave of the future back
then, but then subsequent editions of that book have dropped the software
Here's what I think might have happened: the shift to the object oriented
paradigm left a lot of math teachers feeling programming was going off in
some new direction and it'd be hopeless to try to keep up.
Computer programming needed to go its own way (or so its seemed) and be
strictly its own discipline, leaving mathematics students free to practice
their own ways, minus this alien content.
But then OO ala Smalltalk was actually supposed to make programming easier,
the theory being we already think in terms of objects, of nouns, named
things, with attributes and behaviors. This wasn't about inventing an
entirely new paradigm for computer programming, it was about finding ways to
express an existing paradigm (that of objects in the world) in computer
3.d OBJECTS FIRST?
Sorry this is being so long. Let me just end with another take on the
"objects first" approach.
In order to make Python more accessible and the mathematics correspondingly
easier, we begin with very simple classes based around animals (e.g. the
Turtle class). We encourage thinking about animals, their attributes and
behaviors. Only later on will we try our had at more generic "math objects"
such as Rational Numbers.
MFTDA actually includes a Rational number class, but doesn't give it much
focus. It seems to be the only class definition in the entire text. I
think this maybe mirrors an attitude among CS professors that classes and
objects are an advanced 2nd year topic.
My own view is somewhere in between: I think a full blown treatment of OO,
including abstract classes, metaclasses, multiple inheritance, is indeed
advanced and probably not suitable for a one year or half year high school
Or, if suitable, then mostly in the form a really primitive examples of the
Foo and Bar class variety, more to communicate the generic design patterns
and concepts than to develop full blown computer programs such as one might
use in production environments.
What examples do teachers wish to contribute? What would be a good
introductory example of multiple inheritance I wonder? I recall David
MacQuigg sharing some examples where __mro__ (method resolution order) made
http://wikieducator.org/User:Macquigg (I recommend reading Dr. Macquigg's
excellent testimonial here, with a link to his PyWhip).
So yes, the CS professors are right. A full blown intro to classes is too
much to start off with.
On the other hand, a few simple classes such as Rational Number, Integer
Modulo N, Polynomial, Vector, Edge, Polyhedron, could take their place
alongside String, List, Set, other primitives.
Note: Rational Number is now a primitive in the Standard Library, thanks to
the fractions.Fraction class.
>>> from fractions import Fraction
>>> a = Fraction(1, 4)
>>> b = Fraction(2, 5)
>>> c = Fraction(2, 10)
>>> a + b + c
>>> a * b * c
>>> a ** 2 + b ** 3 - c ** 4
The idea, then, is to build some awareness of classes and objects using
familiar analogies relating to every day life. A class definition is a
blueprint (one needs to explain "blueprint" -- design, plan) whereas an
instance of the class has it's own place in memory, its own "self" as it
were (intro to Python "self" syntax).
Do some animal classes. Then note how dot notation is what's used to access
the attributes and behaviors of a user-defined object.
Then note how Python's primitive objects are likewise instances of various
classes (e.g. the List class).
It's dot notation itself that we're hoping to make second nature (familiar,
not too arcane).
3.e THE TIME DIMENSION
That's the breakthrough in understanding we're seeking: brief anatomy
lessons with user-defined classes provide enough background to anchor an
understanding of built-in classes and objects. It's really "dot notation"
itself that we're seeking to anchor here. noun.verb(args) and
noun.adjective provide a primitive grammar or logic. We also think in terms
of a "life cycle" for objects, from birth to garbage collection once
Asking whether two objects are contemporaneous or "partially overlapping"
should be a sensible question. Mathematics tends to be sequential, in terms
of definitions and theorems, building on itself, but with no explicit
reference to a time dimension. Focusing on "objects in memory" brings more
of a temporal dimension into focus, allowing us to talk about local vs.
global, about scope. MFTDA looks at scope quite a bit, as one needs to in
What do others think? Does adding programming put more emphasis on "time"
than we're used to?
Having examined a turtle, snake, monkey and dog class in some detail, we're
ready to appreciate that lists, dictionaries and strings are likewise
instances of classes, as are numbers themselves. Yes, we've already used
primitive data structures to define our Dog and Turtle. That's OK. Now
we're ready to zoom in on the "guts" of a Snake to see how the stomach (a
list) is likewise an object, just like the snake itself.
This is a great segue to the turtle of Standard Library fame. We're now
ready to think in terms of instantiating a turtle object and controlling it
using dot notation. We've kept the essence of Logo, while creating an
"explicit receiver" (to use Smalltalk jargon).
Then perhaps we go along our merry way, like in MFTDA, focusing primarily on
functions for awhile (maybe generators), taking our time getting back to
user-defined classes. On this second pass, we'll get more into "math
objects" such as Polyhedra (my favorite) but we'll still be less advanced
than in a true CS course treatment.
This is a proposal only, a reiteration of my earlier posts in many ways.
What I'm supposing would work best is if a training team set up these
possibilities, but then left it to individual teachers or faculty
teams which way to go. Having some standards in the picture needn't squeeze
every degree of freedom out of the picture. A teacher preferring an
"objects first" approach would be free to explore that, whereas a different
teacher might consider this way too difficult and inappropriate for his or
her students. Not every teacher wants to use VPython for example, cool
though that package may be.
Especially when working towards a few pilots, I think it's important to not
intimidate, not scare away, by suggesting TOOWTDI ("there's only one way to
3.f MY ROLE
Any reader making it this far might be asking whether I have any authority
or standing to be suggesting any of this.
Who am I to be setting education policy, in the State of Oregon or anywhere
The answer is I'm no one in particular, and I'm not in a position to tell
others how to play their hands.
My own approach was to open source most of my materials. I have not written
a text book. I am not an appointed education czar.
My model is one of democratic participation and wanting to foster lots of
Minus much participation or activism, I don't think there's much chance of
much of anything happening, in terms of getting some of these new kinds of
math classes going. The status quo seems the most comfortable option until
one day people wake up to the fact they're way behind the curve in some
ways. At that point, the future shock may be severe and result not in
creative action, but semi-paralysis. That seems closer to what's happening
in so many communities: future shock + semi-paralysis.
Intel and the Gates Foundation will continue to earmark millions if not
billions for education, but none of those funds will go towards beefing up
math classes with some industrial grade computer language unless we take a
more activist approach.
The opportunity to better integrate topics around computers will simply fall
by the wayside, as it has since the 1980s in most cases (with some happy
Let's get creative then? Innovate? I'm hoping the Atlanta conference will
help move us along in some promising new directions. I will be monitoring
this list. Know of good blogs? Post some links?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Edu-sig