edu-sig@python.org
[Top] [All Lists]

## [Edu-sig] python satacad: class 5

 Subject: [Edu-sig] python satacad: class 5 "Kirby Urner" Sun, 13 Feb 2005 07:41:12 -0800
 ```The core of class 5 was tackling some number and group theory, as the course description advertises that we'll cover such (plus I *like* this stuff and find Python extremely valuable in communicating it). I think the students were amused that I'd actually tackle this stuff with them. It's not like they're being graded (they'll get certificates of completion), so from their point of view, this is a safe space in which to preview some stuff they might encounter again later. We went through Fermat's Theorem (not the famous last one, but this one): If p is prime then pow(b, p-1, p)==1 provided gcd(b,p)==1. Then I presented this as a specific instance of Euler's Theorem: pow(b, phi(n), n)==1 provided gcd(b,n)==1. It's an instance, because phi(p) = p-1. We'd already discussed what phi(n) means -- that's where I started (source code linked below). The sequence I use is something like this: 1. Euclid's Algorithm (Guido's simplest Python version) 2. Totatives of n 3. Phi(n) 4. Fermat's Theorem 5. Euler's Theorem 6. Some hand waving about the relevance of 5 to RSA (plug for 'In Code' by Flannerys) 7. definition of the P class for doing integer multiplication modulo n 8. group theory result that [P(i) for i in tots(n)] forms a group 9. what's a group? CAIN (closure, associative, inverse, neutral element) That was the tough stuff (they stayed with me for the most part). But interleaved was plenty of play and mental relaxation, including: Elastic Interval Geometry java programs: fluidiom.v2.nl (one of the most sophisticated applets ever written) www.springie.com (cute/clever EIG application) I explain how knowing Python is going to make Java seem a lot more accessible, and there're still good reasons for learning Java, including this whole applet technology, which Python does not duplicate. We also played with and projected: Terra server: http://terraserver.microsoft.com/ Kids enjoyed locating their homes and schools etc. Our area happens to be one of those terraserved. One student turned me on to keyhole as a perhaps better alternative: http://www.keyhole.com/ (looking into it) All of this is more fun given the big screen up front. The plan is to project Pygeo and some VPython under this heading of "fun stuff" next week (last class), as well as to delve into the J language some (again per course catalog). Much of the Python source code we've been using over the weeks, plus one student POV-Ray .pov and rendering (used with permission, so long as identity of student held back) are viewable here: http://www.4dsolutions.net/satacad/sa6299/ (I notice that test7.bmp is 2.3 meg -- I'll convert it to compressed format after I post this email (POV-Ray output is defaulting to bmp in our class)). Kirby PS: I spent the rest of Saturday working with Free Geek to migrate data from an Access MDB to Postgres, for an open source Perl app called sql-clinic. That took several hours. _______________________________________________ Edu-sig mailing list Edu-sig@xxxxxxxxxx http://mail.python.org/mailman/listinfo/edu-sig ```