If you’ve ever played the electronic version of the game 20 Questions, either the hand-held game or online, you probably had a question of your own: “How does it do that?”

If you haven’t played, 20Q is a game in which a player thinks of a person, place or thing, then another player asks up to 20 yes-or-no questions before trying to guess what the player is thinking of. In the electronic versions of the game, a computer asks the questions and guesses the answer, usually correctly.

The computer does this using a type of technology called artificial intelligence, which, very simply, gives it the ability to think like a human. That doesn’t mean it thinks of popsicles on a hot day, of course. But a computer using artificial intelligence can answer questions based not only on information it has been given but also on mistakes it has made in the past.

“Every time somebody plays, [20Q] learns from the answers that [players] give,” explained Eric Levin, president of Techno Source, which is introducing a new, smarter version of the 20Q game this summer.

So, unlike a calculator, which does specific math calculations that have only one answer, artificial intelligence figures things out from experience. The more it works, the smarter it gets — just like you.

A good example, Levin said, would be if a 20Q player thought of a dolphin. The game might ask the player if he was thinking of a fish. The answer should be “no,” because a dolphin is a mammal. But some players might accidentally say “yes.”

If that happens, the 20Q program figures out that the player made a mistake and that the answer probably still is a dolphin.

Artificial-intelligence technology has become very sophisticated and has many applications. Google uses it to figure out what you’re looking for on the Internet. Amazon uses it to suggest other products you might like to buy, based on ones you’ve bought or looked at. Recently a computer called Watson, which is based on artificial-intelligence technology, won a Jeopardy tournament against the game show’s two best players. And many companies now use the technology to create computer programs that can answer the phone and “talk” to real people.

“When I call the phone company, I don’t get a person on the line — it’s a computerized system, and I can almost say anything I want and it will respond in a reasonable manner,” said Robin Burgener, who created the electronic 20Q game in the 1980s. “Most of the time, if it’s done properly, you don’t even know that it’s there.”

But Levin, being a human who learns from experience, knows that 20Q is more fun because it’s right only about 85 percent of the time. After all, who wants to play an opponent that always wins? “Kids like beating it,” he said.

— Margaret Webb Pressler