Math + Python: reviewing some themes (long)

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. 1. PYCON ========= An entreaty that usa.pycon 2010 education track events get some chronicling here, by those lucky enough to attend. I'll be following remotely. 2. OSCON ========= 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. 3. MFTDA ========= More thoughts on 'Mathematics for the Digital Age' (MFTDA): This could obviously be used at the college level as a discrete math course offering. 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 guessing. 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 elective. 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). http://apcentral.collegeboard.com/apc/public/courses/teachers_corner/index.h... 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 Algebra 2. 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 component. http://www.amazon.com/Elementary-Linear-Algebra-S-Venit/dp/0871500949/ref=tm... 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 languages. 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 math course. 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 an appearance. 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.
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 no-longer named. 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 programming. 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. http://wikieducator.org/PYTHON_TUTORIALS#Classes 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 do it"). 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 else? 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 discussion. 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 exceptions). 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? Kirby

kirby urner wrote: articles on revising CS curricula in recent issues of Communications of the ACM. I recommend the articles by Chris Stephenson and Peter Denning (December 2009).
MRO was an advanced topic in an advanced chapter on OOP, not anything I would include in an introductory course. In fact, I wouldn't even make OOP a special topic. It's just the most natural way to solve a lot of problems. Students should be *using* objects (lists, etc.) from day 1. Then, if there is time later in the course, I would show how to *design* objects. Even then, you really don't have to say much about inheritance, polymorphism, abstract classes, MRO, and all the stuff that professional programmers will get in later courses. The thing you want to avoid is having students think "What is this crap?" That's sometimes necessary in math. You can't appreciate the utility of eigenvectors until you understand them. It's totally unnecessary in programming. Let real-world examples lead the way. If you can't start with a simple example where multiple inheritance is needed, don't even introduce the topic.
http://wikieducator.org/User:Macquigg (I recommend reading Dr. Macquigg's excellent testimonial here, with a link to his PyWhip).
PyWhip is the tool that is needed by math and science teachers who want to use computation in their classes, but feel uncomfortable trying to teach programming. It will include problems in chemistry, physics, calculus, whatever someone wants to contribute. All a teacher has to do is stay one step ahead of the students. Anyone capable of teaching science or math can do that. Unfortunately, our grand plans have been stalled for lack of a volunteer web programmer who can finish the hardest part of the job - the last 10%. We are considering applying for a grant, so we can hire a professional. I wish I had more time. Google App Engine, Django, Web2py... it all looks very interesting.
So yes, the CS professors are right. A full blown intro to classes is too much to start off with.
Actually, CS professors, as a group, are more likely to want "full blown" tailored to the needs of future programmers. Us industry types are more likely to say "Screw this. I can write all the programs I need in BASIC and C." That was my attitude from when I first learned about OOP (1992) until discovering Python (2002). This was not for lack of trying. I read a book on C++, and concluded that a better name would have been C--.
I would use built-in objects first, then user-defined. Students should be very comfortable with dot notation before we even suggest that you can do more than just use the built in objects in Python. To introduce dot notation, I would just show examples. It's kind of like learning to have a simple conversation in Spanish ("Hola, Isabel. Como esta!!) before studying the grammar, or even learning the vocabulary. See the section "Elegant Python" in http://pywhip.appspot.com/static/help/Using_Python.htm. A student's first encounter with dot notation will be the line: workset.append(n) # append n to the workset Other than that comment, and a prior statement: "... see if you can understand how this function works. Practice using the dir() and help() functions on list objects and their methods.", there is no explanation of this grammar. It's just a convenient way to say something Later, in http://pywhip.appspot.com/static/help/Strings.txt we talk a little more about the grammar, and the equivalence of two different notations: >>> len('abcde') # same as 'abcde'.__len__() Putting too much emphasis on a topic can actually make it harder to understand. I remember struggling with lambda functions for quite a while, even wasting time in a discussion of lambda calculus, then realizing it was nothing but a trivial bit of syntax, and I really wasn't missing something important. Gary has a good point that we may be still putting too much emphasis on "objects first". It's got me thinking whether I need to rewrite that section in Using_Python where I show that 2 is an object. The fundamental point of this section is Python's unique relationship between variables and objects. The rest is anecdotal. Anecdotal information can distract from the main point. PyWhip will have the ability for a teacher customize everything - problem sets, help files, whatever is needed for a particular group of students. When a student logs in, he will see exactly what his teacher intends him to see. The help files referenced above may be too brief for high school students. My target audience is technical professionals who already know how to write a program, perhaps in BASIC. I encourage others to submit alternatives better suited to whatever background your students may have. -- Dave

On Tue, Jan 26, 2010 at 2:53 AM, David MacQuigg <macquigg@ece.arizona.edu> wrote:
...
I would call it "Computational Thinking". There have been a series of articles on revising CS curricula in recent issues of Communications of
the
ACM. I recommend the articles by Chris Stephenson and Peter Denning (December 2009).
Thx for the pointer! INTERNATIONALIZATION =================== Singapore Math, popular among home schoolers / scholars, has been explicitly IT-friendly for a long time and I'm wondering if something more like MFTDA will be issuing forth from that corner. Wouldn't surprise me. A Japanese equivalent might base itself around Ruby for coding but otherwise seem somewhat similar. Phillips Academy is a pace-setter, not unlike West Point, so I'm sure this curriculum is getting eyeballed by education experts overseas (if they're doing their jobs). I've been sharing it around the Portland for sure, and we're quite the cosmopolitan hub, news spreads... I just think "digital math" (whatever we call it) is hovering in the global Zeitgeist these days, MFTDA another harbinger, a positive sign on the horizon. Over on math-teach today, we're getting links like this one: http://www.dougengelbart.org/home-page/welcome-to-the-bootstrap-alliance.htm... It's not like Seymour Papert or Doug Engelbart wree born yesterday or anything. It's just that NCTM is finally taking more interest in Web 2.0 and such topics. http://nctmconference.blogspot.com/2009/04/blogs-tweets-and-web-20.html http://www.slideshare.net/mcleme4419/eclips-nctm-boston-secondary etc.
3.d OBJECTS FIRST? ====================
.... problems. In my view, the promise of OO, starting with Smalltalk, was to mirror a way we already think. The word "object" does not belong to computer science originally, but to ordinary language. Dot notation is supposed to be expressive because we're *not* trying to inculcate some inner circle knowledge of computer internals, memory management, garbage collection. We're just leveraging what's already a feature of ordinary thought patterns. Lesson plan: === Student A comes to the front of the room, writes a few commands on the white board she is willing to obey....
carla.walk(10)
carla.say("Hello")
carla.dance_move(1)
Student B holds a pointer, and in response to requests (raise hands, polling), points to a requested action. Student A carries out the requested behavior. Kids who've played Sims already know the drill. We're talking about puppets. There's no computer anywhere in this picture, just dot notation and a way of triggering behaviors. Followup: Get volunteers A, B, C in front of the room and have a wadded up piece of paper as an argument. Call that a "message object" and have commands for passing it:
carla.has_message True
carla.pass_message(jim)
carla.has_message False
jim.has_message True
etc. === BIOLOGY FIRST ================
My preferred technique, described over the years as "cave painting" involves putting something rather simple on the screen. Walk through a Dog and Monkey class, then show how you might move the digestive tract methods, eat and poop (stomach a list) to the Mammal class and inherit. This is just a language game and doesn't have to be that intimidating. Biology is already cram packed with this inheritance metaphor, is where I'd argue CS got it in the first place. If the objective is to teach STEM subjects (the buzz word), then we might as well appeal directly to the biology teachers at this point, suggest they leverage the Python knowledge students are getting down the hall, in their math classes, to reinforce the idea of genetic inheritance and species differentiation. In sum, I think the best way to teach OO is not make it *not* a strictly computer science topic, but just a science topic more generally. Something like full blown UML would be overkill, but if your job is to design an airport, or manage one, it makes perfect sense to ask "what are the objects I need to be dealing with, and what are their attributes and behaviors." Runways, airplanes, control tower, concourse, baggage carousels, parking garage, fuel tanks, snack and gift shops.... we don't have to spend a lot of time on any one institution, and we don't have to write even a single line of code if that's not what we're into. The idea is to have students look at a knowledge domain and start analyzing it in terms of objects, as a prelude to problem solving. Don't need a computer.
Yes, let real-world examples lead the way, I fully agree. Back to "cave paintings" -- you get something simple projected, like 20 lines of Python to implement Dog and Monkey as inheriting from Mammal, and then you talk in a more story-like mode about how today's programming languages come pre-equipped with these "foundation classes" or "libraries" that mirror biological ecosystems. They're huge and offer vast resources, if you know how to tap them. You have all these lineages, tree structures, where objects inherit the capabilities of ancestor objects, sometimes more than one. AROUND THE CAMPFIRE MATH ========================= Why story-like mode hardly happens in math class today is students get all fidgety if they think this will be on the test. And if it's not going to be on the test, then why listen? This idea of "around the campfire" storytelling, where you're simply explaining how things work, giving as spell-binding an account as possible, maybe showing a movie (like 'Warriors of the Net' re tcp/ip) is just not a feature of most math classes today. That's part of what's broken about our K-12 pipeline. The dry technicalities have taken over at the cost of not teaching anything much about the real world. The "stories", insofar as we have any, feature in "story problems" and are typically empty of real content by design. This was one of my topics at us.pycon 2009, co-presented with Steve Holden (PSF chairmain). In the vocabulary of mathematics, a "cave painting" is a homomorphism more than an isomorphism (a fancy way of saying it's a structure-preserving analogy that drops a lotta details, but suggests them)
http://wikieducator.org/User:Macquigg (I recommend reading Dr.
Macquigg's
This is a grand vision, grander than I'd realized. Crunchy is in the same genre perhaps? A lot depends on what's in the repository. Some projects separate framework from content, so you could get help with the framework as open source, yet still have content behind a course-related repository that requires student login? PyWhip installations could spread all over the place, but we'd only see the public ones unless we enrolled in the right courses (same model as Python itself -- a lot of it we just don't hear about, because it's too busy making a profitable contribution to some secret government project or some Hollywood movie).
Unfortunately, our grand plans have been stalled for lack of a volunteer
web
You've considered making it an open source project? Or is it already?
So yes, the CS professors are right. A full blown intro to classes is
too
MORE AUTOBIO ============== Yeah. My trajectory was as an xBase programmer, writing code for a multi-warehouse food bank, keeping various membership-based nonprofits happy (my specialty was nonprofits and local government). Then Microsoft bought FoxPro to compete with Borland, which bought dBase. MSFT migrated xBase to Windows, then converted it to an object-oriented language, quite a bit better than Visual Basic IMO. I ended up in the cardiac operating room about then, coding for heart surgeons. Some "object oriented" languages give you dot notation and ways to use objects, but precious little syntax for rolling your own. xBase, in the form of Visual FoxPro, had inheritance and all the rest of it. When I got to Python by way of Java, I was already an experienced OO guy in a practical sense, though Java / Python helped catch me up on the theory (I read a lot of Bruce Eckel's stuff).
TEACHER-DEVELOPED CURRICULA =============================== Yes, back to my demo in front of the room. Hard to think of a much better intro to dot notation that simply using a turtle. In the original Logo, you didn't have a receiver i.e. FORWARD 10 was about "the turtle" and there was only one. In fact, the very first turtle was an actual robot, more like Lego Mindstorms CRX brick, or whatever they're calling it today. Today though, our turtles are explicit, easy to have more than one. OO includes the concepts of birth and death i.e. an object has a life span. Temporality is important. In the brainstorming I'm doing, we actually attempt to avoid dictating the best pedagogy. Our attitude is teachers know their own students best, and plus won't want to teach what they don't comprehend. So the teacher trainers run through all these techniques, including Objects First, but then they don't say "you must do this". It's more like "here's a practice, a style, which some are using, up to you if you wanna." Teachers actually appreciate getting to make a final judgment for themselves. Maria Droujkova and Anna Roys have helped me become more attuned to the emerging subcultures of collaboration among teachers. Once you get cyberspace into the picture, it changes not only course content, but how teachers want to develop that content. They chafe and complain if you insist they use just these or those resources. Innovating new content becomes part of their responsibility, in collaboration with peers, including internationally. Like I'm working with this guy in Indonesia...
while,
Yes, good point. We want OO to be intuitive, non-intimidating. Starting with some "unplugged" approach (per New Zealand), doing OO and dot notation externally to any computer language, might be the way to go in some lesson plans (per above examples, many others we could brainstorm). Exercise: script out your day so far, since getting up, in terms of dot notation: Example:
OK to be loose with the syntax, just getting ideas across. Looks like Python but there's no computer turned on.
and
objects. The rest is anecdotal. Anecdotal information can distract from the main point.
My attitude in presenting an "objects first" option (note *option*) would be to emphasize how we already know how to think in terms of objects, including the inheritance part, and we don't want any silly computer language to get in our way, obscuring what we already know. Computer languages should be expressive in helping us think more like we do already. They're here to serve us, not the other way around. Back to storytelling mode: no problemo talking about these "different paradigms" and how computer languages have evolved. If students think they're allowed to just listen to stories, like on Discovery Channel, they'll relax and do so. But the climate today (in many schools) is too high anxiety because either (a) what the teacher is saying is going to be on the next test, or (b) there's no point listening. That's a killer. Subcultures that box themselves in this way are not likely to have much of a half life. Without shared lore, shared stories, there's no glue and no culture. When I start teaching Python to a new group, I start talking about PEPs, about how the language evolves, about the subculture. I want them to have this notion of geeks around the world all collaborating, working together. Like I go to that Wiki page Carl has been working on and show how we're starting to see code that's very "not Latin-1" in appearance. There's a cosmopolitan flavor, right from the start. If they haven't seen one Chinese character by the end of the first week, I've done something wrong (by my own lights -- YMMV).
Noted. I hope we don't get too hung up on Objects First versus Objects Later, as I think the situation on the ground is always going to be somewhat diverse. For example, it's easy for me to imagine MFTDA getting used as a 2nd year course on our Oregon DM track (discrete math track), once we've successfully piloted a course that has no AP objectives, isn't considered early college. Prep for the new math course might use MFTDA in teacher trainings though, i.e. as the math teacher, you want that on your shelf (along with Zelle's, a few others). We have many high caliber schools that could go the MFTDA right away, too (it's not either/or). Just saying: if DM is about bridging the digital divide, then it has to meet student needs at various levels. That's the challenge in a nutshell. We want to rescue something broken. Math content in Oregon is 10-20 years behind the times and we need to administer "future shock therapy" in ways that don't simply exacerbate the currently untenable situation. That's a focus around here, even as we're talking Python for a language. We're catering to "math refugees" who are seriously considering dropping out of high school completely. My work with the Hillsboro Police Department, which had Linux labs for immigrant children, was along these lines. According to one scenario, students taking the next course in sequence and using the Litvins' text, will already have at least of semester of Python behind them, maybe more. This will change the character of the presentation, but not that drastically, as we're already used to a lot of repetition in mathematics i.e. each successive year goes back over some of the fundamentals. So we might do more with operator overloading then? MFTDA is purposely light on that topic, whereas I'm into __ribs__ galore (a veritable snake BBQ seems like). I like to rush into operator overloading because I want students to start generalizing about addition and multiplication, and what better way than to have these different objects doing those things in their own special ways -- but with commonalities. You get a more "abstract algebra" sensibility that way. We do more with group, ring and field, simply because Python makes everything so concrete, so hands-on. "Group theory for children" was a movement in the 1960s I think it was. Perhaps it's time to resurrect that? We shall see. One of Maria's from last year: http://www.mail-archive.com/edu-sig@python.org/msg05186.html Kirby

On Tue, Jan 26, 2010 at 3:20 PM, kirby urner <kirby.urner@gmail.com> wrote:
In sum, I think the best way to teach OO is not make it *not* a strictly computer science topic, but just a science topic more generally.
Messed that one up eh? Make it *not* a strictly computer science topic... So you've all heard this joke.... Professor: interestingly, a double negative constitutes a logical positive, as in "not no" or "not not", however we have no expression in English where a double positive denotes a negative. Student in the back, sarcastically: Yeah, right. Kirby PS: I'm a huge fan of Java by the way, in the hands of a skilled coder such as Gerald de Jong: http://www.darwinathome.org/blog/2010/01/26/Tensegrity-Sphere-Movie.html

From: kirby urner <kirby.urner@gmail.com> Date: Tue, Jan 26, 2010 at 3:20 PM Subject: Re: [Edu-sig] Math + Python: reviewing some themes (long) To: edu-sig@python.org On Tue, Jan 26, 2010 at 2:53 AM, David MacQuigg <macquigg@ece.arizona.edu> wrote:
...
Thx for the pointer! INTERNATIONALIZATION =================== Singapore Math, popular among home schoolers / scholars, has been explicitly IT-friendly for a long time and I'm wondering if something more like MFTDA will be issuing forth from that corner. Wouldn't surprise me. A Japanese equivalent might base itself around Ruby for coding but otherwise seem somewhat similar. Phillips Academy is a pace-setter, not unlike West Point, so I'm sure this curriculum is getting eyeballed by education experts overseas (if they're doing their jobs). I've been sharing it around the Portland for sure, and we're quite the cosmopolitan hub, news spreads... I just think "digital math" (whatever we call it) is hovering in the global Zeitgeist these days, MFTDA another harbinger, a positive sign on the horizon. Over on math-teach today, we're getting links like this one: http://www.dougengelbart.org/home-page/welcome-to-the-bootstrap-alliance.htm... It's not like Seymour Papert or Doug Engelbart wree born yesterday or anything. It's just that NCTM is finally taking more interest in Web 2.0 and such topics. http://nctmconference.blogspot.com/2009/04/blogs-tweets-and-web-20.html http://www.slideshare.net/mcleme4419/eclips-nctm-boston-secondary etc.
3.d OBJECTS FIRST? ====================
....
In my view, the promise of OO, starting with Smalltalk, was to mirror a way we already think. The word "object" does not belong to computer science originally, but to ordinary language. Dot notation is supposed to be expressive because we're *not* trying to inculcate some inner circle knowledge of computer internals, memory management, garbage collection. We're just leveraging what's already a feature of ordinary thought patterns. Lesson plan: === Student A comes to the front of the room, writes a few commands on the white board she is willing to obey....
carla.walk(10)
carla.say("Hello")
carla.dance_move(1)
Student B holds a pointer, and in response to requests (raise hands, polling), points to a requested action. Student A carries out the requested behavior. Kids who've played Sims already know the drill. We're talking about puppets. There's no computer anywhere in this picture, just dot notation and a way of triggering behaviors. Followup: Get volunteers A, B, C in front of the room and have a wadded up piece of paper as an argument. Call that a "message object" and have commands for passing it:
carla.has_message True
carla.pass_message(jim)
carla.has_message False
jim.has_message True
etc. === BIOLOGY FIRST ================
My preferred technique, described over the years as "cave painting" involves putting something rather simple on the screen. Walk through a Dog and Monkey class, then show how you might move the digestive tract methods, eat and poop (stomach a list) to the Mammal class and inherit. This is just a language game and doesn't have to be that intimidating. Biology is already cram packed with this inheritance metaphor, is where I'd argue CS got it in the first place. If the objective is to teach STEM subjects (the buzz word), then we might as well appeal directly to the biology teachers at this point, suggest they leverage the Python knowledge students are getting down the hall, in their math classes, to reinforce the idea of genetic inheritance and species differentiation. In sum, I think the best way to teach OO is not make it *not* a strictly computer science topic, but just a science topic more generally. Something like full blown UML would be overkill, but if your job is to design an airport, or manage one, it makes perfect sense to ask "what are the objects I need to be dealing with, and what are their attributes and behaviors." Runways, airplanes, control tower, concourse, baggage carousels, parking garage, fuel tanks, snack and gift shops.... we don't have to spend a lot of time on any one institution, and we don't have to write even a single line of code if that's not what we're into. The idea is to have students look at a knowledge domain and start analyzing it in terms of objects, as a prelude to problem solving. Don't need a computer.
Yes, let real-world examples lead the way, I fully agree. Back to "cave paintings" -- you get something simple projected, like 20 lines of Python to implement Dog and Monkey as inheriting from Mammal, and then you talk in a more story-like mode about how today's programming languages come pre-equipped with these "foundation classes" or "libraries" that mirror biological ecosystems. They're huge and offer vast resources, if you know how to tap them. You have all these lineages, tree structures, where objects inherit the capabilities of ancestor objects, sometimes more than one. AROUND THE CAMPFIRE MATH ========================= Why story-like mode hardly happens in math class today is students get all fidgety if they think this will be on the test. And if it's not going to be on the test, then why listen? This idea of "around the campfire" storytelling, where you're simply explaining how things work, giving as spell-binding an account as possible, maybe showing a movie (like 'Warriors of the Net' re tcp/ip) is just not a feature of most math classes today. That's part of what's broken about our K-12 pipeline. The dry technicalities have taken over at the cost of not teaching anything much about the real world. The "stories", insofar as we have any, feature in "story problems" and are typically empty of real content by design. This was one of my topics at us.pycon 2009, co-presented with Steve Holden (PSF chairmain). In the vocabulary of mathematics, a "cave painting" is a homomorphism more than an isomorphism (a fancy way of saying it's a structure-preserving analogy that drops a lotta details, but suggests them)
This is a grand vision, grander than I'd realized. Crunchy is in the same genre perhaps? A lot depends on what's in the repository. Some projects separate framework from content, so you could get help with the framework as open source, yet still have content behind a course-related repository that requires student login? PyWhip installations could spread all over the place, but we'd only see the public ones unless we enrolled in the right courses (same model as Python itself -- a lot of it we just don't hear about, because it's too busy making a profitable contribution to some secret government project or some Hollywood movie).
You've considered making it an open source project? Or is it already?
MORE AUTOBIO ============== Yeah. My trajectory was as an xBase programmer, writing code for a multi-warehouse food bank, keeping various membership-based nonprofits happy (my specialty was nonprofits and local government). Then Microsoft bought FoxPro to compete with Borland, which bought dBase. MSFT migrated xBase to Windows, then converted it to an object-oriented language, quite a bit better than Visual Basic IMO. I ended up in the cardiac operating room about then, coding for heart surgeons. Some "object oriented" languages give you dot notation and ways to use objects, but precious little syntax for rolling your own. xBase, in the form of Visual FoxPro, had inheritance and all the rest of it. When I got to Python by way of Java, I was already an experienced OO guy in a practical sense, though Java / Python helped catch me up on the theory (I read a lot of Bruce Eckel's stuff).
TEACHER-DEVELOPED CURRICULA =============================== Yes, back to my demo in front of the room. Hard to think of a much better intro to dot notation that simply using a turtle. In the original Logo, you didn't have a receiver i.e. FORWARD 10 was about "the turtle" and there was only one. In fact, the very first turtle was an actual robot, more like Lego Mindstorms CRX brick, or whatever they're calling it today. Today though, our turtles are explicit, easy to have more than one. OO includes the concepts of birth and death i.e. an object has a life span. Temporality is important. In the brainstorming I'm doing, we actually attempt to avoid dictating the best pedagogy. Our attitude is teachers know their own students best, and plus won't want to teach what they don't comprehend. So the teacher trainers run through all these techniques, including Objects First, but then they don't say "you must do this". It's more like "here's a practice, a style, which some are using, up to you if you wanna." Teachers actually appreciate getting to make a final judgment for themselves. Maria Droujkova and Anna Roys have helped me become more attuned to the emerging subcultures of collaboration among teachers. Once you get cyberspace into the picture, it changes not only course content, but how teachers want to develop that content. They chafe and complain if you insist they use just these or those resources. Innovating new content becomes part of their responsibility, in collaboration with peers, including internationally. Like I'm working with this guy in Indonesia...
Yes, good point. We want OO to be intuitive, non-intimidating. Starting with some "unplugged" approach (per New Zealand), doing OO and dot notation externally to any computer language, might be the way to go in some lesson plans (per above examples, many others we could brainstorm). Exercise: script out your day so far, since getting up, in terms of dot notation: Example:
OK to be loose with the syntax, just getting ideas across. Looks like Python but there's no computer turned on.
My attitude in presenting an "objects first" option (note *option*) would be to emphasize how we already know how to think in terms of objects, including the inheritance part, and we don't want any silly computer language to get in our way, obscuring what we already know. Computer languages should be expressive in helping us think more like we do already. They're here to serve us, not the other way around. Back to storytelling mode: no problemo talking about these "different paradigms" and how computer languages have evolved. If students think they're allowed to just listen to stories, like on Discovery Channel, they'll relax and do so. But the climate today (in many schools) is too high anxiety because either (a) what the teacher is saying is going to be on the next test, or (b) there's no point listening. That's a killer. Subcultures that box themselves in this way are not likely to have much of a half life. Without shared lore, shared stories, there's no glue and no culture. When I start teaching Python to a new group, I start talking about PEPs, about how the language evolves, about the subculture. I want them to have this notion of geeks around the world all collaborating, working together. Like I go to that Wiki page Carl has been working on and show how we're starting to see code that's very "not Latin-1" in appearance. There's a cosmopolitan flavor, right from the start. If they haven't seen one Chinese character by the end of the first week, I've done something wrong (by my own lights -- YMMV).
Noted. I hope we don't get too hung up on Objects First versus Objects Later, as I think the situation on the ground is always going to be somewhat diverse. For example, it's easy for me to imagine MFTDA getting used as a 2nd year course on our Oregon DM track (discrete math track), once we've successfully piloted a course that has no AP objectives, isn't considered early college. Prep for the new math course might use MFTDA in teacher trainings though, i.e. as the math teacher, you want that on your shelf (along with Zelle's, a few others). We have many high caliber schools that could go the MFTDA right away, too (it's not either/or). Just saying: if DM is about bridging the digital divide, then it has to meet student needs at various levels. That's the challenge in a nutshell. We want to rescue something broken. Math content in Oregon is 10-20 years behind the times and we need to administer "future shock therapy" in ways that don't simply exacerbate the currently untenable situation. That's a focus around here, even as we're talking Python for a language. We're catering to "math refugees" who are seriously considering dropping out of high school completely. My work with the Hillsboro Police Department, which had Linux labs for immigrant children, was along these lines. According to one scenario, students taking the next course in sequence and using the Litvins' text, will already have at least of semester of Python behind them, maybe more. This will change the character of the presentation, but not that drastically, as we're already used to a lot of repetition in mathematics i.e. each successive year goes back over some of the fundamentals. So we might do more with operator overloading then? MFTDA is purposely light on that topic, whereas I'm into __ribs__ galore (a veritable snake BBQ seems like). I like to rush into operator overloading because I want students to start generalizing about addition and multiplication, and what better way than to have these different objects doing those things in their own special ways -- but with commonalities. You get a more "abstract algebra" sensibility that way. We do more with group, ring and field, simply because Python makes everything so concrete, so hands-on. "Group theory for children" was a movement in the 1960s I think it was. Perhaps it's time to resurrect that? We shall see. One of Maria's from last year: http://www.mail-archive.com/edu-sig@python.org/msg05186.html Kirby

kirby urner wrote:
It is open source, and the problem we are facing is precisely because it is open source (i.e. unpaid). With rare exceptions, open-source project involving more than one developer don't get finished. The fun parts get done, but not the tedious parts. We've tried to give our volunteer web programmers a "starring role" on our about page, but actually it's the teachers who will get most of the credit and who will make the key decisions on content. It's hard to motivate a volunteer web programmer in this situation. Hence, we are considering a departure from the open-source ideal, and just paying someone to get the job done.
From the examples you have given, I think there is not much difference between us. Its just that our terminology is confusing. I may have contributed to that confusion in our earlier discussion of OOP. I felt I had to jump in on this thread when it looked like you thought I was suggesting MRO would be a good topic in an introductory course. When I hear Objects First, I think of an over-reaction which occurred because we had to break some old habits and force students to do something that was initially difficult. Now that we have languages that allow an easy and natural approach to objects, we need no special emphasis on Objects First. We don't need Objects Only languages to force students to use objects. When I hear Object Oriented Programming, I think of something much more difficult than the examples you have shown, something that might even get into the intricacies of MRO, something that is normally taught to CS majors in a full semester in the third year of college. If it is just *using* objects in a natural way, I think everyone agrees that is a fine way to introduce programming. If it is a little more than that (as I think you intend) that is OK also, even if it not what I would do. When students log on to pywhip.org/~urner, they will see exactly what you want them to see. -- Dave

On Fri, Jan 29, 2010 at 10:49 AM, David MacQuigg <macquigg@ece.arizona.edu> wrote: << >>
Good summary and yes, our positions are not so far apart. The little bit more that I add takes advantage of this thinking in terms of objects, not just a computer thing, and turns that into "math objects" such as polynomials, rationals, polyhedra, integers modulo n, matrices -- things we might model as types and therefore classes (in Python's namespace anyway). There's a unifying heuristic not out of line with inherited mathematics i.e. we already believe in types e.g. N, Z, Q, R, C (natural, integer, rational, real, complex..) and so on, so pretty seamless. So that means we're actually getting to user defined classes and taking advantage of operator overloading in the guise of wanting a stronger understanding of math concepts, but not because we're all planning to become professional computer programmers. So we stop short of MRO, maybe never need multiple inheritance, might not use properties, decorators -- I'm not the one to decide for each teacher, just saying I find it easy to envision a productive math course (such as we've sampled many times on edu-sig) that doesn't go into all that, or leaves it more up to individual students how much they want to dabble on the side, in which case we have resources available. So yeah, those kinds of more advanced computer science courses are available, sure. David MacQuigg might be one of your teachers? I'm more interested in spinning an icosahedron object, a subclass of Polyhedron, and calling it a day. I'm more like a high school geometry teacher, not some geek with a talk on the latest design pattern. I'm mostly doing stuff the ancient greeks would have followed, had they a One Laptop Per Child program. Kirby

On Fri, Jan 29, 2010 at 3:30 PM, kirby urner <kirby.urner@gmail.com> wrote:
Actually, things are not so seamless in the secondary curriculum! : ) Just this week I had a fascinating experience exposing a seam in the current secondary understanding of naturals. There was a question on our Analysis final asking kids to find {whole numbers} [image: \bigcap] {natural numbers}. That question really bothered me for two reasons: at the beginning of the year I made it a big point to emphasize to the kids that the typical schoolish distinction of the naturals as {1, 2, 3, ...} and the 'wholes' as {0, 1, 2, 3, ...} is fuzzy. Back in the 19th century set theorists, logicians, and number theorists were advocating a definition of the naturals as {0, 1, 2, 3, ...}. Today we would include computer scientists as advocating that definition. I asked them, "How many of you have been marked wrong on a math test because you said zero was a natural number?" So, wow, the universe operates in amazing ways for that very question to then show up on the final! And that was the second reason I was bothered. I should have been included in the final proofreading! The version I saw did not have this question! Although, I was not really that bothered. I was actually delighted, because it provided very good reason for having a pointed discussion. My colleagues were clearly baffled to find out that something that has always been accepted as so fundamental in high school math has actually had two interpretations since the 19th century! So when we start second semester we're going to have another class discussion on this! I'm going to ask them if they remember my emphasizing this, and if they recalled this when they took the final. I think this very issue is important in emphasizing what we would mean by a 'computational' math curriculum. It's not just about the machine. It's not just about 'using technology' to help us solve math problems. It's about a new way of thinking. And in this new way of thinking there are a whole lot of good reasons for teaching kids to think of zero as a natural number. There's really no need served by including a 'seam' between the 'wholes' and the 'naturals'. I think emphasizing that kind of distinction as early as our curriculum does causes all kinds of fundamental confusion. Recently I've found Sage <http://sagemath.org> invaluable for the purpose of getting computational thinking into the math curriculum. I've spent the last year figuring out how to harness Sage in class, and it is paying off. The difficulty with a pure Python approach has been that it seems so foreign to everyone from kids through administrators, it doesn't look like anything that gets tested on state standards, and it seems like 'hard work' when we already have these nifty hand-helds that graph any function you want. However, the power of Sage blows any graphing calculator, even the new Inspires, out of the water. Simultaneously, you can program in pure bare-bones Python within Sage. So I have found it invaluable to capitalize on the power of Sage to serve as a way to introduce into math classes the value of the ability to think in pure Python. Regarding the whole 'hand-held' selling point, these days this is a meaningless point. You can access your Sage notebook worksheets using a smart phone! Instead of 'hand-held' I've been advocating 'mind-held'. A language is mind-held. Pretty cool. I've been using Sage as my blackboard in my Analysis classes, and I've even been able to start showing my FST kids (Functions, Statistics, Trig) pure bare-bones Python. They're supposedly the mathematically weaker, so I have more wiggle room in the curriculum. I asked them at mid-semester if they would be interested in learning pure bare-bones Python, and they said "Yes!" I was delighted. I did a lot of list-comprehensions with them. Throw out a function and a domain. Exercise: define a list of ordered pairs using list comprehension. They really could do it. Especially one kid who has always hated math. He said this really made sense. I also had them do some turtle stuff and some Visual Python stuff. Just simple things. Like one day using Visual in the lab we made 3-D parabolas out of spheres hanging in space. Way different than your typical graph. The kids really liked being able to zoom in and around the sphere, and I was thrilled that they were getting list comprehensions. A lot of them are still operating at the level of 'tell me what to do', but there are also others that are exploring. One of the really valuable features in Sage notebook is @interact. With it you can create interactive graphics for any function you want. Specify a function parameter, say x = (-10..10), and presto! When you evaluate the cell, that parameter gets represented as a slider from -10 to 10! Very cool, and very easy. I finally feel like I'm getting some traction on implementing a computational mathematics course. I came really, really close last year, but lack of action (due to a conflict of interests) smashed it. I was devastated, but I warned my department chair - "I'm not going to shut up about this!" it's been really, really hard, but I finally feel that useful discussion is happening. The counselors have requested a course description that they can hand out to students and their parents. I'm delighted that they're doing this. I'll append it below. Sort of an updated Manifesto! : ) Oh, but first - if this course does happen I'll be using the Litvins' Math for the Digital Age. I love that book. I told my prinicipal, "You usually don't say of a text that 'It's beautiful', but this one is. This is a beautiful text." *M A C H Math Analysis Computational Honors* *What does “Computational” mean?* "It is said that a concept is demonstrated to have been learned the best when one explains that concept to others. Programming is precisely that - an expressive language, used to unambiguously describe all the steps involved in problem solving of a certain type." - Tony Targonski *Computational Thinking* is a new way of thinking that will become just as important to a well-educated person in the 21st century as reading and writing is today. It has resulted in new inter-disciplinary majors such as Computational Linguistics, Computational Biology, Computational Physics, and Computational Mathematics, among others. Generally speaking, computational thinking is the art of reducing complexity to a set of primitive operations. This way of thinking blends perfectly with the kind of thinking that Math Analysis is supposed to be about. *Students taking this course should not worry if they have never* *programmed before.* This course will introduce a complete beginner to contemporary programming in a way that will enable them to efficiently articulate mathematical concepts. *The point of this course is* *not learning to program, but programming to learn.* We will be using a very easy to learn language called *Python*. *What is *Python?** Python is a general purpose programming language that has developed a large following over the last ten years or so. It is one of the top languages used at Google and is also used at NASA, JPL, and YouTube and is continuing to gain significant attention. It is an extremely easy and fun language to learn. You can immediately begin to use it just like a calculator. It is free to everyone and runs on all platforms. It is also an excellent language for expressing mathematical ideas, and that is why many mathematicians and scientists gravitate towards it. It is just as easy to learn as high school Algebra, and learning it will help you better understand Algebra. After you have learned some Python you will be ready to use Sage. *What is *SAGE?** SAGE is a set of mathematical libraries built on top of Python creating a free and open source state of the art CAS, Computer Algebra System, used by professional mathematicians, university math departments, and even some high school math departments. SAGE offers Mathematica-like abilities, such as detailed 3D color graphing. Cutting edge research is being done with it, but it is also quite usable by high school students. Anyone who knows a little Python can immediately begin to use SAGE. You can actually use many of the features in SAGE without knowing any Python, but you will be able to use it much more effectively if you also know how to think in terms of simple Python programs. What you will learn in this course is how to *computationally analyze* some fundamental ideas of mathematics. Your ability to computationally analyze will provide you a good foundation for many important kinds of study and career. A student working through this class will be well prepared both for further study of computer science and mathematics. "Computer science is the new mathematics." -- Dr. Christos Papadimitriou

On Fri, Jan 29, 2010 at 6:40 PM, michel paul <mpaul213@gmail.com> wrote: << SNIP >> A truly excellent write-up Michel. I'm glad you're reminding us about Sage. Your use of "Computational Thinking" (CT) mirrors Maria's suggestion for what a course of this nature might be called. "Computational Analysis" (CA) sounds like another option? FYI, we've continued debating nomenclature (what to call these classes) on math-teach: http://mathforum.org/kb/thread.jspa?threadID=2032769&tstart=0 For those of you wishing to join some on-line digital math discussions this weekend, Maria has this information: http://mathforum.org/kb/message.jspa?messageID=6961142&tstart=0 Kirby

michel paul wrote:
I'm not familiar with Sage, but I wonder if adding a few packages to "pure Python" would do the same. I'm looking now at NumPy and MatPlotLib in a proposal for "Introduction to Scientific Computing", currently taught using C with some addons for plotting. The class is a joint effort between our Astronomy and Physics departments. The advantage of Python/Numpy/MatPlotLib is that what students learn of Python will be useful beyond just math and science. I think of Sage as just a replacement for MatLab, not something I would use in programming my mail server. Anyone with experience using these tools? -- Dave

On Sat, Jan 30, 2010 at 7:32 PM, David MacQuigg <macquigg@ece.arizona.edu>wrote:
I'm not familiar with Sage, but I wonder if adding a few packages to "pure Python" would do the same.
Well, it would have to be WAY more than a 'few' packages! : ) Sage is immense. It even has the statistical language R built in. It also has NumPy and MatPlotLib already included. Name some high quality open source math library, and it's probably already in Sage!
I think of Sage as just a replacement for MatLab, not something I would use in programming my mail server.
Yeah, Sage would definitely be a more than adequate replacement for MatLab. The goal of Sage is to be a viable open source alternative to Mathematica. And I think it's very close to achieving that goal. I know there are still things at the moment that Mathematica can do better than Sage, but there's an army of grad students (and others) all over the world constantly updating it. The really cool thing about Sage is that you can use it in a variety of ways. If you install it locally, you can use it in a REPL style, just like IDLE. You simply have 'Sage:' instead of '>>>' as a prompt. But you can also run it in Notebook form through your browser. It's really well thought out. Then, if you don't want to have to install such an immense package on your individual machine, you can use it in Notebook form purely online. A Notebook account is free, and all your work is stored in the cloud. Now that I've become familiar enough with it, I absolutely love it. For purposes of integrating Python and mathematics, Sage is pure genius. Would you program a mail server with it? Probably not, but that's why Python is general purpose. Again, one of the things I truly love about Sage is that at its core, it is pure Python. I was delighted with something one of my FST students said. I had been using Sage as my blackboard in class, and then I started showing them pure Python. My student said that he liked having to think things through in pure Python better than using Sage directly, because Sage seemed so overwhelming. When I had them restricted to just the Python shell, he liked having to reason with just a small set of constructs. I was glad to hear him say that, as it showed he was really getting the message about what I was saying 'computational thinking' was all about. - Michel -- "Computer science is the new mathematics." -- Dr. Christos Papadimitriou

On Sun, Jan 31, 2010 at 10:05 AM, michel paul <mpaul213@gmail.com> wrote: << SNIP >>
Thank you for sharing more about Sage, the above remark especially. Yes, like Mathematica, Sage may seem overwhelming given how the math concepts come flooding in on top of Python. If Python is unfamiliar to begin with, then the learning curve may seem vertical. If you read through parts of the tutorial below (as I've been doing), you'll see that the introductory chapters read a lot like a standard Python tutorial. This book is written (per introduction) for Sage users who have been exposed to a computer language before, just maybe not Python.... http://sage.math.washington.edu/home/tkosan/newbies_book/sage_for_newbies_v1... Here's a direct quote from the above work: """ In a computer, a value is a pattern of bits in one or more memory locations that mean something when interpreted using a given context. In SAGE, patterns of bits in memory that have meaning are called objects. SAGE itself is built with objects and the data that SAGE programs process are also represented as objects. Objects are explained in more depth in Chapter 4. In the above expressions, 2, 3, 5, 6, 21, and 18 are objects that are interpreted using a context called the sage.rings.integer.Integer context. Contexts that can be associated with objects are called types and an object that is of type sage.rings.integer.Integer is used to represent integers. There is a command in SAGE called type() which will return the type of any object that is passed to it. Lets have the type() command tell us what the type of the objects 3 and 21 are by executing the following code: (Note: from this point forward, the source code that is to be entered into a cell, and any results that need to be displayed, will be given without using a graphic worksheet screen capture.) type(3) <type 'sage.rings.integer.Integer'> """ TECHNICAL NOTE APPENDED re "context". [1] What I'm getting from this is we have a stronger case than ever for wanting to just cover some basic Python ahead of time, in a math-learning context. A student already practiced with a text such as Mathematics for the Digital Age will have a much easier time picking up those parts of Sage most relevant to whatever math domain currently under discussion. Might well be calculus (many examples of taking integrals and derivatives in the docs, also solving differential equations). Per earlier remarks in this thread, it seems an uphill battle to have school administrators accept coding in Python as having anything to do with a math course. It doesn't look like textbook math. The notation is not traditional. Where are all those greek letters? Science and engineering maybe, but surely not math! With Sage, I think we get more of a foot in the door, for those lucky schools with faculty wishing to innovate in this direction. Point an administrator to the above tutorial and explain how how mathematics has been greatly affected by computer technology and confining student experience to templates of the recent past is actually quite a risky strategy, perhaps even unconscionable given the software is free? That argument depends on the district -- in some corners, hardware is not really a bottleneck either, as companies and government agencies are keen to cast off fairly decent equipment for a tax write-off... the only real shortage in this picture is trained personnel, which is where teacher training comes in. On the bright side, many high school math teachers are seeking ways to make their subject area more illuminating and relevant. Students would exit in droves were it not for these being required subjects (at least for some years). The political rhetoric and climate is conducive to taking bold action, as there's widespread agreement that the K-12 "pipeline" (some object to that term) is broken, dysfunctional, losing too many students. Adding an industrial grade professional computer language to the mix (not necessarily Python, though we know that's a good one) would come across as reassuring to students. They feel that same pressure to keep up, know their peers in some other states ("states" broadly interpreted, could mean nation, district or zip code area) are already getting these advantages. Just knowing one's school has the *option* of a digital math class (or whatever we call it) would seem like proof that we're really getting somewhere, that all this talk of upgrading is not mere lip service and hand waving (easy to get cynical when all these press reports, e.g. of Intel offering millions, leads to nothing different on the ground [2]). Back to the above paragraph, you see how it becomes necessary right from the top to start talking about objects and their types. Yes, we may still argue about whether whole numbers deserve their own type simply because we've added zero to the "natural numbers" starting with 1 (i.e. W = N + {0}). But the mere fact of these arguments serves to reinforce the core ideas: (a) that mathematics has types and (b) we may refer to these as "types of object" or even "math objects" for short. This way of thinking does not depend on knowing a lot about computers or computer memory. The "grammar of objects" is already embedded in human language, with the original aim of Smalltalk being to more closely mirror how people already think in their respective knowledge domains, mathematics no exception. That we should be giving math teachers opportunities to move their skills in this direction seems prudent and conservative to me, not like some radical "out there" suggestion. Clinging to the status quo, in contrast, seems like pure denial that any kind of future is happening. Holding on to the way things were, paying no attention to trends, would seem the radical / risky position to me. The bias we need to overcome, in my view, is that computer programming is really hard, and that by adding some coding language to the math curriculum is just making a difficult subject more difficult. That point of view pushes Computational Thinking into the "honors elective" category. Don't get me wrong: I think there's plenty of room for honors electives in this picture, steep learning curves, lots of challenges. But I'm quite aware of administrator concerns about inequity, funneling resources to those labeled talented and gifted, whereas so often it's a mere lack of opportunity that keeps this "digital divide" so divisive. The pilot programs we need to be reading about should not all be based in these exclusive private schools, lest we send the wrong message. One Laptop per Child is a source of counter-spin, plus various foundations we could name have diversity and broad spectrum outreach among their core values. When it comes to getting support for these teacher training programs, one needs to make sure we're getting through to those big public high schools, including in rural areas. Anyway, I'm straying into politics here (again).[3] To some extent, I think it's up to the various open source communities to keep reminding the public of the opportunities here. GNU and its expanded legacy is one of the more hope-inspiring achievements of recent generations, evidence that humans will indeed collaborate cross-culturally, on a global basis, once provided with the infrastructure to do so. Open source is an integral part of world affairs at this point, and deserves to be taught as such. If your high school offers a current events class, yet there's no mention of the free software movement, then how is this really an intelligent overview? Are librarians the most up to date these days, given libraries are where students go for help with all these new tools? Maybe so. http://www.techlearning.com/article/23558 More preaching to the choir here I realize... Kirby [1] The Sage docs use "context" as a substitute for "namespace" pretty much, as types of object do have their associated namespaces. One way to introduce "dot notation" to those unfamiliar with this syntax is to point out its role in "disambiguation" (a big word, but as much a term in language arts as computer science), a thing we do on Wikipedia for example, when the same term points to more than one entry. When Java simply inverted the domain name to make that a prefix to unique packages, we were seeing disambiguation taken to a new level. [2] thread on math-teach about the Intel announcement: http://www.rdmag.com/News/Feeds/2010/01/information-tech-intel-commits-200-m... (is it really feasible to accomplish all the necessary training based on distance education and Web 2.0 technologies? I'd say one still needs a mix of distance and in-person, so I'm skeptical of any funding proposals that just focus on the Internet as the only curriculum delivery vehicle -- we need to recruit a large army of volunteers willing to take some paid time to do actual field work, no? Where is that Intel-sponsored facility in Portland where teachers might actually show up and compare notes? If it's all burning the midnight oil in some self-study atmosphere, even with shared whiteboards etc., then that'll invite a backlash). Note: my preferred solution, based in historical precedent, was to actually field a fleet of specialized vans, send them around in a kind of circus mode to take trainings directly to schools, get the ball rolling, a kind of recruitment drive, in the sense of getting people signed up for whatever distance learning follow-ups, hands-on classes. Proud sponsors would have their logos emblazoned on these "bookmobile" like vehicles and the very fact of their existence would galvanize the teaching world, make innovation in education a cause celeb, something to publish fun stories about. I haven't given up on this vision, but after so many years of promulgating the possibility, I realize I'm somewhat alone in sharing science fiction of this genre. If it's just me that's interested, it obviously ain't gonna happen. [3] My personal experience is colored by stint with a local police department right in the heart of the Silicon Forest, a stone's throw from Intel. The neighborhoods have many recent immigrant families seeking opportunity and some training in computer technology would help with that. The police department was actually putting some computer labs and browser access points in various housing projects, wanting to jump start more of a learning experience. The chief (a son of Chinese immigrants himself) set up a Linux lab right in West Precinct, and invited kids to come for lessons in open source technologies (I was one of the co-teachers). (When I say "stint with" I don't mean I was ever on payroll with the police. They hired Saturday Academy, a local nonprofit, to supply the teachers and curriculum). What impressed me about all this was the police were doing all this out of a sense of survival and wanting to keep their future from being too nightmarish. If these students had no hope, if opportunities were all closed to them, then that would just mean more despair, more crime, more pressure on police to manage an unworkable situation. How much better it would be if some real and relevant education were happening! I thought their thinking process was rational, bold and worthy of respect in this instance. I had no problem getting on board. So what were the schools doing? They mostly wanted the police to come in and give scary talks about how software piracy was bad, downloading music evil, etc. etc. These were the early days of Napster. Was there any mention of open source, of subcultures that actively encouraged sharing, legally and ethically? Precious little, actually next to nothing back then. We've come a long way in the meantime, but maybe not far enough. Resistance to necessary innovation, right in the heart of the Silicon Forest, is still a major fact of life. Educating administrators about introducing a new kind of math class is an uphill battle even here. I'm seeing the community colleges as potential allies. Anyone else want to chime in?

On Sun, Jan 31, 2010 at 2:28 PM, kirby urner <kirby.urner@gmail.com> wrote:
On Sun, Jan 31, 2010 at 10:05 AM, michel paul <mpaul213@gmail.com> wrote:
I should clarify here, that it was never my wild fantasy that traditional math notation was just going to evaporate into the ether. The idea here is concrete interaction with an interpreter adds another way of expressing the same concepts, so you get more like two opportunities that cross-check one another. Here's sigma notation (capital Sigma) on the one hand, here's a while loop (a do loop) on the other. Both have incrementing indexes that may be used to define successive terms. Both may result in a sum. By having them side by side, using one to explain the other, you don't double the difficulty, you halve it, is what I'm contending. All the advocates for incorporating computer languages have kept it a mix, The Art of Computer Programming giving a good sense of it, with MMX coming in as a new flavor, an ingredient, not as a replacement for anything. Just because we have Sage on the projector, are working through some integral, doesn't mean we can't show the Integral sign (Riemann Sum symbol) on the adjacent white board. Some GUIs give you that typesetting layer, atop a more rigorous machine-friendlier layer [1], whereas others do not. Sometimes you have a pretty simple shell, like iPython or IDLE or PLT Scheme, or just a bash terminal window -- and that's not such a terrible thing, if you've had some training in lexical subjects.
Botched the grammar there didn't I? Feeling again the need to add corrective thinking, reply to my own post. Computer programming *is* really hard sometimes. Denying that fact would sound easy-breezy cavalier plus is simply not true. The key word is "sometimes". Math gets really hard too (duh). The goal is to help develop an appetite for these challenges, not to be ultra intimidating. The point of yakking about "types of math object" their properties and operations, is *not* necessarily to shoot for high honors or advanced placement credit. That *might* be the point in some contexts. More to the point is wanting to render pre-existing well-established mathematics in a more accessible, hands-on, and intelligible format, without losing any backward compatibility. List comprehensions *illuminate* ideas about functions, do not detract from them. Creating a list of (domain, range) tuples using "zip" is kind of interesting, gives a hands on component to what's in the book. I'm not posing as some uber-mathematician or programmer god in any of these postings, or if it looks like I see myself that way, then my apologies. I'm all thumbs with bash. Getting Ubuntu and Win7 to work on the same laptop pushed me to the limit of my ability and without pointers from Ron, I'd surely have failed.** I'm thinking what might be useful to an average student. Add a computer language to make math seem easier, not more difficult. If that seems counter-intuitive, then maybe give it a try anyway? I've been doing empirical field work, actually doing this in my classes (few and far between, not a full timer, much as I'd like to be some days). I'm learning many things that work. Telling more lore is one of them (have meaningful stories on tap, not deliberately meaningless ones). Kirby ** the motherboard video on the Core i3 wasn't gonna work with Ubuntu, found the needle in a haystack post. Ron told me about VirtualBox from Sun Microsystems, actually hand-holded me through the download. Ubuntu 9.10 went on as a guest operating system, WIndows 7 a host. A few hours later, I figured out how to get wireless passed through, and hours after that, full screen Ubuntu instead of 800 x 600. So satisfying. Now its back to where I left off at the Django conference, trying to figure out about virtualenv again. Ian Bicking did the demo. I was "snake bearer" (token PSF guy, not some kind of Django expert by any stretch of the imagination). Now there's virtualenvwrapper too. Ron is lightyears ahead of me in so many ways. Like me, he's a Quaker, and reported that at meeting today (I skipped) we had a guy from Scotland who turned out to be some key guy with Canonical, with Kubuntu in particular. Ron just phoned as I was writing this and saying he's very likely moving to kubuntu now as another virtual OS, likes KDE over Gnome. He's already running OSX, WIndows, developing cross-platform for iPhone, Android, Nokia's thing.... I'm so not in that league. I'm more just the local high school math teacher, gray hair, obsessing about polyhedra too much or something.

kirby urner wrote:
Nice tutorial. I'm still having difficulty seeing an advantage of Sage over Python/SciPy, however. I'm putting together a proposal for a freshman-level course in CS. Currently we have three courses - one for CS majors (Java), one for computer engineers (C), and one for physics and astronomy (C). Matlab is also used in many of our science and engineering classes. Here it is just a tool, not a subject of study in itself. The course I will propose could serve all departments, and will cover the fundamentals common to all. It could also be an excellent high school preparation for college. The language will almost certainly be Python, although we may get as far as introducing a little Java or C. (This could perhaps be an option in the last three weeks - Java for CS majors, and C for engineers and scientists.) Graphics will be very important - everything from simple 2D plots to 3D animations. The focus will be on computing fundamentals, however, not the details of how these packages work. They are just tools to visualize an equation or process and aid in the understanding of concepts. Examples contributed by faculty in math, science and engineering will be an outstanding feature of this course. Here is where we need more than the standard library in Python. We need a Fourier transform that "just works" and produces beautiful spectra of various waveforms and images. We need the functionality of MatLab, without its drawbacks. I've been leaning toward Python/SciPy/MatPlotLib, but recent discussions of Sage have me interested in looking at alternatives. What are the factors we need to consider? 1) Features. Does the package do everything we might want, now and in the future when students use it for later classes and on the job. 2) Simplicity. Is it easy to set up and use on student computers (Windows, Mac or Linux)? Is it easy to learn? Is it open-source, so students can dig into it as deep as they like? Is it available everywhere without legal complications, e.g. MatLab's license? 3) Universality. This is more than just popularity (counting users). We need a minimum level of community support (discussion groups, interest from employers, programs on SourceForge, books from Amazon, etc). Availability of textbooks is a special consideration in this category. Ruby, Prothon, Scala, etc. (one up from Python?) have nothing comparable to Litvin/Zelle/Goldwasser. 4) Conformity. Does it fit in well with existing curricula? Is there an easy transition to Java, C, MatLab, etc. Can it be used as just a tool in a course that has nothing to do with programming? This last factor is especially difficult for us idealists. We might like to toss out everything in the status quo, and start with a clean slate, but that approach will get us nowhere. We need options all the way from a one-hour demo to a whole course centered on the use of these tools. Before comparing these packages, let's discuss the factors above. Have I left out anything important? -- Dave ************************************************************ * * David MacQuigg, PhD email: macquigg at ece.arizona.edu * * * Research Associate phone: USA 520-721-4583 * * * * ECE Department, University of Arizona * * * * 9320 East Mikelyn Lane * * * * http://purl.net/macquigg Tucson, Arizona 85710 * ************************************************************ *

Regarding conformity. When we moved the introductory course (used by both CS majors and non-majors) to Python, one of the criteria was to ensure as little changes to the subsequent curricula as possible. This obviously made the change much more palatable to the faculty. Thus the following course, CS2, remained in C++. What was the effect of throwing Python students into a C++ class? My colleague Rich Enbody and I studied that question and reported on it last year at SIGCSE and Pycon. Bottom line, those that took a CS1 course in C++ and those that took a CS1 course in Python performed equally well in a CS2 course in C++. Furthermore, very little (if any) changes were required in topic coverage for the CS2 course. Basically, we assume that learning the concepts in Python translated well to C++, enabling those that carry on to learn C++ fairly easily. For those that quit at the CS1 stage, they were taught a language that was practical, useful, in their subsequent careers. We have ample anecdotal evidence to that. I can provide the paper(s) to those interested. >>>bill<<< "The Practice of Computing Using Python", available 3/1/10, Addison Wesley/Pearson David MacQuigg wrote:

Hi Bill, Yes, I am interested. Please send copies or links of your papers and anecdotal evidence. Comments from former students would be especially interesting. It might be nice to compare the reactions of CS majors to majors in other departments. I'm a little surprised the Python students didn't actually do *better* than the C++ students. I guess it all depends on the way these courses are taught. I can imagine a CS2 class in C++ where anyone who isn't fluent on day one gets slammed. A more cooperative environment, in which CS1 students get an introduction to C++, and CS2 students get a little time to get fluent in the new language, might be just the opposite. In that situation, I would think the Python students might have an advantage because they spent more time on fundamentals. The transition from Python to Java seems especially easy. Students could just spend a few hours with JavaBat. Maybe we need a C++Whip website (or C++Bat if Nick Parlante does it first.) At UofA, our CS2-level is Java, and CS3 (at least in engineering) is C++. The choice of language at level 3 is entirely up to the professor, and can change each year. Most recently this has been Smalltalk, Java, now C++. -- Dave Bill Punch wrote:

On Mon, Feb 1, 2010 at 12:45 PM, David MacQuigg <macquigg@ece.arizona.edu> wrote:
kirby urner wrote:
...
I think there are binaries for python/scipy at enthought.com for various platforms, but I'm not positive. You might want to check them out. IMHO Sage will do what you want but for the windows users (mac+linux installs are actually fairly easy - with binaries at sagemath.org or you can compile form source) you have 2 options: your students will run Sage from a virtual machine environment (virtualbox is used, I believe) or run sage from a server (such as at sagenb.org, but presumably local to your campus). I am teaching a python+math computation class now and allow students to either use pure python or sage via a local sage server. Sage includes scipy and sympy. I do not have a good argument against matlab. If you and your students can afford it and you think they need to learn matlab for their career-path then there is little I can say against that. However, if cost is an issue then octave may be an option, as it is apparently 90% matlab compatible. <rant> If you are going to teach students programming you should not start them out with matlab.</rant> (Sorry, had to get that out of my system.) I should add that Sage servers are supposed to be able to work with octave commands (in place of Sage) but I have not tried it. You might want to go to sagenb.org and sign up for an account and do a "test drive" before you make a final decision.
You left out the sympy+octave option, which is cross-platform and might server your needs (sympy.org and octave.org).
participants (5)
-
Bill Punch
-
David Joyner
-
David MacQuigg
-
kirby urner
-
michel paul