Tuesday, March 27, 2012

The Literal Genie

Or if you prefer the evil or really stupid genie.

In his book 2010 book Hacking: The Art of Exploitation, 2nd Edition, author Jon Erickson describes an analogy/joke of a genie to a computer. The genie free from his bottle offers the man who set him free three wishes:

"First," says the man, "I want a billion dollars."

The genie snaps his fingers and a briefcase full of money materializes out of thin air.

The man is wide eyed in amazement and continues, "Next, I want a Ferrari."

The genie snaps his fingers and a Ferrari appears from a puff of smoke.

The man continues, "Finally, I want to be irresistible to women."

The genie snaps his fingers and the man turns into a box of chocolates.

The analogy isn’t bad except it wasn’t a complete analogy.

First, the man said he wanted a billion dollars but not in a briefcase. Therefore if the genie was a computer program, the genie would just materialize the money by itself.

Next is the Ferrari. That’s fine except since the man did not stipulate where to put the Ferrari, the Ferrari could have landed on top of the man for all we know. So, could have the money. That could have been the default location for any wish.

Last is the “irresistible” wish. He could also been turned into a bunch of diamonds. Or even some handsome actor. The response could be random.

Then again instead of having a default for each wish the genie could ask the wisher to be more specific.

The genie is also assuming all the first two objects the man wishes for are not toys.

No comments: