# [Edu-sig] Teaching Middle-School Math with Python

Kirby Urner pdx4d@teleport.com
Fri, 06 Oct 2000 09:08:15 -0700

```Fred --

I think your post hits the nail on the head as to what the
CP4E initiative is all about -- and by extension this e-list.

As for "pre-algebra", that's a little tricky, as any Python
function def is likely to have variables -- even the simplest.

In my posts to the Math Forum, I'm chatting with middle school
teachers about ways to phase in Python.

For example: http://mathforum.com/epigone/math-teach/pilfrowhel

I've appended an excerpt (these topics of prime versus
composite numbers, greatest common divisor, lowest common
multiple, often make a first appearance at the middle
school level -- or even earlier):

=========================

That Venn Diagram approach sounds good and useful.

Just wanted to add that I favor using a projected command line
interface (CLI) if you school is so equipped -- even better if

By CLI, I mean an interactive prompt, where you can enter stuff
and get computerized feedback.  In my curriculum writing, that
often means Python.  Here's a transcript of a session, using my
primes.py  -- just cutting and pasting from the window:

Python 2.0b2 (#6, Sep 26 2000, 14:59:21) [MSC 32 bit (Intel)] on win32
IDLE 0.6 -- press F1 for help

>>> from primes import *
>>> gcd(101,11)
1
>>> gcd(34050,35)
5
>>> lcm(234,84)
3276
>>> isprime(101)
1
>>> iscomposite(561)
1
>>> getfactors(561)
[3, 11, 17]
>>> getfactors(10)
[2, 5]
>>> erastosthenes(100)
[2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47,
53, 59, 61,  67, 71, 73, 79, 83, 89, 97]
>>> a = getfactors(561)
>>> b = getfactors(341)
>>> a
[3, 11, 17]
>>> b
[11, 31]
>>> intersection(a,b)
[11]
>>> gcd(561,341)
11

=========================

My initiative is of course one among many.  We need to build
on one another's efforts, concentrating in areas we know the
I don't have all the answers, skills or knowledge to do this
myself (and haven't been).  What I bring to the equation is
a longstanding interest in upgrading the curriculum, which
predates my exposure to Python.[1]

At the higher levels, Python has to compete with other
teaching languages (Basic, C...) for a place in the sun.
As you go down towards middle school, you generally find no
computer language at all (computers get used, but not for
programming).  Even Logo seems to have fallen by the wayside.
The competition here is calculators, not so much other
computer languages.

Calculators do have their selling points, to be sure.  To
use computers effectively in math class, you'd need a lot of
changes from the status quo.  I've long brainstormed what
I call a "math center", which is similar to a computer lab,
but even more suitable.[2]  But this is infrastructure
most schools have no way to afford.  It's the cubical
people with corporate responsibilities who get access
to that ExecuTrain-style equipment.  Most kids do not.

That said, I don't think it'd be as expensive as many
suppose to upgrade a lot of schools.  The economies of
scale would kick in if the teacher culture tilted more
in favor of installing such infrastructure (at the moment,
many teachers are unsure what to do with the few computers

Anyway all this talk about having a better CLI in the
classroom brings up issues that extend far beyond which
computer language to use.  Freelance curriculum writers
such as myself have the ability to skirt some of these
issues by finding a niche market.  As that O'Reilly
Network review of my Oregon Curriculum Network mentions,
I'm developing resources for home schoolers.  Home
including fast, powerful processes and DSL, ISDN or
cable modems.  At least that's how it is out here in
the Silicon Forest, home of Intel and HP.

But I haven't turned my back on the public or private
schools.  My first grader is in a public school and I
an iMac.

Kirby

[1] Museum exhibit:  my 'Math Makeover of 1998' campaign:
some old web page propaganda I've left intact at
http://www.teleport.com/~pdx4d/makeover0.html

[2] http://www.teleport.com/~pdx4d/mathcenter.html

```