A classic documentary hosted by Orson Welles about Nostradamus and his predictions for the future, including one concerning World War III, causes Mr. Burns to become alarmed for the future of Springfield. With Smithers' help, he convenes a meeting of the local chapter of Mensa International to ask their advice on constructing a "Doomsday Ark," intended to save the city's most valuable individuals. The Mensa members suggest that everyone be given an IQ test to choose the passengers, but Professor Frink interrupts to recommend an alternative test he has devised that can measure people's "Personal Value Quotient" (PVQ) on a scale of 1 to 500. The test is made mandatory for all residents.
Six weeks later, the results are reported during a news broadcast. Lisa scores 475, but is shocked to learn that Ralph Wiggum has bested her by one point. Marge scores 311, Homer scores 265, while Bart has only scored 1. When Marge indignantly storms into Frink's office and insists that Bart is not worthless, Frink discovers that he inadvertently mixed up Bart's and Homer's test results due to Homer's terrible handwriting. People all over town begin to ridicule Homer for his low test score and take advantage of him, but Marge decides to help him better himself. She concentrates on Homer's penmanship, and he eventually improves to the point of being able to write her a romantic note in longhand. Marge is touched by the gesture and the fact that Homer has passed out from the effort of completing it. In reality, he is unconscious after drinking a bottle of bourbon.
After talking with Welles in a dream, Burns speeds up construction on the Ark and puts Homer, Lenny, and Carl to work on it. Lisa begins following Ralph around school and town to figure out why his PVQ is higher than hers, without success. They reach the Ark construction site, where Ralph repeatedly avoids severe injury through sheer luck. Frustrated, Lisa tells Frink of what she has seen. Frink adds ten points to her PVQ so that she will not reveal the flaws in his testing process.
Once the Ark is finished, Burns brings the PVQ test's top scorers on board and tells them that they will be his slaves. Annoyed at the deception, all of them leave through a hatch that has been left unlocked. Burns locks himself in and decides to pilot the Ark by himself. As Smithers winds up stranded outside, having left to fetch Burns' slippers, Burns ends up being strangled by one of the Ark's maintenance robots.