For the first time, I decided to carefully maintain the final exams in the order that they were completed, and see if this was at all correlated with the score. This is a 101 course for non-majors and majors with limited prior experience. There is a somewhat reasonable correlation (0.56), although it gets pretty noisy in the middle. I used the rank instead of the raw score (which actually would give -0.6). Blue diamonds are the data points and the gray plus signs are the linear regression (didn’t feel like figuring out how to mix scatter plot and line graph!)
Note this isn’t measuring the amount of time to complete the exam. The lowest grade was also the last to finish, but s/he showed up extremely late and spent a lot less time on the exam than others. Tendency to show up late is also of course correlated with poor performance.
One area of study in my CS101 course (a broad overview of the field, mostly for non-majors) is why computers use binary representations, and how to represent numbers, text messages, pictures, and even music in binary. Computers are really only good at number-crunching, but they’ve become pervasive in other pursuits because, in the end, it’s all just numbers.
So one little exercise I prepare for students is to convert icons to and from hexadecimal strings, just like I did in the 80s with graph paper and pencil, to program sprites (animated icons) on my TI-99/4A home computer.
This one here is an alien from the early arcade game Space Invaders. I dig up icons of Atari Pac-Man ghosts, and the little alligators from Pitfall. I’m sure they’d rather see high-resolution WoW avatars in 24-bit color, but nobody would want to encode one by hand. The point is, once you understand the basic process of binary encoding, anything you want to do is just a matter of scale and patience.
10 LET $ALIEN = "183C7EDBFF245AA5"
Hexadecimal is still amazingly useful in computer programming, so it’s unfortunate that the novice’s only exposure to it is in error messages, such as the BSoD. I brag about how one summer I could add and subtract very fluently in hex, when I was coding device drivers for serial communications. I’m not sure they’re impressed…
CS Unplugged is the source of many of my activities and demonstrations for introducing concepts in computer science. I recently found that Tim Bell (University of Canterbury, New Zealand) delivered a Google Tech Talk [50 min.] about the project. Here is a much shorter video [1:44] just on the sorting network activity. Watching the kids put themselves in order is pretty amazing, once you get past the silly-looking school uniforms.
Earlier this week, I had an array of students model the gnome sort at the front of the classroom. It really is the simplest sorting algorithm. They stood in some arbitrary order, then I handed the left-most person a page with these instructions:
If there is no one to your right, pass these instructions to the person on your left.
If the person to your right is shorter than you, pass these instructions to the person on your left.
Otherwise, swap positions with the person on your right (but keep the instructions).
Go back to step 1.
They tried it out, and before long they were standing in order by height. (The algorithm is written without a stop condition, so I had to be in the right place as a sentinel.) The follow-up questions: how long did this take? How fast does it go if you’re already in the intended order? What if you’re in the reverse order? This one is simple to understand because there’s only one pointer, and all swaps are local.
The spring semester has wrapped, the grades are in, commencement was last Thursday. I’m still in that transition period between the frenetic end of a semester and the calm agenda of the summer. Maybe one thing preventing me from moving on is the pile of 4000 alumni surveys in my office, waiting to be sent out. I’m putting together a gaggle of student assistants later in the week to stuff envelopes. All in the line of duty (as chair of the outcomes assessment committee).
In late April, I gave another instance of my song-and-dance for non-majors, the presentation that I like to call “Adventures in computing.” In this case, it was part of “The College Project,” in which we invite a group of talented high school students onto campus once a week throughout the spring, to interface with professors in different fields. The idea isn’t explicitly to recruit them to LIU, but just to turn them on to higher education in general.
My presentation is just about 1.5 interactive hours (with props!) to convey a flavor of what computing is all about, and some of the “big ideas” that have come from it. Posted here are the slides and three handouts I used.
In AI yesterday, I began describing genetic algorithms, a.k.a. evolutionary programming. I thought it important to get the essence of Darwinian evolution on the record too: descent with modification plus selective survival. I find that even among people who are generally supportive of evolution, and science in general, there is a lot of misunderstanding about how it works.
By watching the reactions on my students’ faces, I began to realize how brutal the whole thing sounds. Evolution has an enormous death toll. Lots of critters must die in order for the average fitness of the population to increase. This carnage, resulting from competition for scarce resources, is not optional; it’s essential.
It sounds all the more sinister when I mention that we will impersonate gods by applying our own selection criteria to the population. This isn’t natural selection, it’s artificial. You get to live and reproduce because you came closer to solving my problem than your peers did. In contrast, natural selection seems like a harmless truism: those who are good at surviving and reproducing are more likely to survive and reproduce.
Again, I tried to make the lecture more interactive with props. And nothing represents the concept of chance better than dice. Ideally, for an in-class demonstration, I’d like to leave nothing to chance. But in this case, I gave the dice to my students, put the success of my demo in the hands of Fortuna, and thus demonstrated my own ‘faith’ in the evolutionary process.
We ran through a simulation on the board, where I wrote 6 random 6-bit strings, and computed their fitness as solutions to a 0-1 knapsack problem with 6 elements. As my students passed and rolled the dice, we went through tournament selections, cross-overs, mutations, etc. The average fitness score of our offspring were clearly increasing compared to their parents. And I thanked Fortuna when, on the final roll of the die, a mutation flipped precisely the right bit to produce the optimal solution to the problem. (If that didn’t happen, I’d either have to go on to a 3rd generation, or be content with demonstrating just an increased average and max fitness.)
Tonight went well. I mentioned AI previously, but another course I’m teaching this semester is CS101. This is not like the ACM CS1, but more like CS0 — a very broad introduction to computer science for non-majors and majors with limited prior experience. It’s a fun concept; we do a little algorithmics and problem-solving, followed by a brief survey of all the major topics in CS: databases, networks, languages, AI, etc. There’s a bit of programming here and there — just to make the algorithmics more concrete — but that stuff doesn’t begin in earnest until CS102.
Anyway, the sequence I’m following begins with algorithmics and pseudo-code. I’m just trying to convey the concept of what an algorithm is, and what it means to specify an unambiguous, step-by-step method. This can be incredibly difficult for someone who has never thought about things this way before. Everyone encounters tasks like searching, sorting, and path-finding in their daily lives, but most have no idea how these things actually are accomplished. And when you write down a multi-step procedure with a while loop and an auxiliary variable — just to find the largest number in a list — the uninitiated get justifiably annoyed. They protest, “Anyone can see that the largest number in the list (33 21 73 86 23 51) is 86… just look at it!”
Over the years I have encountered and developed several prop-based methods for conveying these and other complex ideas in computer science. One great source has been the Computer Science Unplugged project in New Zealand. I really believe that manipulating small props can help people understand things more concretely than chalk or markers or even computers.
Today I brought in 10 large index cards (about 5×7 inch) with one word written large on each card. I chose words with a food theme: Apple, Banana, Cilantro, Dates, Eggplant, etc. I began the lecture by placing 6 of the cards in arbitrary order on the chalk tray at the front of the room. Above them, I wrote the numbers 1 through 6. Nobody had any doubt that they could arrange the cards in alphabetical order.
So then I imposed a small restriction: you’re not allowed to slide the cards around on the tray; the only operation you can perform is swapping two cards. So I went around the room asking which two cards to swap (i.e., swap #1 with #3, or swap #4 with #5), with the aim of bringing us ‘closer’ to alphabetical order. As people called out pairs of cards, I swapped them, and eventually they were alphabetized. Distributed computation!
Next I tried to examine what led us to choose the pairs of cards that we did. In many cases, people chose pairs that would place cards directly into the positions where they belonged. For example, if Apple was #4, then they would swap #1 and #4 so that Apple would become #1. Although this is an efficient strategy, I actually tried to discourage it because it meant that they had already sorted the words in their heads and were just trying to make what was on the board look like what was in their head. The strategy is not ‘blind’ in the way that an algorithm must be.
Eventually we hit on the fact that you could arbitrarily choose any two cards that are out of order (relative to each other) and swap them. After that step, the number of out-of-order pairs necessarily decreases. So if you continue doing this — again, choosing completely arbitrarily — eventually you’ll hit a point where there are no more out-of-order pairs, and that means the cards are completely sorted. Although inefficient as an algorithm, this is pretty sophisticated reasoning!
Next I wanted to demonstrate the sense in which I mean that an algorithm must be ‘blind’. To do this, I sat in a chair facing the students, so my back was to the board. I asked a student to come up and choose any 4 cards and put them in any order on the board, under the numbers 1 through 4. I was not allowed to see the cards, and the other students would watch my helper to ensure her honesty. What ensued was reminiscent of the game “20 questions,” although I guess it was actually just 5 questions. It went like this:
Are #1 and #2 out of order? Yes.
Please swap #1 and #2. Ok.
Are #3 and #4 out of order? No.
Are #1 and #3 out of order? Yes.
Please swap #1 and #3. Ok.
Are #2 and #3 out of order? No.
Are #3 and #4 out of order? Yes.
Please swap #3 and #4 Ok.
And now, as if by magic, the words were suddenly in alphabetical order. I had caused it to happen by asking my helper extremely simple questions and giving her extremely simple instructions — without once looking at the board or knowing what words were there. This is actually fairly impressive — and I wasn’t afraid to tell the students when to be impressed! (For those in the know, this was a 4-element merge sort.)
I went through several more exercises like this, and eventually was doing a binary search in the same ‘blind’ way. Does card #5 say ‘fennel’? No. Does the word on card #5 come before fennel in the alphabet? No. Does card #3 say ‘fennel’? And so on.
At any rate, I’m telling this story because I really felt that the technique was successful — in a way that just writing on the board is not — at conveying the concept of what it is like to design and specify algorithms like these. The completeness of your case analysis matters when you can’t see the input data. And when your assistant will respond only to the most rudimentary questions and commands, you have to enumerate every little step.
Such a gloomy, rainy day. Perfect for staying home and hacking.
One course I’m teaching this semester is artificial intelligence. It has nothing to do with my usual areas of interest, but it has always had a special place in my brain. Especially the early symbolic stuff… it’s good fun, no matter that the grand claims for it never panned out.
So I decided, in my subversive PL geek way, to use this opportunity to introduce my students to Scheme. Specifically, I’m using the PLT DrScheme environment as a companion for my AI course. I know that true Lisp is traditional, but I was really seduced by Scheme in my younger years (until ML came along) and it has been a pleasure so far to come back to it. Plus I can set up some nifty cross-platform graphical simulation thingamabobs for my students, which they’ll appreciate.
I chose the AI book by Nilsson. In my first course, we used Winston, and Russell/Norvig seems to be dominant these days. But I’m never one to choose the dominant platform just because it’s dominant (haven’t owned a copy of MS Windows since version 3.0). I still have fond memories from Winston, and was a touch disappointed to find that it hasn’t been updated in all these intervening years.
Anyway, Nilsson starts out with a “grid world” inhabited by an intelligent agent (robot). The first task is to try to make the robot follow the wall clockwise around the room. In other words, the first smidgen of intelligent, goal-directed behavior is to avoid walking into walls. Impressive, eh? Next stop: The Matrix.
So, I used DrScheme to bring the grid world to life, and allow my students (who, after all, have no Scheme exposure at all) to dig right in developing little wall-following robots, just by typing stuff like (if (or s1 s2) ’north (if … )), where s1–s8 are sensors for the 8-directions (clockwise starting from north-west) that return true if a wall is detected. Once you set up your little if-then-else robot controller, you can graphically place a robot on the grid and have it travel one step at a time around the room. The code for my simulator is here: gridworld.zip; just open grid-main.scm in DrScheme. (Select the graphical language, with MrEd + MzScheme.)
Next we’re going to jump right in to two kinds of machine learning, first by inferring a decision tree from a set of examples (Quinlan ID3 algorithm), then by evolving robot behavior by genetic programming. Both of these can be readily applied to the robot world, among other applications.
The students seemed fairly excited by Scheme, on their first exposure. “It’s so easy,” one said, although admittedly he had just been watching me; they have yet to write any code on their own. Nevertheless, I was a little surprised by the enthusiasm. Good signs.
Today (Monday, actually) was the start of the 2006 LIU Teaching with Technology Institute. Unlike many professors, I of course have no problem adapting to new technologies, since I basically invent new technologies for a living. But the reason I like participating in this — and other workshops sponsored by our Teaching and Learning Initiative — is that it’s great to get together with other passionate profs to talk about teaching. Or, more accurately, about “creating effective learning environments.” Or, more pretentiously, about ‘pedagogy.’
You see, as long as I think it will be worth my time, I can quickly master any new language, protocol, tool, or environment that comes down the pike. That’s the advantage of a broad education in computer science. But what I don’t always see immediately is how to make effective pedagogic use of the technology. In my own education, many of my most effective and memorable classes were strictly chalk-and-talk. Not that there’s anything wrong with that. But I don’t necessarily know how successful use of technology in learning should look, other than the standard CS fare of downloading handouts from web sites, participating in news groups, and electronic submission of programs. Hardly revolutionary stuff. In class, instructors still mostly wrote programs on the chalkboard in long hand, and explained them using simple diagrams. And perhaps beyond that, you get diminishing returns for the amount of effort expended. Even so, I think it behooves us to continue to research and evaluate new methods; the cost/benefit analyses can change mighty quickly in this field.
Today was mostly about pod-casting. We first heard from Mike Soupios from Columbia University’s Center for New Media Teaching and Learning. He gave a very basic overview of the concepts and limitations, and referred to lots of successful uses in Columbia’s schools of medicine and other health sciences. Unfortunately, our time with Mike got compressed a little and most of the examples he had time to go through were about what doesn’t work well. Taping your entire lecture and putting it online makes for a very dreary pod-cast. Go figure. For one thing, we excuse a certain amount of stalling (uh… um… well…) in a live lecture, but in a media ‘product’ we really (quite reasonably) expect more polish and pizzazz.
We spent the rest of the afternoon with Steve Cervera, our local Apple rep. This was more on the technical side: a look at the pod-casting features in the new GarageBand. This could have been rather boring for me — I’m sure I can figure out for myself which buttons to push in GarageBand — but Steve is a talented presenter, and seemed to be able to hold together an audience of profs with wildly varying interests and technical aptitudes. Maybe he can herd cats, too.
The new GarageBand (with iLife ’06) did seem pretty smooth and simple. Unfortunately, I bought my PowerBook last Fall, before the latest iLife was available. I really didn’t see much need to upgrade it, until now. I had tried GarageBand a bit, even got it to gab MIDI with my Yamaha digital piano, so I was able to lay down multiple tracks, edit individual notes, mix, add effects, etc. It worked reasonably well, but some limitations were clear — this isn’t a ‘pro’ tool for sure — and the interface was a little bizarre, maybe because this wasn’t originally an Apple product, but that of some company that Apple acquired.
Anyway, the newer GarageBand seemed nicer than what I was used to, and the ability to create pod-casts with still images or video was fairly compelling. So I decided to upgrade. Also, since some time during this week-long workshop is set aside for faculty to pursue their own projects, I decided that I’d like to upgrade today. Unfortunately, the Apple retail stores do not offer educational discounts on software, only on hardware. So the only way to get the educational price on iLife ’06 (US$59 vs. $79) is to order online and get it Friday or so. I chose to pay the extra $20 and get it today. (I have yet to hear a reasonable explanation for that rule; we also bought new iPod ear buds today, and got a $4 educational discount on those. What’s different about software?)
I do find it a little regressive that, in this broadband age, I would have to get in my car, drive to a store, bring home a cardboard box with a DVD (which itself is not much different than a digital cardboard box, a container for bits) just to have some new software. I mean, the very reason we call it software seems to imply that we shouldn’t have to box it up and ship it around the country in trucks. But I digress…
A few ideas I’ve read and heard lately all converge on the value of learning in collaboration with one’s peers:
(1) Our university Teaching and Learning Initiative sponsored a seminar by Michael Coomes on characteristics of the ‘millennial student’. Apparently, the current crop of 19-year-olds is more heavily influenced by their peers than generations that came before; individuality is not necessarily prized.
(I don’t know how much stock I put into gross generalizations of people born within the same 20-year span; it seems even more dubious than the zodiac. But then, as a Gen-Xer, of course I would think that. :))
(2) I ran across a paper or two in recent SIGCSE proceedings about the value of pair programming (an ‘extreme programming’ practice) for learning, perhaps for the above reasons. I’ll have to look for those papers again. Pair programming sounds like a nightmare to me personally, although I think many other ‘XP’ techniques are fairly sound.
(3) An interesting editorial in today’s Times—about the successful Meyerhoff Scholars program at UMBC—emphasizes the importance of peer learning: “The students are encouraged to study in groups and taught to solve complex problems collectively, as teams of scientists do.”
Now, probably all CS programs incorporate some amount of group projects. I certainly did plenty of them in my time. But I think the idea that these sources are suggesting is more structured and pervasive, perhaps starting earlier in the curriculum. In most programs, group work begins only after students have been acquainted with the fundamentals. These ideas are about achieving even the fundamentals through peer learning, and helping students to connect before they get discouraged and move on to ‘easier’ fields.
As an educator, one concern about group work is that it is more difficult for me to judge the contributions of each individual. After all, I have to evaluate students individually. There are a variety of ways around this, including peer reviews and such. And anyway, I feel my primary responsibility should be as a facilitator of effective learning; determining how to dole out the grades is secondary. Right?
I just turned in grades to the registrar yesterday, so grading policies are on my mind right now. One of my policies is that “there is no such thing as extra credit.” I think I adopted this idea from a math and computer teacher in high school. (Hello, Mr. Engler!) But many students and professors love the idea of extra credit, so it’s worth exploring why I disagree with it enough to deny its very existence.
There are two perspectives on extra credit, so I’ll address each separately. Students generally ask for extra credit opportunities after they have screwed up their initial opportunities. Bombed the midterm? Didn’t bother to submit two assignments? Fear not, just ask what you can do for extra credit! Some professors will agree and give you a second chance.
I see a series of problems with this. First, for the sake of fairness, the opportunity must be open to everyone. It’s inherently unfair to make special deals with students that seek extra credit, and leave the quiet students out. Now, since the opportunity is open to everyone, that means that everyone must do it, to remain competitive. By assigning extra credit, you are essentially just adding new requirements to the course. There is nothing optional about it.
One way that teachers tally extra credit is to add points to the numerator without adding to the denominator. Arguably, this gives low-ranking students a second chance without hurting high-ranking students; you can’t do better than #1. But I think this is wrong. For example, suppose these are the averages of three students after the mid-term exam:
Carol 95%
Carlos 93%
Chris 60%
Chris bombed the mid-term, and is in danger of failing the course. So we offer everyone a chance at adding 4 points to their scores. Chris desperately needs that opportunity and moves up to a 64%. Carol is taking 21 credits and doesn’t have time for extra work; besides, she’s already #1. And so Carlos does the extra assignment and surpasses her; Carol is no longer #1. Maybe in the end it won’t make much difference; probably Carol and Carlos will both still earn ‘A’ grades. But the point is that just to maintain your rank (and thus possibly your grade), you must do the extra credit. And so therefore extra credit is not a reward for going above and beyond the regular course requirements, as we like to think. Rather, it is just additional course requirements.
Now, let’s look at it from the teacher’s perspective. Some teachers love to offer extra credit opportunities, especially for really challenging problems. In this case, marking an exam question as extra credit seems to say, “I don’t really expect most of you to get this one, but try it if you want to impress me.” This kind of opportunity is appealing to the top students for the same reason that teachers like it: it helps to separate the good students from the truly amazing ones. I have to admit that this appeals to me too. But calling it “extra credit” seems like little more than a psychological trick, so that ‘B’ students (and below) will not feel demoralized for skipping it. If the question contributes to the denominator, then it’s not really optional; and if it doesn’t, then it’s not fair.
So, if extra credit is either non-existent or unfair, how can we address these different needs? How can we give students a second chance after screwing up, and how can we separate the ‘good’ from the ‘great’ without demoralizing the merely ‘okay’? To give second chances, one could have a very flexible late policy (which I tried but abandoned) or drop the lowest assignment score (which seems to work much better). To separate good from great, I will sometimes include one or two extra-challenging questions, that go beyond the basic expectations. I mark them as difficult, and advise students to address them last. And then I make them worth just a few points. This sends the signal that it’s more important to get the basics right, but to get a ‘perfect’ score, you have to go beyond the basics.