Friday, May 25, 2012

An ongoing revolution... in computing education

These days a lot of people seem to be thinking, "Maybe I could try one of those free online courses and learn how to program." Others say, "What's the point?" (Juliet Waters, in blogging about her New Year’s resolution to learn how to code, explains what the point is.) Some even say, "No! Please don't learn to code!" Fortunately, the last category holds only a tiny minority of people.
The past six months have seen a surge of public interest in computing. The UK is refocusing its pre-university curriculum on information and communications technology to concentrate on the science of computing. (This is good timing; 2012 marks the centenary of the birth of Alan Turing, the London-born founder of computer science.) In the New York Times, Randall Stross writes about computational thinking as a fundamental skill for everyone. When even the mayor of New York City decides to join Code Academy to learn how to program, people take notice. A minor revolution is underway in formal and informal computing education.

Wednesday, May 23, 2012

I'll bet you like ice cream.



Do you like ice cream? I'll predict that if you care enough to mention ice cream via Twitter, you're probably in favor of it, even moderately enthusiastic.

Am I just guessing? Not entirely. I used a visualization system developed by my colleague Chris Healey to produce the result at the top of this post. When I typed in "ice cream", the system retrieved a few hundred recent tweets containing that term and generated a visualization of their emotional content, or sentiment. Try it yourself, with your own keywords, on Chris's tweet viz Web page.

The visualization integrates a lot of information (details here), but I'll concentrate on the basics: roughly speaking, the green circles are for tweets that express "positive" sentiment, and the blue circles are for tweets expressing "negative" sentiment. Sentiment is inferred from the words in the tweet. For example, "ice cream and good sex!" (the text of an actual tweet, with relevant words in bold) contains "good" and "sex". Very nice. But how could ice cream be bad? Well, some people who eat ice cream when they're feeling down might tweet about it. And one tweet says it's "dangerous even in an ice cream shop! Robbery yesterday..."

We'll need a bit of theory to understand how the circles are laid out. James Russell, a psychologist at Boston College, has proposed a conceptual framework for understanding emotion [PDF]. (There have been many attempts to formalize what we know about emotion.) In Russell's framework, one important factor is valence, which ranges from unpleasant to pleasant. (This is actually what I meant by "negative" and "positive" above.) The horizontal placement of a circle is an indication of the unpleasantness or pleasantness expressed in a tweet. And the vertical placement? That's another factor in Russell's framework: arousal, which ranges from being nearly comatose to being very, very excited. So the circles toward the top are excited, with happy tweets on the right and stressed-out tweets on the left, and at the bottom they're kind of... meh. We don't see a lot of the latter; tweeting takes some effort, after all.

It's surprisingly hard to find topics where tweets contain uniformly pleasant or unpleasant sentiment. Not even for the keyword "funeral":


Some people apparently like funerals! But if you hovered your mouse pointer over different green circles to read the tweets, you'd find that some Twitter users have the word "funeral" in their names, and sometimes they tweet about happy things. (Why not filter out names? We'd lose information. For example, a query on "obama" might then ignore tweets containing only @BarackObama, which we probably do want to see.) Also, you'll occasionally find something along these lines: "Nice to see my loving family at an event other than a funeral." A loving family is a pleasant thing to have.


This last example suggests that an automated analysis isn't as smart as a person in extracting meaning or sentiment. A human being, for example, might reasonably judge that a tweet about "an event other than a funeral" isn't really about funerals. Processing natural language, beyond the level of individual words, remains a very hard problem.


I'm writing about Chris's tweet viz system for a couple of reasons. First, it's cool. Half a billion people across the world use Twitter, and 340 million tweets are posted each day. (I'm quoting one of my students, Shishir Kakaraddi, who just completed an M.S. thesis in the general area of tweet summarization.) We need good tools for making sense of all this data. Second, the project is a nice example of how research can drive software development. It's not just about what people might like to see in a visualization of Twitter data; the design of the visualization draws on psychological models of visual perception (for example, in the color choices) and of emotion (in the analysis and display of sentiment information). By building and testing systems like these, we can learn new and interesting things.


Monday, May 21, 2012

Being chased by ravening informavores

I posted this a couple of years ago, but the original version is gone; here it is again, in slightly altered form.
Imagine yourself a gentle woodland creature, perhaps a deer. You're peacefully munching on ferns and acorns in the forest, like Bambi, moving from one patch of fresh greenery to another, until...
Well, there's no "until" in this story; you spend the rest of your life in the pursuit of various deer-appropriate activities, and the curtain comes down long before your unfortunate encounter with a pack of wolves.
If we were to ask a group of biologists to tell this story, they'd be able to flesh it out with any number of details: the kinds of plants you find nourishing as deer fodder; your weight, coloring, and other physical characteristics; even what your life has probably been like up until now. They'd be able to describe your deerhood down to the hairs in your coat. This isn't the only way to tell such a story, though. Some of the biologists' mathematically oriented cousins, the behavioral ecologists, have traded in their magnifying glasses for satellite cameras, abandoning details for generality. For example, a behavioral ecologist might say,
Once upon a time, in a forest in which patches of edible foliage were uniformly distributed with such and such parameters, various groups of deer spent x hours on average within one patch before moving to another...
This bedtime story should put you (not to mention your children) right to sleep. But here's the thing: if we can tell such ecological stories accurately, we should be able to answer a lot of interesting questions. For example, "Given a particular foraging behavior we observe, what kind of environment might this animal have evolved in?" Or "If a drought is expected this summer, reducing flora of this kind, is this species likely to survive, given its usual behavior?" Or even a bit farther afield, "Given the rate at which temperatures are rising in the Arctic, along with our knowledge of polar bears, including their swimming range, how far are they from extinction?" And so forth. I've made up these specific examples, but they all fall within the scope of behavioral ecology. 


"But why should I care about any of this?"


Let me tell you a different story...
I'm browsing through Facebook and I come across an update that points to an interesting story in the news. I follow the link to a newspaper Web site, and after I'm finished I see, on the sidebar, other articles that are popular. I move on, happily reading and even commenting until eventually I am eaten by wolves—
Oops, sorry, I forgot which story I was telling. But you can see how I might have become confused. I'm telling the same story about myself that I told about a deer, except that I'm foraging for information. The insight concerning this parallel is due to George Miller (whose name is familiar to Psych 101 students—the magical number seven plus-or-minus two may ring a bell). Miller observed that just as animals consume food, human beings and other higher organisms consume information: we're informavores. One of the implications of this view is that the scientific concepts used to model animal ecologies can also be applied to human information environments.
Peter Pirolli and Stu Card, cognitive scientists at PARC, have explored this idea in detail. Among other things, they've defined some new conceptual terms for Web designers to think about, such as information foraging and information scent. "Information scent is a metaphor for proximal cues that guide users in navigating toward distal information," as I once wrote elsewhere. In other words, we can think of the World Wide Web as consisting of patches of information that we move in and between, trying to maximize the value of what we're absorbing as we go. The little snippets of text associated with hyperlinks that we can click on (or decide not to click on) are the information scent for the Web pages they reach.
These concepts are more than a metaphorical way of describing what people are doing when they surf the Web. They can be used prescriptively. The Web is an artificially designed information environment, one that can be tailored to what is known about human information foraging patterns: how we allocate attention between competing sources of information; how we combine what we see with what we already know; even the mechanics of how we point at and click on information items we find interesting. Our interaction with a given Web site can be optimal, by some measure, if it is designed to be so. In theory, at least...
So if a deer sees a bunch of bright red berries in the middle distance and thinks, "Yummy," he's doing much the same as I am when I see a link and consider following it. More yummy information. And when we've had our fill, or at least grazed for a while, we move on. The next time you hear someone say, "We're closer to animals than we think," you have another reason to agree.




I'll end with a disclaimer: I'm a computer scientist rather than a behavioral ecologist; this is my understanding of the area. I've also written a little bit about the work of Peter Pirolli and Stu Card elsewhere, and I chat with them on occasion.

Sunday, May 20, 2012

Through the Computer Screen, Part II

My previous post was a Lewis Carroll pastiche about the organization of concepts in computer science. This isn't an unusual effort; several can be found online, and there's an entire book, Lauren Ispum, that combines themes from Alice, The Phantom Tollbooth, and probably other sources (I've only read a few chapters) to introduce computer science to kids.

 Tweedledum's expression (or is that Tweedledee's expression?) will probably match your reaction to the computer in-jokes in my piece.


I should start by crediting Peter Denning, who developed the Great Principles of Computing, though I'm relying a slightly older and simpler version of his work. To quote from Denning's paper [PDF]: 
  • Computation: What can be computed and how; limits of computing. [I've called this Theory.]
  • Communication: Sending messages from one point to another.
  • Coordination: Multiple entities cooperating toward a single result.
  • Automation: Performing cognitive tasks by computer.  [I've narrowed this to Artificial Intelligence.]
  • Recollection: Storing and retrieving information. [Narrowed to Information Management.]
Here's how I put this together in a metaphorical story, with annotations in green. I explain the red asterisks at the end.

Alice is wandering through the downtown area of her city. As she walks down a side street, she passes a man and a woman leaving the entrance of a small white building. The woman says, "That was an interesting museum." [Why a museum as the setting? See the AI section below.]
Alice decides to go inside. She stops in front of a sign titled “Read me” [Software is often delivered with a README file giving basic information] and discovers that she’s in a museum of Victorian artifacts. Alice passes a display of postcards, then an arrangement of fashionable women’s clothing (cuirass bodices, skirts with bustles), and then a penny-farthing bicycle. Eventually she sees a man in uniform sitting behind a writing desk. His badge reads, Docent: Charles Corvus.  ["Charles" is of course a nod to Lewis Carroll. The Corvus genus includes ravens, one of which appears in Alice in Wonderland as the subject of a riddle.]
Communication: "Hello," says Alice politely. "Can you tell me about your museum?" Charles doesn't look up.
"This isn’t a mausoleum," he says. *
“Your museeeum," Alice says, enunciating carefully. [One approach to dealing with errors in communication is simply to repeat.]
Charles glances up at her. "I beg your pardon," he says. “It’s a bit noisy.”  [Noise introduces errors in communication.] He rises and shakes Alice’s hand[Handshaking is part of how some systems initiate communication.] “Would you like to have a tour?"
Artificial Intelligence: He gives her a small plastic device with buttons and a display. "This is a mobile guide. If you press this button, it will tell you where to go next in the museum."
"Thank you. [Carroll's Alice is very polite.] How does it know what I’ll be interested in?"
"It doesn't," Charles says. * "It takes you on a walk in a random direction." [A random walk and the British Museum algorithm are famous though not very good search techniques in AI.]
Information management: "But how does that help me?” asks Alice. “I mean, the museum seems very confusing as it is. It’s as if there’s no organization to the exhibits."
"Ah, but there is. You're meant to explore the museum, and it's organized so that whatever exhibit you're standing in front of, related exhibits are as far away as possible." *
"Does that help?"
"Yes—the key is to take your time.  Join me. We’ll explore together."  [These are database terms.]
Coordination: Alice and Charles pass two stout museum workers holding opposite ends of a large flag. The men are arguing and pulling violently in opposite directions. The threads part and snap, leaving the fabric in tatters. * [These are operating systems terms.]
"Those contentious fellows are in charge of separate exhibits," says Charles. "They're always having a bit of a fight." [Contention over resources is also an operating systems issue; I'm quoting Carroll with "a bit of a fight".]
Theory: Alice and Charles walk through the rooms for a while longer, talking about the exhibits. At the exit she says, "Thank you, it's a very interesting museum."
"All of our visitors say that."
"Do you have many visitors?" asks Alice cautiously. She hasn't seen another inside the museum.
"Uncountably many," says Charles.  [Some sets of things, such as the real numbers, can't be counted in their entirety--if you try, you'll inevitably end up missing some.]
"Oh. Have you tried counting?" *
“Well…” Charles halts and looks thoughtful. "Good-bye." [Alan Turing, the father of computer science, proved that the halting problem--determining whether an arbitrary computer program will stop or run forever--cannot be solved by any algorithm.]


One of the conceits in this piece (if that's the word I want) is that the starred breakdowns should be memorable, and each breakdown marks a different area of computing. But is this effective? Hmm... 
I feel a little bit like a magician explaining a trick that didn't come off, or a comedian trying to convince you that some routine should be funny. Elmore Leonard follows this rule in his work: If it sounds like writing, I rewrite it. What I've written definitely sounds like writing. That's part of the charm of the Alice books, but I'm no Lewis Carroll.

Saturday, May 19, 2012

Through the Computer Screen, and What Alice Found There

I wonder if every computer scientist who writes for the general public is tempted to do an Alice pastiche?

This is a fragment from a draft of the first chapter of my soon-to-be-published book, Computing for Ordinary Mortals. One of my excellent reviewers said that this passage had to go, and so I replaced it. I still like it, though. I'll put up another post, a bit later, with footnotes.



Alice is wandering through the downtown area of her city. As she walks down a side street, she passes a man and a woman leaving the entrance of a small white building. The woman says, "That was an interesting museum."
Alice decides to go inside. She stops in front of a sign titled “Read me” and discovers that she’s in a museum of Victorian artifacts. Alice passes a display of postcards, then an arrangement of fashionable women’s clothing (cuirass bodices, skirts with bustles), and then a penny-farthing bicycle. Eventually she sees a man in uniform sitting behind a writing desk. His badge reads, Docent: Charles Corvus.
"Hello," says Alice politely. "Can you tell me about your museum?" Charles doesn't look up.
"This isn’t a mausoleum," he says.
“Your museeeum," Alice says, enunciating carefully.
Charles glances up at her. "I beg your pardon," he says. “It’s a bit noisy.” He rises and shakes Alice’s hand. “Would you like to have a tour?"
He gives her a small plastic device with buttons and a display. "This is a mobile guide. If you press this button, it will tell you where to go next in the museum."
"Thank you. How does it know what I’ll be interested in?"
"It doesn't," Charles says. "It takes you on a walk in a random direction."
"But how does that help me?” asks Alice. “I mean, the museum seems very confusing as it is. It’s as if there’s no organization to the exhibits."
"Ah, but there is. You're meant to explore the museum, and it's organized so that whatever exhibit you're standing in front of, related exhibits are as far away as possible."
"Does that help?"
"Yes—the key is to take your time. Join me. We’ll explore together."
Alice and Charles pass two stout museum workers holding opposite ends of a large flag. The men are arguing and pulling violently in opposite directions. The threads part and snap, leaving the fabric in tatters.
"Those contentious fellows are in charge of separate exhibits," says Charles. "They're always having a bit of a fight."
Alice and Charles walk through the rooms for a while longer, talking about the exhibits. At the exit she says, "Thank you, it's a very interesting museum."
"All of our visitors say that."
"Do you have many visitors?" asks Alice cautiously. She hasn't seen another inside the museum.
"Uncountably many," says Charles.
"Oh. Have you tried counting?"
“Well…” Charles halts and looks thoughtful. "Good-bye."

Friday, May 18, 2012

Experiencing Design: New encounters

For a few years I wrote a column on human-computer interaction (HCI) for the British quarterly trade magazine, Interface. This is one, slightly revised.

Advice for building interactive computer systems usually includes something about learnability. The learnability of a system includes two important parts: how easily new users can learn to carry out common tasks and, once they have some experience with the system, how easily they can improve their performance.

There are obvious differences between learning in a software environment and learning in the real world. For example, a few years ago I spent some time in California, and I learned how to skate with inline skates. (I eventually managed to stay upright for minutes at a time.)

Thursday, May 17, 2012

Experiencing Design: One’s own experience

For a few years I wrote a column on human-computer interaction (HCI) for the British quarterly trade magazine, Interface. This is one, slightly revised.

Every year I greet a new group of computer science students who have signed up for my HCI course. By the end of the semester, most of them will have a reasonable grasp of the basics of HCI, and some will even be enthusiastic about the topic. Projects turned in by students, working in teams, have included a voice-controlled video game, a gesture-controlled Web browser, a social networking application for gamers, and a variety of personal information organizers, on the desktop as well as on cell phones and other mobile devices.

Over the past ten years or so I've noticed students becoming more interested in applications that push the bounds of what's currently possible. The projects generally target what Jonathan Grudin calls discretionary hands-on use (Three Faces of Human-Computer Interaction, IEEE Annals of the History of Computing, 2005). That is, students are less interested in building a better calendar system, financial planner, or electronic voting ballot; they look to applications and devices that fit into the natural and often optional activities of our everyday lives. How can I contact my friends? Could I play a familiar game in a different way? What would people like to do with their mobile phones that isn't easy to do now?

Behind the title of a new book




Forthcoming this fall from Oxford University Press

So you've written a book. What should you call it?

Tough question. Two years ago I submitted a proposal to Oxford for a book titled Computational Thinking.

My editor liked it. (She suggested that I resubmit a proposal for two books, one purely about ideas in computing and the other about how those ideas connect to our everyday lives. She also asked if I would edit a collection of papers on the subject... but I declined both options.) Reviewers also liked the proposal. (Non-fiction is different from fiction; you can pitch a book to an agent or publisher before you've finished writing it. Sometimes before you've written any of it.) But some reviewers argued about the title--there's disagreement among computer scientists about what computational thinking actually is.

Back to the drawing board. My second effort at a title was How to think about computers if you're not a computer scientist. The marketing folks at Oxford hated it.

The third try, a suggestion from my editor, ended up on the book contract. Understanding the computers in our lives. I don't think anyone was really satisfied with that, though.

So I sat down with my wife and brainstormed.

By analogy, the challenge was this. Imagine an alternative universe in which you're looking for a popular science book about biology. You find biographies of Darwin and other famous figures of the past and present; you see books that tell you how to turn on and focus a microscope, and even how to run a DNA sequencer; you come across a wide range of books aimed at professional biologists. No one at the bookstore has ever heard of Stephen Jay Gould, Edward O. Wilson, Richard Dawkins, James Watson, or Lewis Thomas, and hardly anyone thinks that it's possible for a book to convey the basic principles of biology to the average, non-biologist reader.

The literature of computing is something like that. There are lots of books about the history and social impact of computing, and about how to use a computer. There are libraries full of deep technical books for computing professionals. But there aren't many books about the ideas behind computers and computing, written in an approachable way. Mine would be a new addition to that tiny handful.

How should the book's title convey what it's about--and what it's notabout? One batch of titles we came up with emphasized the "popular" aspect of "popular science", while de-emphasizing the how-to aspects of computing:
  • Computers for the rest of us
  • A hands-off guide to computers
  • The human element in computing
  • A computer scientist looks at life
  • Computable lifestyles
  • The computable lifestyle
  • A computable life
  • This is not a computer manual
  • About computing
  • It's all computed
  • Computing without computers
  • The ABCs of computing
But none of these quite works, even if I like a couple of them, in the sense that they're too general, or they're a bit misleading about the contents.

The next batch of titles was based on the structure of the book I was writing. I tell stories to convey abstract ideas, real-world metaphors for how computation works. So...
  • The metaphorical computer
  • Computer stories
  • Stories about computers
  • Computers: A bedtime reader
Also less than ideal. The point isn't the stories themselves (which could be about anything, including the history of computing), but what the stories suggest.

The next batch of titles moved away from description to the equivalent of Buy this book
  • Computers: The important stuff
  • Computers: The first book to read
  • Computers: The first book you need to read
  • Computers: What everyone needs to know
  • Computers: The inside story
  • Computers: Behind the silicon curtain
But none of them seem quite right. (In case you're curious, all of these titles have the word "computer" or "computing" in them to help Web search engines find them.)

In the end, we settled on Computing for Ordinary Mortals. It says, "This is a book that anyone might read," and I hope that it also makes a subliminal connection between computers and our lives.