[Edu-sig] Python and pre-Calculus
kirby urner
kirby.urner at gmail.com
Fri Sep 8 18:34:39 CEST 2006
Hi Kevin --
Over on math-teach we've been hashing over whether "pre calc" is
really prehistoric, as in "soon to be known as something else" i.e. if
this becomes a popular insert point for such gnu languages as Python,
who knows what will happen, but immediately you're putting most
printed precalc text books at a disadvantage, since many if not most
presume servitude to TI and/or avoid using much technology.
If your school gives you a free hand as a teacher (most do not these
days), then I'd think you might be interested in exploring convergent
sequences, as the calculus immediately beings with limits, and a
discussion of what fails to converge, vs. what does. These sequences
(or partial sums, as the case may be) become immediately too
complicated to compute by hand out to more than a few terms -- the
ideal insertion point for a function written in some executable math
language like J (or Python).
Per the "raw_input" thread, in mathematics we don't "prompt ourselves"
inside a function, but feed it through the "mouth" i.e. the curved
parentheses after F as in F(x).
Kids have usually been trained to think that way before encountering
Python, in this day and age, so I hate to ruin that discipline with a
lot of extraneous "ask me" type prompting, which again, mathematical
functions don't do (have mouth, will use it). Let them code up a
"bag" of useful tools in a module and import.
If you find yourself writing a lot of scripts that only run from a
command line, with a lot of raw_input prompts, maybe you should
reconsider -- math is not about building a lot of i/o bureaucracy.
Immediate use of tools is to be preferred over anything menu driven.
You can develop your domains quickly using list comprehensions, and
feed these to functions, also within list comprehensions.
And definitely use generators. The fibonacci sequence is a fantastic
place to begin, even if your school is a "no da vinci code" zone, sort
of the way mine is (we got sick of it after a whole year of hype).
We've seen lots of Sequence talk here on edu-sig, plus plenty of code,
despite what detractors say about noise to signal ratio (I think
they're just lyin' -- we're one of the strongest content lists
anywhere). That Ramanujan Convergence Engine for Pi I just published
was good, as it exercises the extended precision possibilities of the
new Decimal type.
Really, we need to be using Decimal quite early in Python. If you
haven't encountered it by the 2nd or 3rd week, ask your teacher why
this class is so dumb.
Of course the reciprocal of convergence is divergence, and we have a
lot of those too, especially around polyhedral and figurate numbers,
both found in Pascal's Triangle (an ideal use of a generator by the
way).
I often start my classes with triangular and tetrahedral numbers, as a
first simple exercise.
Later, we might get to Chaotic, vs. Convergent or Divergent. The four
attributes I use (and many of my peers do to) is: convergent,
divergent, periodic and aperiodic. The chaotic is aperiodic. Plus
you can be divergent and aperiodic or convergently periodic (which is
different from settling down to a final limit "at infinity", which you
may never do, even in theory sometimes).
Here's an old calc page at my website you might get some ideas from:
http://www.4dsolutions.net/ocn/precalc.html (Java broken on my box,
so couldn't tell if my little applet still works).
Kirby
On 9/8/06, Kevin Driscoll <driscollkevin at gmail.com> wrote:
> I'm teaching Pre-Calculus for the first time this year and am hoping
> to integrate Python as often as possible. My syllabus is focused on
> exploring functions in various forms, uses, and contexts. The
> intersections to programming are numerous and beautiful.
>
> I'd love to get a brainstorm happening here. Especially addressing
> the college educators, what do you which your freshman had seen in
> 11th and 12th grade?
>
> Yesterday we worked on building a complete mathematical definition for
> a Toaster function. Wouldn't you know it? toaster(bread) = toast ...
> every time!
>
> Kevin
> _______________________________________________
> Edu-sig mailing list
> Edu-sig at python.org
> http://mail.python.org/mailman/listinfo/edu-sig
>
More information about the Edu-sig
mailing list