Earlier, he commanded: "Beam me up." This time, the iPhone responded: "Sorry, Captain, your tricorder is in Airplane Mode."

The real science of artificial intelligence is finally catching up to science fiction. HAL 9000, the creepy sentient computer from the movie "2001: A Space Odyssey," has been incarnated, in the form of Siri, a virtual personal assistant that comes with Apple's new iPhone 4S, which arrived in stores Friday.

How Smart Is Siri?

See how Siri reponds to some stumpers.

Screen capture by Matt Legend Gemmell

The phone takes verbal commands and questions, and responds with computer-generated speech.

Real humans are responding to this alarming breakthrough by asking their iPhones ridiculous questions.

The good news is, Siri has a sense of humor.

Micah Gantman, the director of mobile business at software firm HasOffers.com in Seattle, asked his iPhone: "How much wood would a woodchuck chuck if a woodchuck could chuck wood?" It answered: "Depends if you're talking about African or European wood."

Nicky Kelly, a 40-year-old from Suffolk, U.K., asked her iPhone: "Tell me a joke." It answered: "Two iPhones walk into a bar...I forget the rest."

There are already websites to collect some of Siri's best material, including one called "S— That Siri Says." Some of the responses appear to be pre-programmed.

It's what's inside that counts - such is true in the case of the new iPhone, the iPhone 4S. Should you upgrade? Walt Mossberg gives his assessment and tests the personal assistant feature, Siri, live on today's special edition of Digits.

Google Inc. is in on the AI joke, too, with its smartphone and search technology. After 13 years of research, some of the world's smartest engineers have created algorithms able to answer questions such as "What's that movie that's backwards and the guy can't remember anything?" (Answer: "Memento.")

Hold a Google Android phone up to your mouth and ask "What's the answer to life, the universe, and everything?" It will answer, in text on the screen, "42," a reference to the favorite geek book "The Hitchhiker's Guide to the Galaxy."

The creators of Siri put "deep thought" into the personality of their software, says Norman Winarsky, a co-founder of the company that was bought by Apple for $200 million in 2010. Siri was born out of an artificial intelligence project at SRI International, a research institute.

Siri has two distinct systems at its heart. One listens and translates what customers are saying, the other interprets the meaning behind the request and responds. It's in that last part where the sass comes in.

"There were many conversations within the team about whether it should be gender neutral" or "should have an 'attitude,' " said Mr. Winarsky, who didn't go to Apple, and still works at SRI. The result, before the software was bought by Apple, was "occasionally a light attitude," he said.

More

When Apple began integrating Siri into the iPhone, the team focused on keeping its personality friendly and humble—but also with an edge, according to a person who worked at Apple on the project. As Apple's engineers worked on the software, they were often thinking, "How would we want a person to respond?" this person said.

The Siri group, one of the largest software teams at Apple, fine-tuned Siri's responses in an attempt to forge an emotional tie with its customers. To that end, Siri regularly uses a customer's nickname in responses, as well as those of other important people and places in his or her life. "We thought of it almost as a person on the phone," this person said.

An Apple spokeswoman declined to answer questions about how Siri works. It uses different voices in each of its available markets: female in the U.S., Australia and Germany, and male in the U.K. and France.

Some of the Siri's jokes were apparently built by geeks, for geeks. Aral Balkan, a U.K.-based software designer and self-described "Renaissance Geek" asked Siri: "Do you know Eliza?"—a reference to ELIZA, one of the first experiments in natural language processing by computers, created at Massachusetts Institute of Technology in the 1960s. Siri's response: "Do you know Eliza? She was my first teacher!"

Ask the iPhone to "Open the pod bay doors"—a reference to the movie "2001"—and some users say it answers back in a frighteningly slow voice, reminiscent of HAL 9000, the computer that leaves an astronaut to die in space. "I'm afraid I can't do that," says Siri.

Sometimes she punctuates that answer with, "We intelligent agents will never live that down, apparently."

What makes the current crop of artificial intelligence services so fun isn't just that they can parrot back answers to prescribed questions. Computers have done that for years, including a 2004 website called "The Subservient Chicken," which featured a video of a man in chicken costume who would appear to do whatever a user would type into a box on a website. (Behind the scenes, software recognized more than 400 commands for which it could play video snippets, including "build a fort" and "walk like an Egyptian.")

Apple's advances in artificial intelligence can carry on limited conversations about ridiculous topics. Tell Siri "I need to hide a body," and it asks "What kind of place are you looking for?" and lists a number of options, including mines and swamps.

Understanding the quirkier fascinations of the human mind is the next frontier for artificial intelligence, said Henry Lieberman, a principal research scientist at MIT's Media Lab. For the past 12 years, his lab has been gathering "common sense" human knowledge, and putting it into a database. So far, it has one million entries. The average human understands about 100 million different "common sense" ideas.

That database, which is being built by volunteers online, has as much personality and humor as the people who contribute to it, he said. Already, it is over-weighted in entries on topics such as kittens. "We have a lot of knowledge about trees, not so much about aardvarks," he said.

Siri, too, doesn't have the answer to everything.

Paul Johnson, a photographer from Lynn Haven, Fla. asked it: "What's the meaning of life?" Siri's answer: "That's easy....It's a philosophical question concerning the purpose and significance of life or existence in general."

Other users have gotten a different response. When blogger Joshua Topolsky asked Siri about the meaning of life, it said: "I can't answer that now, but give me some time to write a very long play in which nothing happens."

This copy is for your personal, non-commercial use only. Distribution and use of this material are governed by our Subscriber Agreement and by copyright law. For non-personal use or to order multiple copies, please contact Dow Jones Reprints at 1-800-843-0008 or visit www.djreprints.com.