Warning: Wikipedia contains spoilers.
The answer to the Ultimate Question of Life, the Universe and Everything, as given by the supercomputer Deep Thought to a group of mice in Douglas Adams's comic science fiction series The Hitchhiker's Guide to the Galaxy, is "42". According to the Guide, mice are 3-dimensional profiles of a pan-dimensional, hyper-intelligent race of beings. They built Deep Thought, the second greatest computer of all time and space, to tell them the answer to the question of life, the universe and everything. After seven and a half million years the computer divulges the answer: 42.
Already booked for a round of talk-show appearances to reveal the Question, the mice become desperate to discover it. During a meeting with Arthur Dent and his companions on the planet Magrathea, Frankie and Benjy mouse reveal a plan to extract the ultimate question from Arthur's brain. Since this involves removing and dicing his brain, Arthur is unwilling to go along with the plan. He manages to escape from them unscathed.
Lacking a real answer, the mice proposed to use "How many roads must a man walk down?" as the question for talk-shows (having rejected the question, "What's yellow and dangerous?" - actually a riddle whose answer, not given by Adams, is "Shark-infested custard").
At the end of the book The Restaurant at the End of the Universe (volume 2 of the Hitchhiker's trilogy), Arthur Dent (as the last human to have left the Earth before its destruction, and therefore the portion of the computer matrix most likely to hold the question) attempts to discover the Question by extracting it from his unconscious mind, through pulling Scrabble letters at random out of a sack. The result is the sentence "WHAT DO YOU GET IF YOU MULTIPLY SIX BY NINE".
However, it was later pointed out that 6 x 9 = 42 if the calculations are performed in base 13, not base 10. Douglas Adams was not aware of this at the time, and has denied that base 13 has anything to do with it.
In the original radio series, this scene occurs at the end of the first series (Fit the Sixth). On discovering the question, Arthur Dent remarks "I always said there was something fundamentally wrong with the universe.".
"42" is often used in the same vein as a metasyntactic variable; 42 is often used in testing programs as a common initializer for integer variables.
Google has recently added a calculator function to its search engine, which contains a formula for the question answer to life the universe and everything.
There is a joke amongst computer programmers that Deep Thought may have had some order of operations issues. The following code in the programming language C defines the macros SIX as "1 + 5" and NINE as "8 + 1", and then performs the computation "SIX * NINE". It returns the answer "42", because "SIX * NINE" is expanded by the computer to "1 + 5 * 8 + 1", and the multiplication takes precedence over the additions. (A macro is not a variable.)
#define SIX 1 + 5
#define NINE 8 + 1
int main()
{
printf( "The meaning of life: %d\\n", SIX * NINE );
return( 0 );
}
Computer programmers' joke
#include
See also: Meaning of life
External links