Getting to know your robot

I’ve been giving a lot of thought to the “programming without math” question, and my views have been shifting since my earlier posts on the subject. I think now that I underestimated the significance of the comment by Andras:

“As computing is drastically transforming our society, I think great minds need to look at transforming ‘programming’ to be more engageable and useful to a wider audience.”

The blocks world with snap-together tiles that I was playing with earlier is really quite close to the standard “procedural” paradigm for programming, in which you need to explicitly tell the computer what to do, and in what order. I now think the hurdle for that is still too high, because it fails my fifth of vodka test. In a nutshell: for 90% of the population to embrace something, it has to still be fun to use after you’ve imbibed a fifth of vodka. That’s true of the Apple iPhone and most popular TV shows, but not of any existing programming language — which tend to be notoriously intolerant of errors.

It would be great to have the sort of interface that science fiction writers fantasize about when they create imaginary robots. George Jetson doesn’t need to type in code to get Rosie the Robot to know what he’s talking about, and Luke Skywalker doesn’t require some long-ago-and-far-away Jedi version of Java to give instructions to R2D2. In both cases, they talk to their robots. This may be a fantasy, but it also might contain seeds of a necessary truth.

For certainly anything that will be used by most people will need to be very error tolerant. We need to give people an environment for talking to robots that allows users to make mistakes, and yet still more or less works. People are quite good at learning to find their way through fuzzy systems that respond with some level of consistency (that is in fact a high level description of every toddler’s experience of the world).

And that means that there will need to be a strong element in the system of what programmers call “declarative programming”. You, the user, are allowed to give general rules for what you think your robot should do, and those rules don’t need to be arranged in a rigid order. This is more in line with the way people usually think. If you say “I like my songs arranged with the sad songs first,” then your robot should generally know to put the sad songs first on your song list. You’re not giving it explicit instructions how to do this. Rather, you’re giving it a general rule to influence its behavior.

Generally this means that there will be some kind of software running inside the robot that does “constraint solving” — given constraining rules to work with, the robot comes up with solutions that fit those constraints. There is already an entire subfield of computer science concerned with declarative, constraint based programming, but the available languages, such as CLIPS, Soar and Prolog, are considered tools for A.I. researchers, and generally require an expert user.

While we’re on the subject of A.I., it is important to reiterate that computers are not people. As Ben Shneiderman is fond of pointing out, a computer is closer to a pencil than it is to a person. Our robots might one day develop the sort of “reasoning” process that we associate with humans (many brilliant people have been valiantly trying to climb that mountain for decades now) but there is no guarantee this goal will ever be achieved, and certainly no assurance it will happen in our lifetimes.

Even the software “robots” that the folks at Google incorporate into their Wave project (software agents that lurk behind the scenes to interactively modify and update your screen widgets), are very literal minded, and are generally programmed the old-fashioned way, through a procedural AppBuilder language that is essentially a gloss on such “expert” languages as Java.

In order to create robots that are accessible enough that most people can explain things to them, I think we will need to go back to some of the ideas I discussed two years ago when talking about Theory of Mind, and the great work in this area by Lisa Zunshine and others (about which there was a lovely article the other day in The New York Times). In other words, we will need to develop a Theory of Mind about what robots can and can’t do.

So this is going to be a two way street. Yes, we need to make future robots more accessible to the 95% of the population that is now left out, by adding natural language interfaces that allow people to talk to their robots declaratively (ie: “I like my songs arranged with the sad songs first”). But we will also need to gradually teach people a Theory of Mind about robots, so that we humans properly understand the peculiar nature of this strange new species that we will be learning how to talk to in the years to come.

Attic, part 10

Josh was getting uncomfortable. Mr. Symarian had been reading from his little black incantation book for a good fifteen minutes and it didn’t seem like anything was happening. Except maybe that the candles had burned lower, but Josh was sure that didn’t really count.

None of this would have been a problem — Josh was as up for a good supernatural adventure as the next kid — except that he really, really had to go to the bathroom. He wondered idly whether it was ok to interrupt a ritual invocation of dark spirits to announce something like that. He was sure the spirits wouldn’t care — they probably didn’t even have bathrooms in the afterlife, or wherever dark spirits hung out. But it just didn’t seem quite, well, appropriate.

To get his mind off things, he tried to think about other occult situations, in books he’d read, to see if anybody had ever had to go to the bathroom. There was that one series of books, the one with the annoying wizard kid, where there was some ghost of a girl who actually haunted a bathroom. But Josh was pretty sure nobody in the book every actually used that bathroom. Which made sense, given that a haunted bathroom pretty much guaranteed you wouldn’t get any privacy.

He had just about managed to screw up his courage to speak out and openly express his need, when Jenny spoke up first. “I don’t think this is working,” she said.

Mr Symarian looked at her with an injured expression. “It’s always worked before. I’ve been doing this spell for centuries…”

“Euphemism,” Sid interrupted. “‘Centuries’ was a euphemism, kids. Right teach?”

“Yes, well,” Mr. Symarian said, blushing. “Merely corroborative detail, intended to give artistic verisimilitude to an otherwise bald and unconvincing narrative.”

Jenny was sure she’d heard that somewhere before, but she couldn’t quite place it. She looked to Josh for support, and noticed for the first time that he seemed rather uncomfortable. In that moment she had a flash of understanding. “Mr. Symarian, would it be ok with you if we took a bathroom break?”

“Why yes,” their teacher said, “I think that would be fine.”

Josh wanted to kiss Jenny, but that would have to wait. Right now he needed to head for the door. By the time Mr. Symarian had finished his sentence, Josh was already gone.

“Sheesh!” said Sid. “And they say we demons dematerialize fast.”

Inverse forensic science

I was delighted to read this week that the frozen body of Walt Disney was successfully revived (cf: J Inv Forensic Sci 2010 Mar;55(2-6)). Many of you know that when the great animation pioneer passed away on December 15, 1966, cryogenic technology was used to preserve his body in a state of latent animation. A novel slow-freeze process was employed, with the highly respected cryogenic specialists Drs. Joseph Plateau and Pierre Desvignes flown in from Paris to oversee the operation.

At the time this was considered a major breakthrough in inverse forensic science, the first such method in which the cells were prevented from crystalizing. It is generally believed that unwanted crystalization during cryogenic preservation causes massive rupture at the cellular level, thereby diminishing the chances of a patient’s eventual revival to nil.

Fortunately, Mr. Disney, or “Patient WD” as he was referred to in (J Inv Forensic Sci 1967 Apr;12(3-7)), was the first recipient of this highly controversial new method of cryogenic preservation, originally developed by Drs. Thomas and Johnston of the renowned Buena Vista Institute. The process involved a novel technique in which the patient was transferred to a state of “Cryogenic electrolytic latency” (Cel). The underlying rationale at the time was that as technology developed further, scientists would eventually develop effective methods of reversing this process.

That time has apparently arrived. In a breakthrough that has thrilled inverse forensic scientists everywhere, Patient WD was successfully revived last month at the Buena Vista Regional Medical Center, through a technique that chief attending physician Dr. Stuart Blackton is calling “Cel re-animation” (Dr. Blackton, the first physician board certified to perform such an operation, drew on techniques originally developed for his well known HPFF phase protocol). Mr. Disney is reportedly recovering with family.

Dr. Felix Messmer of the Max Planck Institute — whose groundbreaking theoretical work led to the invention of the CAT scan — was willing to speak on the record about the implications of the recent operation. “In the years since Mr. Disney’s departure, we have developed highly advanced methods of 3D visualization — techniques that would have been inconceivable back in 1966. And yet, as today’s results clearly reveal, it is never too late for Cel animation.”

Attic, part 9

Apparently, as Jenny and Josh understood it, the goal was to create something called an “astral portrait”. Sid seemed very confident in his power to do this — apparently it was one of the more elementary spells — but a quiet and secluded place was needed to conduct the ceremony.

Meanwhile Mr. Symarian employed a different kind of power — he reserved a meeting room in the school basement over the weekend. When the secretary in the main office asked for the purpose of the meeting, he told her “Astral Photography Club.”

So it was that the four of them found themselves in room G102, bright and early on a Sunday morning — the one time of week they could be sure nobody would be around to disturb them. Jenny and Josh hadn’t been sure what to expect. They wouldn’t have been surprised if Mr. Symarian had shown up in a long robe and a pointed hat. To their considerable disappointment, he arrived in the same rumpled jacket he always wore.

Mr. Symarian set up four tall black candles, one at each corner of the table. He fumbled for matches, then looked apologetically at Sid. “Sorry, this was so much easier before I quit smoking.”

“Don’t sweat it pal,” the demon replied, “I do this kinda thing for breakfast”. Sid waved one tiny taloned hand and all four candles flared into flame. Jenny and Josh looked at each other gleefully. This was starting to get interesting.

Mr. Symarian took a small black notebook out of his jacket pocket. It looked very old and worn, and there was an odd symbol etched into the front cover. He placed the notebook neatly onto the table, opened it to a page he had previously marked, and in a quiet measured voice began to read out loud.

Memory game, even more twisted

Thanks to Guzman for his long and thoughtful comment on my post the other day about Van Chung’s cleverly twisted variation of the Memory game.

I read Guzman’s comment with great interest, and am impressed that he has managed to amass so many variations on this venerable game. Although I didn’t see any mention there of my even more twisted variation on Van’s version of the Memory game. Maybe nobody has come up with my version before.

As with Van’s version, part of the challenge in my variation is just to figure out what the game is — ie: how the rules have been tweaked. In a way, that meta-game is the really interesting part — more interesting in my opinion than the game of solving the puzzle itself.

In a way, such game variations are metaphors for life itself. In life, the hard part often lies not in playing the game, but rather in figuring out the rules in the first place. Anyone who’s ever been on a first date will know exactly what I’m talking about.

It occurs to me now, thinking about this, that Franz Kafka’s novel “The Trial” would make a wonderful subject a twisted meta-game. Such a game would make a perfect thirtieth birthday present for some lucky gamer. The fun would lie in trying to figure out the rules. If you designed it right, the game could be played for an entire year (although not longer, for obvious reasons). 😉

Attic, part 8

“OK,” Sid said, looking at Jenny and Josh. “Let’s cut to the chase. I’m a finder demon. They don’t send my class of spook into this plane just for kicks. There’s something’s gone missing, right?”

Josh and Jenny looked at each other. “Actually,” Jenny began, “it’s not exactly something missing, it’s something found.”

“Yeah kid, I know, there was a key. There’s always a key. Key leads to a scroll, scroll summons a demon, yadda yadda. It’s always the same drill. Spare me. I mean what went missing? Think back.”

Jenny was silent, lost in thought. “Does it have to be a what?”

Sid perked up. “Interesting question. What’s the angle?”

“I mean, can it be a who?”

“Yeah, sure. A who can be a what. I mean a what isn’t always a who, but a who is definitely always a what. I don’t make the rules, but I sure know what’s what. Or in this case, who’s what, if you see my drift.”

Josh felt in over his head. “Jenny, do you have any idea what he’s talking about?”

“Yes,” Jenny said, “it’s perfectly clear. He’s talking about Grandma. That’s what this is all about, isn’t it?” She looked at the demon expectantly.

Sid took his time answering. “Yeah, I’m starting to get the picture here. Old lady goes missing, manages to leave a key. Her daughter can’t do a thing, cause she hasn’t got the Power.”

“The power?” Josh asked. “what power?”

“Not power, Power. Your girlfriend’s got it.” Josh was about to correct him, but thought better of it. Sid waited him out, then continued. “Usually skips a generation. Grandma to granddaughter. Touching really. Anyway, grandma’s missing, and we’ve gotta find her fast.”

“Wait,” Jenny asked. “That box was in the attic for years. Why now?”

“Cause you found the key. That right, big boy?”

Mr. Symarian had been watching quietly. But now Sid had asked him a direct question, and they were all looking at him. “Why yes, that’s true,” he nodded. “If you found the key, it means that trouble is brewing. Keys don’t just show up — until you need them. Jenny, do you have a picture of your grandmother?”

Jenny shook her head slowly. “Mother destroyed them all. I never asked why — it was something we never talked about. Do we need one?”

“Only if you want to find Grandma,” Sid said. “Wait. I’ve got an idea. Let’s make a picture of the old broad.”

“Can we do that?” Josh asked.

“Trust me kid,” Sid grinned, “I’m a demon.”

Memory game, with a twist

In the Memory game, you are shown a rectangular grid of cards, all face down. On the face of each card (the side you can’t see), is a picture. For any given picture, a pair cards will have that picture on its face — so for every card there is a matching card.

You play the game by turning up two cards at a time. If those two cards have the same picture, then you get to keep the cards. Otherwise, you have to turn them both face down, and try again. It’s really a test of memory (hence the name of the game) — if you can remember which card was which, you can win the game quickly. Otherwise, it can take a long time to finish.

Here is a simple version of the game that I’ve implemented as a Java applet, to give you the idea.

My friend Van Chung, who is a very accomplished Java programmer and amateur mathematician — and who also happens to be twelve years old — came up with a wonderfully fiendish variation of the Memory game. He calls it “the Memory game with a twist.” It’s a lot sneakier than the original version (be warned). I liked it so much that I reimplemented it. Here is my reimplementation of Van’s twisted Memory game.

To me the most interesting thing about this is the way that games can inspire other games, just as stories can inspire other stories. Van took a fairly prosaic game, added his own very clever variation, and came up with something far more interesting. And, arguably, more profound. For whereas the original Memory game is a kind of meditation on permanence, Van’s variation is a meditation on impermanence.

I was so impressed by this that I then created my own variation of Van’s variation, which took his idea even further. But I’ll get to that the day after tomorrow. Meanwhile, I’ll give you a chance to play with (and hopefully to solve) Van’s version of the Memory game.

Attic, part 7

As their teacher’s voice filled the room, intoning the strange words, Jenny and Josh looked at each other.

“Whoa,” Josh said, “Isn’t he supposed to be translating that stuff into English?”

“Keep your voice down!” Jenny whispered. “I’m sure Mr. Symarian knows what he’s doing. Besides, whatever it is, I think something’s happening.”

“What do you mean?”

“Haven’t you noticed?” she said. “It’s getting colder in here.”

“Maybe somebody left the window open…” Josh’s whispered voice trailed off. The window was shut tight. As they watched, lines of frost were forming over the panes of glass. “It could just be a cold snap,” he suggested.

Jenny shook her head, and pointed. Across the room, the window on the office door was also frosting up. Josh stared at the door, agape, and then they both looked back at their teacher. A patch of air above the center of his desk was starting to shimmer, the way hot air shimmers on a summer’s day. The surface of the desk directly beneath was slowly and ominously beginning to darken.

Suddenly there was a popping sound. Mr. Symarian had stopped his chant, and was now peering with interest down at the desktop. Standing there on the desk, looking around with a somewhat disgruntled expression, was a bright reddish-orange six inch tall demon.

As Jenny and Josh looked on in amazement, the demon spread first one leathery wing, then the other, eyeing them critically.

“Hello Sid,” said Mr. Symarian.

The demon glared up at their teacher reproachfully. “You couldn’t have picked a better color, maybe?” he said in what sounded like a strong Brooklyn accent.

“Sorry,” Mr. Symarian shrugged. “I’m a little rusty.”

“Yeah, right. And now ’cause you’re rusty, I’m rusty.” The demon shook his horned head in resignation. “Amateurs! I need a smoke.” He waved one of his tiny taloned hands, and a perfectly proportioned little cigar appeared in his fingers, already lit.

“Sorry Sid, you can’t smoke in here,” Mr. Symarian admonished.

“You gotta be kidding me,” the demon replied. “Who’s idea was it to bring me here in the first place? Cut me a break, will ya?”

“You know the rules, Sid. Local customs. It’s not up to me. They’re His rules.”

“Crap,” the demon said. There was a bright reddish-orange flare, and the little cigar vanished as suddenly as it had appeared.

Jenny and Josh had been silent throughout this exchange, too stunned to speak. But now Josh found his voice. “You said crap.”

The demon looked at him, as if seeing him for the first time. “What’s it to you?”

“Demons aren’t supposed to say things like that.”

Jenny chimed in supportively. “And whoever heard of a demon that smokes cigars?”

“And what’s the deal with the Brooklyn accent?” Josh added. “That is a Brooklyn accent, isn’t it?” His tone was almost accusing.

Sid rolled his eyes. “Look kids, I’ve had a rough day, and I’m not in the mood to debate theology with a pair of human whelps. But since you asked, don’t you think it’s kind of nuts, these questions?”

“I think they’re perfectly reasonable questions,” Jenny said, and Josh nodded in agreement.

“Oh give me a break. I’m a friggin’ mythical creature. You know, as in `Imaginary, fictitious, not based on facts or scientific study.’ I’m not even supposed to exist. You gonna stand there and tell me what accent I’m supposed to have?”

“He does have a point,” said Mr. Symarian.

Vignetting

I was watching a rather high-tech film the other day, and suddenly I noticed how crisp were the edges of the screen. In the film a character stood in the foreground, framed from chest up against a brightly lit interior, and all of this was surrounded by a rectangle of inky blackness — the areas within my vision that were off of the screen image.

Oddly, the seemed notable precisely because it is a phenomenon that generally goes so unnoticed. The sharp line between light and dark, the sudden horizontal slash that cuts of a character at the chest or waist or neck, we see these intercisions every day, and yet we never really look at them. And yet they are so at odds with the way reality itself operates. In the real world there are no such sudden cut-offs. The world flows in a continuous way, from one atom to the next. When bodies in the physical are cut into pieces, it is not so much an artistic choice as it is an act of extreme violence.

What came to mind as I observed myself observing this was the now long obsolete phenomenon of vignetting in early silent films. In many early silents, you don’t actually see the edges of the frame. Rather, the filmmaker deliberately throws out a portion of the frame, fading everything near the edge to black in a smooth and fuzzy transitional zone.

I had never understood before why early filmmakers did such a thing. Suddenly it becomes clear. There was no reason for those cinematic pioneers to believe that an audience would accept the sight of a head severed sharply at the neck or a body cut off below the waist. They were trying to protect their audience from odd images of violence, dismembered limbs, headless bodies. There was, as yet, no well developed theory of mind for a cinematic audience, and so there was not yet a consensus on a most plausible representation of human reality on screen.

I believe we are faced with similar issues with the introduction of each new information technology. At first artists feel they need to be literal, to protect their audience from the sheer strangeness of our new mode of expression. But then at some point they learn to relax into it, to see the places where an audience is able to embrace an abstraction, a sort of short-hand.

TV shows in the last decade have become thoroughly post-modern, with meta-dialog in which the writers gleefully speak directly to the audience through the mouths of their characters. In the midst of an otherwise realistic love scene or conflict, a character will suddenly describe their motivation, or the dramatic irony of the show’s set-up.

This is but one of many examples. The vignette, that soft fuzzy transitional layer around the edges that attempts to distract us from the fact that we are watching a fiction, is no longer necessary. Audiences are now used to seeing characters severed in half at odd moments, their spoken thoughts and expressed emotions suddenly sailing out of the frame of the story.

I suspect, as computer-mediated character driven interactive narrative starts to come into its own in the next ten years, that we will see more kinds of vignetting obsoleted, as player/observers of these emerging media learn how to jump in and out of the frame, in their enjoyment of these new fictional worlds to come.

Attic, part 6

Mr. Symarian was in his office when they went to see him the next morning at study period. He seemed so small sitting behind that big desk. Nobody really knew how old he was — he just seemed to have always been part of the school.

Jenny and Josh stood in the door for a while, just watching the light reflecting off Mr. Symarian’s bald head as he pored over what looked like the biggest book they’d ever seen. He seemed so absorbed in what he was reading, and neither of them wanted to disturb him when he was working.

Suddenly he looked up at them, and then smiled a broad smile. “Children, do come in! Have some chocolates.” He pointed expansively to a dish containing assorted bonbons. Mr. Symarian’s desk was always a reliable source of chocolate.

“Um, I don’t think we’re children,” Jenny said.

“Speak for yourself,” Josh cut in, grabbing a fistful of the chocolates.

Mr. Symarian leaned back in his chair and regarded them with amusement. “You two look so serious, like you’re on a mission.”

“You could say that,” Jenny began, holding out the scroll.

Suddenly Mr. Symarian became very serious. “No, it can’t be!” he said. “It’s been years …. Where did you get this, child?”

This time Jenny knew better than to correct him. “It’s a long story, but the important thing is that it’s got stuff written on it that we can’t understand.”

“No, you wouldn’t,” he replied. “It’s in the Old Tongue. Very few are left who know the old ways. Can you tell me where you found it?”

“Are you saying we stole it?” Josh said, forgetting all about the piece of half-eaten chocolate in his hand.

“Oh no, not at all. You might even think you did, but you couldn’t have. The fact that you are holding this scroll means that you were supposed to have it. It is what was meant to happen.”

“Mr. Symarian, I’m sure that made perfect sense,” Jenny said, “but I have no idea what you just said.”

He looked at her blankly for a moment, and then he laughed. “No, you wouldn’t, would you? It doesn’t matter. I imagine you came to me to translate the thing. Is that about right?”

“Oh yes, that would be great!” Jenny said. “Could you really?”

Josh nodded in enthusiastic agreement. He would have said something, but he was just finishing off the last of the chocolate, and his mouth was full.

“I can do even better than that,” Mr. Symarian said. “Shall we begin?”

Jenny handed him the scroll. Their teacher unfurled it and placed it carefully on the desk, as though handling a thing of great rarity. Then, to their surprise, he started to read the strange foreign sounding words out loud.