# Openers I've tried in my classes

• Stunts
• bugle call by Dan Boren (real eye-opener, puts staff on personal level)
• the first day yell -- tell students that in the strength of their numbers they have a powerful resource. Then tell them you're going to prove it. Then, yell at the top of your lungs. Finally, ask them to do it and see if they can manage a louder yell. Exercise also prepares students to speak and act out in class.
• attention grabber: give away exam/homework answer -- do it quietly; just say in a relatively normal voice "the answer to number seven on the midterm is c" then wait for people to say "what? what?!"
• no goal: tossing a beach ball into class (bad idea unless you have a tie-in!)
• Shockers (surprises and jokes)
• style: obfuscated C contest program -- asked students why we bother with all this extra effort and space for comments and stylistic structure. After all, they're only writing short programs and surely any.. say.. eight line program must be comprehensible. Then showed them an 8 line OCC program and what it did (3-D ASCII starfield).
• loops: chicken little -- programmers write 12 lines per day, computers execute 10000 lines per second.. How will we ever use up all those cycles?
• class dynamics: the law of the excluded middle story -- ask students to raise their hands in response to a yes/no question ("is this program's runtime quadratic? all who say yes, raise your hands; no?"). When half the class fails to raise their hands, tell this story. There's a law in logic called "the law of the excluded middle"; it means that either a fact is true or its negation is true. Either you are in class today or you're not in class today. It's pretty sensible, but there's a group of logicians called the intuitionists who don't believe in the law of the excluded middle. Now, at one logic conference where this famous logician (we'll call him Tom) was running a session on classical logic vs. intuitionist logic, there's an argument raging back and forth over the law of the excluded middle, but Tom, being an older fellow, has tuned out and is catching a nap. All of the sudden the two main antagonist turn to Tom and clamour for him to decide the issue. Tom wakes up with a start, blinks a few times, and then ventures this answer into the tense silence:

"Well.. I suppose we can all agree that either the law of the excluded middle holds or it doesn't."

I then finish off by telling everyone that in this class we believe in the law of the excluded middle; so, everyone must raise their hands for some option. (P.S. I almost always give the option "it depends" as an answer to make people who don't know comfortable giving some answer.. as "it depends" is almost always also technically correct.)

• iteration: the rigged die demo (how can we tell how it's rigged) -- Martin owns a six-sided die with badly shaved sides. I brought it out and sked the class what the probability of rolling a 1 was. People in the back might say 1/6 if they can't clearly see the die, but folks in the front say it's fixed and it will be different. So, we talk about how we would actually determine the probability of various rolls.. lots of trials followed by some simple calculations. Something that computers (modulo the physical rolling part) are great at.
• Physical demonstrations
• trees: form a tree from class, calculate height -- I pointed out that everyone in the class had two arms, just like a tree node has two children, picked a student to be the root, and asked that student to stand. Then, I said anyone standing was in the tree, and anyone sitting was not yet. Their job was to stand if they're pointed to and find two people at random in the class who was still sitting to point to (make sure that person sees your point) until everyone is standing. If you can't find anyone (or can find only one person) sitting to point to, point at the ground to indicate a "null" pointer. At the end, we calculated the height recursively and in parallel. (Interestingly, one of the students brought me into the tree!)
• Problem solving
• algorithms: counting the class -- ask the students how we could count the number of people in the classroom, how fast their algorithms would be, how precise, whether they would guarantee over- (under-) estimates, etc. I proposed a randomized algorithm in which people picked one of k numbers and then only the ones who matched the number I had thought of stood, we counted them, and then multiplied by k.
• problem solving: the board puzzle (board cut in two, 1st part 2/3 of board, 2nd is 1st + 4, how long is board?) -- emphasizes careful high-level thinking over "jumping in and hacking"
• variables/types: ascii wolf (seeing bits as values) -- showed an ASCII art picture of a wolf and asked them what it was; pointed out when they answered "a wolf howling at the moon" that it was just a bunch of characters, and that the value of a thing is all in how we look at it. Similarly, the bits "0110100" might be an integer (100) or might be a letter if we see it through the ASCII table (something like 'f', I think).
• conditionals: false coin problem (weighing) -- given a balance scale and three "gold" coins, one of which is fake (aluminum painted gold), how many weighings do we need to find the fake?
• loop style: sketch solution to print a number 1-n; discussion of sol'n. (while vs. for)
• Connecting to native/previous knowledge
• loops/functions: newspaper delivery to CSE street (intuitive sense of loops and functional decomposition)
• logical connectives: English sentences with different senses of OR, which one is right? (choose either blue or green; raise your hand only if you have either a right hand or a left hand; did you do either HW#1 or HW#2?) -- discuss the need to formally define what we mean (for precise communication)
• Game shows
• binary numbers: car-talk money-in-envelopes challenge -- given \$15 and 4 envelopes, how much money do you put in each envelope so that you can give me any integral amount from \$0 to \$15 just by handing me some of the envelopes? I actually gave away the money when I did this problem.
• homework prep: let's make a deal game (with prizes!)
• Misc
• class dynamics: go over feedback
• recursion: write a grammar for the English language (show things are naturally defined in terms of themselves) -- had people write a grammar (CFG) defining a "sentence" in English. I stressed conjunctions so we'd get around to recursion.
• ALWAYS: catchy title/subtitle (e.g., "Mind Your Priority Queues")

Steve Wolfman
wolf@cs