Final Exam, Fall 2000 (Morrisett)

See today's menu at the Restaurant at the End of the Universe!

The Vogon Demolition Queue

"People of Earth, your attention please. This is Prostetnic Vogon Jeltz of the Galactic Hyperspace Planning Council. As you will no doubt be aware, the plans for development of the outlying regions of the galaxy require the building of a hyperspatial express route through your star system, and regrettably your planet is one of those scheduled for demolition. The process will take slightly less than two of your Earth minutes. Thank you."

Prostetnic Vogon Jeltz placed the microphone back on the stand, satisfied with himself.

"Um, Sir, the demolition queue broke" said a somewhat smaller, somewhat less blubbery, but still nonetheless disgusting, Vogon.

"The demolition queue."

"Um, yes, that would be right. Yes. The demolition queue."

"Broken?!"

The smaller Vogon answered meekly.

"Well, get on with it! I didn't become captain of a Vogon Construction Ship so that I might be thrown off schedule by a broken demolitions queue! So fix it! And remember to do it in constant time, or I might read you some of my poetry!"

HELP THE VOGON IMPLEMENT THE QUEUE, because, well, Prostetnic Vogon Jeltz asked you nicely, and, well, destroying the Earth would provide a jolly good bit of fun after tea and crumpets. Besides, you really don't want to hear his poetry. Trust me.

Beauty and the Beholder

The Restaurant at the End of the Universe is one of the most extraordinary ventures in the entire history of catering. For one, the dinner show is the dinner show to end all dinner shows, in a very literal sense. The décor is also expensive. In the center sits a gigantic golden dome, almost a complete globe. At least five tons of glitter alone had gone into it, and covered every available surface. The other surfaces were not available because they were already encrusted with jewels, precious seashells from Santraginus, gold leaf, mosaic tiles, lizard skins, and a million unidentifiable embellishments and decorations.

The tables were fanned out in a large circle around a central stage area where a small band was playing light music, and interspersed among them were swaying palms, hissing fountains, grotesque statuary, in short, all the paraphernalia common to all restaurants where little expense has been spared to give the impression that no expense has been spared.

It was not, however, elegant. Gaudy, perhaps, or cliche. But not elegant.

Neither are the following code examples...

The Force of Illogic

The people of Quarnus Quogrun Quimble Quid IV are known throughout the galaxy for their advanced art, literature, philosophy, music, science, cuisine, implements of personal hygiene, rotary telephones, and beach towels. Throughout their long history, they have always been held in the highest renown throughout the galaxy, except by the Vogons, who, on account of the Quarnus Quogrun Quimble Quidian's superficial resemblance to the scintillating jeweled scuttling crabs of Vogsphere, would often sweep them up in droves and while away a happy drunken night smashing them to bits with iron mallets, whereupon they would discover that their catch was not actually, in fact, bejeweled or even scintillating, and would promptly turn the iron mallets on each other in disgust. While unfortunate for the Quarnus Quogrun Quimble Quidians who were caught in the fray, the rest of the galaxy typically approved of Vogons using large iron mallets on each other. The revenue from the galactic hypervision pay per view broadcasts of such occasions typically went back to Quarnus Quogrun Quimble Quid IV to support the bereaved families of the victims.

But we digress.

The most useless observation a typical traveler notes of Quarnus Quogrun Quimble Quid IV is that all cats have nine tails. These cats, of course, are identical to the cats everywhere else in the galaxy, which all have one tail. Notwithstanding, the Quarnus Quogrun Quimble Quidians are superb logicians, and on their home planet cats have nine tails by sheer force of logic.

The argument goes like this:

All cats have one more tail than no cats.

No cat has eight tails.

Therefore, all cats have one more tail than no cats, namely, nine tails.

What the Quarnus Quogrun Quimble Quidians do with their cat o' nine tails is their own business. The galactic community speculates that they become mathematicians, and proceed to prove that zero equals one, by the same force of logic that gave them their existence.

You, however, should not follow the Quarnus Quogrun Quimble Quidians in solving the classic problem below. Unless you wish to be mistaken for a scintillating jeweled crab, and smashed to little bits by drunken Vogons.

Life, the Universe, and Everything

There are, of course, many problems connected with life, of which some of the most popular are "Why are people born?" "Why do they die" "Why would they want to sign up for Computer Science 312?"

Many many millions of years ago a race of hyperintelligent pandimensional beings got so fed up with the constant bickering about the meaning of life which used to interrupt their favorite pastime of Brockian Ultra Cricket that they decided to sit down and solve their problems once and for all.

And to this end they built themselves a stupendous supercomputer which was so amazingly intelligent that even before its data banks had been connected up it had started from "I think, therefore I am" and got as far as deducing the existence of rice pudding and income tax before anyone managed to turn it off.

It was the size of a small city.

It computed for seven million years the question "What is the meaning of life?"

It would have finished faster, except the programmer didn't understand the lectures about asymptotic runtime from CS312. This was considered a Feature, since it allowed the cooling systems to brew far more pots of coffee for thirsty programmers than otherwise possible.

After seven million years, the computer found the answer.

It declared, with infinite calm and majesty, that the answer was 42.

This, of course, begs the question, what is the question?

So, several hundred thousand disgruntled, rather unhappy seven million year old hyperintelligent pandimensional beings pulled the hapless CS312 student from the cryogenic tubes, and demanded satisfaction.

You should probably help the poor student. Or not. The Universe could care less.

FIND EXPRESSIONS FOR ??? THAT WOULD CAUSE THE WHOLE EXPRESSION TO EVALUATE TO 42

Truth and Consequences

The Hitchhiker's Guide to the Galaxy is a very unevenly edited book and contains many passages that simply seemed to its editors like a good idea at that time.

It contains many statements that are true.

It also contains many statements that, while not wholly untrue, do stretch the boundaries of truth more than the rubber-based life forms of Yoog stretch when they engage in strenuous physical activity, including but not limited to martial arts, jogging, and watching Richard Simmons videos (which, in the more civilized parts of the galaxy, would be considered cruel and unusual punishment and cause for a major galactic war or two).

It also contains many statements that are patently untrue. For example, it is well known that Galactic President Zaphod Beeblebrox does not mix the best Pan-Galactic Gargle Blasters in the galaxy; the guy on "Cheers" does.

Most of the patently untrue statements are generally harmless, unless one chooses to use the Guide as an introductory computer science textbook. Which the University of Maximegalon did. This resulted in a whole class of students learning the correct solution to the Halting Problem and generally wreaking havoc anywhere they went in the software industry. One student wrote something called "Windows 98" as a practical joke, which was promptly sucked through an Infinite Improbability Vortex and deposited on an utterly insignificant little blue-green planet orbiting a small unregarded yellow sun far out in the uncharted backwaters of the unfashionable end of the Western Spiral Arm of the galaxy.

The inhabitants of this planet were not amused, however, and poured forth untold effort into improving their space program so that they may send out fleets of armed warships dealing electric death in the vast reaches of space to the civilization that brought forth such a monstrosity. Fortunately, the planet was wiped out to make way for an interstellar freeway before any serious harm could come of it.

The Computer Science Department at the University of Maximegalon would like to verify the following statements to avoid any such future misunderstandings.

True/False

The Running of the Times

The Restaurant at the End of the Universe depends, of course, on there actually being an end to the universe. The management does not wish to contemplate the possibility of thousands of lavishly dressed, incredibly rich, incredibly stuffed, incredibly miffed patrons storming the office demanding to know why they were still around after the universe was supposed to end.

This is becoming a matter of concern recently.

You see, for an outfit as lavish and as expensive as Milliways, the Restaurant at the End of the Universe, having the universe end late would be a disaster.

In the words of the Unknown Prophet Marcus the Perpetually Constipated, "Quidquid Latine dictum sit altum viditur."

The words of Marcus notwithstanding, the Management at Milliways conducted a periodic code audit (similar to a tax audit, only more painful) of the software controlling the restaurant's precarious temporal balance.

They discovered that, buried in millions of lines of code, that they needed someone to blame.

That person is you.

The Management has a few questions for you about crunching very large numbers, and how long it would take the computer (so they can decide whether to eat in, or carry out, from Mama Zhou's, the friendly Chinese takeout around the corner, which is notable for the cooking accident which got transported through a temporal anomaly created by Milliway's back to an insignificant little blue-green planet and promptly became the centerpiece of a long cultural tradition involving cookies that predicted the future)

Clean Your Garbage

The Hitchhiker's Guide to the Galaxy notes that Disaster Area, a plutonium rock band from the Gagrakacka Mind Zones, are generally held to be not only the loudest rock band in the galaxy, but in fact the loudest noise of any kind at all. Regular concertgoers judge that the best sound balance is usually heard from within large concrete bunkers some thirty-seven miles from the stage, while the musicians themselves play their instruments by remote control from within a heavily insulated spaceship which stays in orbit around the planet - or more frequently around a completely different planet.

Many worlds have now banned their act altogether, sometimes for artistic reasons, but most commonly because the band's public address system contravenes local strategic arms treaties.

But it wasn't the mind-bogglingly huge earnings that continually push the boundaries of hypermathematics or the use of their albums in interstellar warfare that was most interesting.

It was the garbage that gets left behind.

Disaster Area is not your typical band. In addition to your usual post-concert garbage of paper, soda cans, beer bottles, hot dog wrappers, leftover controlled substances, Bronze Age civilizations, and broken digital watches, Disaster Area fans leave behind loose pointers. Why anyone would bring such dogs to a concert escapes the superintelligent minds at the University of Flautulus (City of the Winds, a popular odorous resort for amorous lovers), at least until their planet spontaneously turned into a giant fruitcake.

Please clean up the garbage. Nobody enjoys chasing pointers.

Cricket Hash

The game of Brockian Ultra Cricket is quite a curious game that holds great popularity in the more densely inhabited spiral arm of the galaxy. The casual observer might remark that Brockian Ultra Cricket consisted mostly of suddenly hitting people for no apparent reason and then running away.

The casual observer would be completely correct.

The casual observer must not, however, assume the same depth of gameplay and strategy applies to the classic game of Brockian Ultra Backgammon.

Brockian Ultra Backgammon is played on a large board with a number of slots. On each turn, the players insult each others parentage, cultural heritage, choice of dental implement, and cuff links, followed by a deep bow (to show respect, of course). This would be followed by a gratuitous round of Sumo wrestling, and a few games of Brockian Ultra Cricket.

When the players finally return to the game, they each draw two straws from a bundle. These straws are thrown away and serve no further purpose in the game, except to feed the Purple Peter Eater under the game table. The current player then pulls out a key, and proceeds to fold, spindle, mutilate, file in triplicate, sign, countersign, munge, and generally hash the key beyond recognition.

The key is then used to drop a numbered Franklin Mint Collector Plate into one of the slots.

The winner is determined by a complicated process involving the phase of the moon and looking down the slots for certain plates. Ordinarily, looking down the slot on the game board for a certain plate does not take too long.

We have, however, negqlected to mention that the Brockians are an advanced non-corporeal life form consisting of pure energy strands light-years across, and that nobody enjoys doing a linear search across the better part of the galactic cluster.