To edusig@python.org FYI, memo sent earlier today Kirby PS: for more re 'Math Trek' (mentioned below), see http://home.att.net/~mathtrek/ ======================= To: Ivars Peterson Science Writer MAA columnist Fr: Kirby Urner Curriculum writer Oregon Curriculum Network Howdy Ivars  Just wanted to bring your attention (if you have any to spare) to some very recent curriculum writing I've just webpublished: http://www.inetarena.com/~pdx4d/ocn/numeracy0.html http://www.inetarena.com/~pdx4d/ocn/numeracy1.html I consider these pages good summary examples of how K12 math could be rekindled with interesting and challenging new content. Many educators already share my intention to include more exposure to computer languages in K12 math (we were doing this at McGrawHill in the early '80s). I see computer language as an alternative way of expressing mathrelated ideas in humanreadable  yet machineexecutable  form. The software engineers have finally gotten us to the point where we're able to _clarify_ math concepts using their codes, not just further obscure them behind a lot of machinespecific verbiage. Thanks again for getting 'Math Trek' out there. I'm looking forward to 'Math Trek 2'. From what you've said about it so far, it sounds like it'll make a very useful addition to my working syllabus. Kirby PS: I'm reading your 'Jazzing Up Euclid's Algorithm' at http://www.maa.org/mathland/mathtrek_2_14_00.html  we probably share the notion that "numeracy" and "computer literacy" are not wideapart, entirely separate goals.
I've decided to limit it to three instead of four sections  talking about this evolving piece showing Python in a math curriculum context: http://www.inetarena.com/~pdx4d/ocn/numeracy0.html http://www.inetarena.com/~pdx4d/ocn/numeracy1.html http://www.inetarena.com/~pdx4d/ocn/numeracy2.html Enjoying the new IDLE by the way. Thank you Guido! Makes Python all the more teachable, to have those syntax tool tips, other goodies. I noticed while doing the above web pages that it makes a lot of sense to colorcode Python source and even shell window stuff the way IDLE does  really adds to readability  except here I'm between <PRE></PRE> tags in HTML. I invite others doing code snippets on the web to do the same  maybe you do already (URLs?). And maybe someone has already written a Python module that parses .py files into HTML with <font></font> tags added, to mimic IDLEstyle color coding? Or does the new IDLE have a "Save as HTML" option that I missed <wink>? Certainly would make codesharing via web pages an easier part of our routines, no? These web pages clearly exhibit what I was talking about in my earlier posts re how we might be using Python today, with no further enhancements, and in a nonCS context. The math stuff I'm doing is K12, not anything super advanced. So we cover it anyway, in the average workaday classroom, mostly with calculators as the "high technology" of choice these days (sad). My approach in no way needs to be seen as rain on anyone else's parade. Many other ideas for using Python (or other languages) to promote the goals of CP4E have been floated here, and I'm looking forward to learning more about them as time goes on. In the meantime, any feedback is welcome regarding what I've exhibited so far. Those of you promoting Python in whatever walks of life, feel free to show and/or link to my materials as evidence of CP4E's doability. I'll certainly be checking the edusig archives from time to time, even if I soon become less active as a poster. I'm feeling a sense of completion here (is my work done?) and the need to tackle something new. Kirby
I am anxious to share with the EDUSIG a "dynamic geometry" application I have developed (am developing) in Python. I believe if to be quite on point to the foucs of the SIG. It depends upon PyOpenGL, and David Ascher's gltt extension (for true type text under OpenGL), a customized (deprecated) version of IDLE, uses Pynche and of course Tk. As a standalone app (including all necessary Python dll's and libs) it runs about 1.5meg zipped. I run it under WIN98 and have not tried it cross platform. I have no web presence  and am looking for suggestions on getting out to the EDUSIG.
I realized my 3rd section on even/odd, prime/composite numbers was using way more inefficient Python than necessary. My isprime(n) function was invoking get2max(n), which lists all primes up to and including n. Not required, as we already see in sieve(n)  just check prime divisors up to the 2nd root of n, and you'll know if you're dealing with a prime. And you don't even have to go that far  we're done the moment any prime so far divides evenly (the primes list is at the module level, and so persists between function calls). So isprime(n) takes advantage of this, and computes _only_ the minimal number of new primes necessary, if any, to reach a verdict on n's primehood. We're talking _serious_ improvement in speed here. Used to be that pascalpack(26) was about all I had patience for (checks Pascal's Triangle for primes to row 26). I'd go for coffee. Now even pascalpack(64) runs very quickly (seconds). Sheesh. (Pascal's Triangle actually contains precious few primes, and these are relatively low numbers in the next to first/last columns, so pushing get2max to find all primes up to those _huge_ interior numbers  which all fail quickly in the new isprime()  was maddness, just _maddness_ :D).[1] Also fun: I was able to come up with a recursive function for finding the prime factors of a number: def getfactors(n): # return list containing prime factors of a number if isprime(n) or n==1: return [n] else: for i in primes: if n%i == 0: # no remainder n = n/i return [i] + getfactors(n) Usage:
primes.getfactors(28) [2, 2, 7] primes.getfactors(400562313) [3, 17, 19, 479, 863] 3*17*19*479*863 400562313
Short and sweet! Probably old hat for you Schemers out there, who do just about everything imaginable using recursion. But for me, this was a breakthrough. So, yes, I've had to modify http://www.inetarena.com/~pdx4d/ocn/numeracy2.html to reflect these improvements, and upload the improved source code. Kirby [1] what I'd like to do next is upgrade that page to take into account more of what Jim Nugent is studying: Pascal's Triangle with +1 or 1 added to the terms  which gives you lots of primes (except he's using Pascal's Tetrahedron): http://www.twne.com/jnugent/math/Article2.htm
At 11:02 AM 02/18/2000 0500, Arthur Siegel wrote:
I am anxious to share with the EDUSIG a "dynamic geometry" application I have developed (am developing) in Python.
I believe if to be quite on point to the foucs of the SIG.
Could you write more about it? What does it do? Short of loading a lot of software, I'd like to get a sense of what you've been working on. A few screen shots with URLs might be nice (you don't have to do a whole website just to get JPEGs stored out there somewhere). Kirby
It allows one to create relationships in 3d space between geometric "primitives" points,lines,circles, spheres,etc.  by way of simple Python scripts. Points on the initial figure created can then be picked and moved, but all defined relationships follow. It's more sophisticated functions  the uses of arrays of points and lines for example, can be used to explore concepts of Projective Geometry in 3d space. The coding is pretty straightforward. Educationally, I think it would be a great way of making concrete the relationship of synthetic and analytic geometries, while exploring programming concepts at the same time. It can also be seen as its own kind of "drawing" tool, simply to explore and enjoy the aesthetics of geometric relationships in 3d space. There are lots of tools for visualizing 3d constructions, and a few tools for drawing dynamic geometric constructions  but I am not aware of a simple tool that combines the realtime dynamics, and the preservation of relationships in 3d space defined in straightforward and traditional geometric terms. I am neither an advanced programmer nor a sophisticated mathematician. But I do believe I may have stumbled into a quite good combination of form and function by applying Python to this effort. I suspect it would not be accomplishable other than by Python  certainly not in a straightforward, simple and transparent way. Which is why I am hoping it will find some interest here.  Original Message  From: "Kirby Urner" <pdx4d@teleport.com> To: <edusig@python.org> Cc: <ajs@ix.netcom.com> Sent: Friday, February 18, 2000 12:51 PM Subject: [Edusig] "dynamic geometry" application
Could you write more about it? What does it do? Short of loading a lot of software, I'd like to get a sense of what you've been working on.
A few screen shots with URLs might be nice (you don't have to do a whole website just to get JPEGs stored out there somewhere).
Kirby
_______________________________________________ Edusig mailing list Edusig@python.org http://www.python.org/mailman/listinfo/edusig
At 02:06 PM 02/18/2000 0500, Arthur Siegel wrote:
It allows one to create relationships in 3d space between geometric "primitives" points,lines,circles, spheres,etc.  by way of simple Python scripts. Points on the initial figure created can then be picked and moved, but all defined relationships follow. It's more sophisticated functions  the uses of arrays of points and lines for example, can be used to explore concepts of Projective Geometry in 3d space.
Sounds very interesting Arthur. My approach has been to keep things simple in Python by having it write scripts intelligible to other programs which already know tons about 3D graphics. Students write simple Python commands and get .wrl or .pov files out the back, which then go to a VRML viewer (usually a web browser plugin) or to POVray, a free, fullfeatured ray tracing engine. This approach typifies what Python is good for: acting as a "glue language" in collaboration with more specialized apps. What I give up, by going this route, is any trully "dynamic" interface, i.e. students can't just grab stuff with a mouse and twirl it in real time, or add edges/vertices by simply pointing and clicking (as they can in STRUCK, freeware written by my colleague, Gerald de Jong, in Java). I presume because of your OpenGL addin etc., that you're somehow making Python do graphical updates in real time, in response to usergenerated events. Personally, I don't know Tk well enough to know how this is done. Seeing your program would probably teach me a lot. At this point in time, I'd be most interested in seeing screen shots though, since I don't feel ready to digest complicated source code. I'd like to develop an under standing the gist of your technique (without trying to comprehend an entire application). If you want to share any "cave painting" snippets that give me a feel for your strategy, I bet others besides me would be interested. Mostly, what I'm wondering is whether students with a modest grasp of Python would be able to abstract generic strategies and techniques from your tools  what I'm trying to impart at my Oregon Curriculum Network, where all my source code is freely available and dissected in some detail for the benefit of Oregonians (and other lurkers). Kirby Curriculum writer Oregon Curriculum Network
On Tue, 15 Feb 2000, Kirby Urner wrote:
To: Ivars Peterson Science Writer MAA columnist
Fr: Kirby Urner Curriculum writer Oregon Curriculum Network
I know this was a long long time ago, but some other posts reminded me. I read and reread Mr. Peterson's books during middle and highschool, because they were fascinating explorations of mathematics written at an accessible but not belittling level. Kirby, did you hear anything back from Mr. Peterson? Perhaps we could consider following the course of Mr. Peterson's books? Perhaps he's interested in working with us? It seems that his works would provide a wonderful textbook to which we could attach a series of support programs... That is, give modules to do the display of some fractals, and set students free with The Mathematical Tourist. Or perhaps write code to support some randomness experiments to accompany The Jungles of Randomness (anyone read this?) I'd like to see this forum create something solid, or at least the designs of something solid. Kirby's done that on his own, and I think his work serves as an excellent model for work we should continue. Dustin   Dustin Mitchell )O(  
participants (3)

Arthur Siegel

Dustin James Mitchell

Kirby Urner