The Fourth Doctor is pacing around in the TARDIS Cloister Room, pondering thoughts of decay and entropy. As he and Adric prepare to leave, the large bell in the centre of the room begins to ring. This worries the Doctor, as the sound of the Cloister Bell is a sign of impending universal catastrophe.
To keep his mind off this, he decides to repair the TARDIS's chameleon circuit, which has frozen it into the shape of a police box. In order to do this, he intends to materialise the TARDIS around a real police box (thus disguising it), and then obtain its precise measurements in 37 dimensions. With these measurements, he will have the inhabitants of the planet Logopolis produce a mathematical calculation — a block transfer computation — to reset the circuit. However, the "police box" he materialises around is actually the TARDIS of the Master, who has survived their encounter on the planet Traken. When the Doctor materialises around the Master's TARDIS, a recursive loop of TARDISes within TARDISes is formed.
Meanwhile, an airline stewardess, Tegan Jovanka, is being driven to the airport by her Aunt Vanessa. After their car breaks down, Tegan decides to go to the "police box" for help, but finds herself lost in the TARDIS instead. The Doctor and Adric enter another police box in a duplicate TARDIS, but the Doctor, telling Adric to wait behind finds himself this time outside the box. He meets a number of policemen, who find the shrunken, dead bodies of Tegan's aunt and another policeman.
The police think the Doctor has something to do with it, but Adric creates a distraction, and allows the Doctor to escape. In the distance, a mysterious white-clad stranger watches the proceedings. Realising that the shrunken bodies are the trademark of the Master, the Doctor decides to materialise the TARDIS underwater, to literally flush him out. The Doctor misses the River Thames, however, and lands on a boat instead. The mysterious stranger appears here too, and beckons to the Doctor, telling him to go to Logopolis.
As the TARDIS arrives at Logopolis, Tegan finds her way to the control room, somewhat annoyed. She asks to know where her aunt is, and the Doctor, realising that she was the dead woman in the car, skirts the question. Once they exit the TARDIS, the Doctor asks the Logopolitan leader, the Monitor, for his help. The Logopolitans are able to model reality by pure mathematics — whatever they calculate can take physical form. However, block transfer computations cannot be calculated by machines, so to perform them, the Logopolitans do not use computers. Instead, they use a large physical array of Logopolitans, each muttering a line of calculations out loud and passing them on to the next.
However, unknown to the group, the Master has arrived on Logopolis, and has killed several Logopolitans, which disrupts the calculations for the TARDIS. When the Logopolitans produce the required computation and the Doctor attempts to enter it into the TARDIS, it instead shrinks the TARDIS to half its normal size and causes strange effects inside the ship.
The Logopolitans try to stabilise the TARDIS using sonic projectors to project a stasis field while the Monitor and Adric attempt to uncover the fault. Meanwhile, Nyssa has been brought from Traken by the Watcher, the mysterious white figure the Doctor spoke with. She is searching for her father. The Monitor and Adric work through the city and discover the shrunken bodies of three Logopolitans. Correcting the error this has caused, they bring the new computation to the TARDIS. Tegan holds the notes up to the TARDIS so the Doctor is able to read them through the scanner and correct the fault. The Doctor emerges from the now restored TARDIS, and admits to Tegan that her aunt is dead. Meanwhile, Nyssa finds the Master, whom she believes to be her father as he is inhabiting Tremas's body. The Master gives her a bracelet, which is actually a device which will allow him to control her actions.
The Master attaches a device to the sonic projectors and sets up a counterwave that brings silence to the Central Registry, preventing the Registers from making their calculations. He then goes to the Registry's control room (a replica of the Pharos Project on Earth, a radio telescope tasked to seek out signs of extraterrestrial life), and demands that the Monitor tell him what the true purpose of Logopolis is. The Doctor arrives with Adric and Nyssa, and Adric deactivates the Master's device, only for the Master to have Nyssa attempt to throttle him. Tegan restores the device, and the Master repeats his demand. The Monitor warns the Master that bringing Logopolis to a halt will cause universal disaster, but the Master replies that it is only a temporary effect, which he attempts to demonstrate by deactivating the suppression device.
However, the silence persists and the calculations do not resume. They go outside, and find all the Logopolitans dead, crumbling to dust, and the city itself collapsing. The Master thinks this is some sort of trick and tries to have Nyssa strangle the Monitor, but the control device ceases to function. He tries to increase the device's power, but this causes it to fall apart as local decay increases. The Monitor explains the situation: the universe had long ago passed the point of heat death. To stave off final collapse, the Logopolitans had been modelling a number of temporary Charged Vacuum Emboitments, like the one through which the TARDIS had been previously transported into E-Space. The excess entropy generated by the universe had been passing through the CVEs to other universes. However, The Master's interference has caused the CVEs to close and the universe is now dying at last. Realising that he has no other option, the Doctor orders his companions into the TARDIS, and agrees that he and the Master must work together if they are to prevent the universe's destruction.
As soon as the Doctor and Master walk away from the TARDIS, Tegan sneaks out and follows the Doctor, Master and Monitor back to the Logopolis control room. In the meantime, the Watcher takes the TARDIS, carrying Adric and Nyssa, out of spacetime. The Monitor reveals that they had been completing a program to make the CVEs permanent, and prepares to use it on one of the surviving CVEs, but entropy takes hold of him and he disintegrates before their eyes. The Doctor dismantles the computer and realises the program is stored in bubble memory that they can use with the real Pharos Project. The Doctor, Master and Tegan escape from Logopolis in the Master's TARDIS.
Adric and Nyssa watch helplessly in the Doctor's TARDIS as a portion of the universe is wiped out by encroaching entropy — including Traken. On Earth, the two Time Lords reconfigure the Logopolitan program and feed it into the Project's computers, but the Master points out that the transmitter is pointed away from the last surviving CVE. After speaking with the Watcher, Adric brings the Doctor's TARDIS to Earth as the Doctor and the Master run on foot to realign the dish. The Doctor's companions distract the guards and the two Time Lords get to the dish's control room, hooking up a light speed overdrive from the Master's TARDIS to ensure the signal gets to the CVE in time. Upon transmission of the program, the CVE begins stabilising.
The Master's co-operation with the Doctor has been a ploy, however. Holding the Doctor at gunpoint with his Tissue Compression Eliminator, he transmits a message to the people of the universe, saying that if they do not acknowledge his rule, he will send a signal to close the CVE and restart the collapse. The Doctor climbs onto the radio telescope's gantry to disconnect the power cable, and the Master attempts to prevent him by tilting the dish 90 degrees. The Doctor succeeds in disconnecting the cable, but falls off the gantry. As he hangs on to the disconnected cable, visions of old enemies mock him. Losing his grip, the Doctor plummets to the ground. The Master enters his own TARDIS and it dematerialises.
The Doctor's companions run to the spot where he has fallen. Dying, the Doctor experiences visions of the companions that have accompanied his current form and observes, "It's the end... but the moment has been prepared for." They turn to see the Watcher approach, and as he does so he merges with the Doctor. Nyssa realises that the Watcher was the future Doctor all the time. As the companions look on, the Fourth Doctor regenerates into a new, younger body — the Fifth Doctor.
Doctor Tom Baker (Fourth Doctor)
Peter Davison (Fifth Doctor)
Companions Matthew Waterhouse (Adric)
Sarah Sutton (Nyssa)
Janet Fielding (Tegan Jovanka)
Anthony Ainley — The Master
Dolore Whiteman — Aunt Vanessa
John Fraser — The Monitor
Tom Georgeson — Detective Inspector
Christopher Hurst — Security Guard
Adrian Gibbs - The Watcher
Writer Christopher H. Bidmead
Director Peter Grimwade
Script editor Christopher H. Bidmead
Producer John Nathan-Turner
Executive producer(s) Barry Letts
Production code 5V
Series Season 18
Length 4 episodes, 25 minutes each
Originally broadcast February 28–March 21, 1981