Logopolis ( TV story ) Logopolis was the seventh and final story of Season 18 of " Doctor Who " . It was Tom Baker ' s last story as the Fourth Doctor and introduced Peter Davison in the role as the Fifth Doctor , at the very end of the story . It also introduced an interim version of the Doctor known as the Watcher , whose sudden presence foreshadowed the regeneration of the Doctor . What triggered the Watcher ' s creation , however , was not fully explained , but writer Christopher H . Bidmead suggested that as multiple incarnations of the Doctor existed , it would be possible that a future , transitional version of himself could travel back in time to watch events unfold . ( DOC : " A New Body at Last " ) " Logopolis " also marked the first appearance of Janet Fielding as new companion Tegan Jovanka . After being introduced in the previous serial , Nyssa , played by Sarah Sutton , began her travels with the Doctor here . It additionally introduced a recurring element in the TARDIS ' Cloister Bell . This was also Anthony Ainley ' s first full story as . Synopsis . The Doctor goes to Logopolis to repair the TARDIS ' chameleon circuit , not knowing that a shadowy watcher is spying on him . Meanwhile , his old enemy the Master has only recently gained secure longevity by possessing the body of Tremas , and revels in his safety . He has plans of his own for the planet of mathematicians , Logopolis , and a plan that could spell doom for the entire universe . The Master ' s plan could rock Logopolis , the keystone of all life . Could this mean the unravelling of the causal nexus and the end of the universe itself ? The Doctor must pit his wits against the Master in a desperate battle to thwart his plans . But he is aware that this might be a fight which could easily spell the end of his life . Plot . Part one . A policeman is talking from the telephone of a police box , as a TARDIS materialises around it in disguise . Suddenly , the phone goes dead , the door opens , the policeman is dragged struggling inside and there is an evil chuckle . Meanwhile , the Fourth Doctor is pacing around the TARDIS Cloister Room , pondering 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 . The sound of the Cloister Bell is a sign of impending universal catastrophe . To divert himself , the Doctor decides to repair the TARDIS ' chameleon circuit , which has frozen it into the shape of a police box . To do this , he intends to materialise the TARDIS around a real police box , and then obtain its precise measurements in thirty - seven 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 . The car breaks down and 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 . The Doctor , telling Adric to wait behind , finds himself outside the box . He meets police officers , led by a Detective Inspector , who have found the shrunken , dead bodies of Tegan ' s aunt and the other policeman . The Doctor realises that the Master has escaped from the planet Traken and must be somewhere nearby . Part two . The police think the Doctor has caused the incident , but Adric creates a distraction with the policeman ' s bicycle he has found . This 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 small jetty instead . The mysterious stranger appears here too . He beckons to the Doctor , telling him to go to Logopolis . As the TARDIS arrives on Logopolis , Tegan finds her way to the control room , annoyed . She asks where her aunt is . The Doctor , realising that Tegan ' s aunt was the dead woman in the car , evades the question . Once they exit the TARDIS , the Doctor asks the Logopolitan leader , the Monitor , for his help . The Logopolitan s are able to model reality by pure mathematics and whatever they calculate can take physical form . Since block transfer computations cannot be calculated by machines or computers , the Logopolitans speak aloud a line of calculations and pass the results on . Unknown to the group , the Master has arrived on Logopolis and killed several Logopolitans . This disrupts the calculations for the TARDIS . When the Logopolitans produce the requested computation , the Doctor tries it on the TARDIS . It shrinks to half its normal size and causes strange effects inside the ship . Part three . The Logopolitans try to stabilise the TARDIS . They use sonic projectors to produce 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 . Fixing the error this has caused , they bring the new computation to the TARDIS . Tegan holds the notes up to the TARDIS so the Doctor can read them through the scanner and correct the fault . The Doctor emerges from the restored TARDIS and tells Tegan that her aunt is dead . Meanwhile , Nyssa finds the Master , whom she believes is her father as he is inhabiting Tremas ' s body . The Master gives her a bracelet ; it 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 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 ) . He demands the Monitor tell him the true purpose of Logopolis . The Doctor arrives with Adric and Nyssa . Adric deactivates the Master ' s device , but Nyssa , who is controlled by the Master , attempts 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 . He attempts to demonstrate this assertion by deactivating the suppression device . The silence persists . The calculations do not resume . They go outside , and find all the Logopolitans dead , crumbling to dust , and the city collapsing . The Master thinks this is a 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 it falls apart as local decay increases . The Monitor explains the situation : the universe has long ago passed the point of heat death . To stave off final collapse , the Logopolitans have been modelling temporary Charged Vacuum Emboitment s , like the one through which the TARDIS was previously transported into E - Space . The excess entropy generated by the universe had been passing through the CVEs to other universes . The Master ' s interference has closed the CVEs and the universe is now dying at last . The Doctor realises he has no choice . To save the universe , he has to work with the Master . He orders his companions into the TARDIS . When they argue about him working with the Master , the Doctor points out that he never chose to travel with any of them ; Adric came aboard as a stowaway , Tegan ' s curiosity brought her into the Doctor ' s life and Nyssa came to him asking for help finding her father . With that , the three return to the TARDIS . The Master holds out his hand to the Doctor on their agreement to work together . " One last hope , " says the Doctor and they shake hands . Part four . Adric , Nyssa and Tegan enter the TARDIS . The Doctor has the Watcher take it out of space / time . However , Tegan refuses to cooperate and follows the Doctor , Master and Monitor back to the Logopolis control room . The Monitor reveals that they had been completing a program to make the CVEs permanent . He prepares to use it on one of the surviving CVEs , but entropy takes hold of him . 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 Lord s 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 to realign the dish . The Doctor ' s companion s distract the guards and the two Time Lords go 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 . On 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 peoples 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 . Realising that the Master has control of the CVE " only while that cable holds " the Doctor climbs onto the radio telescope ' s gantry to disconnect the power cable and the Master tries to prevent him by tilting the dish . The Doctor disconnects the cable , but falls off the tilted gantry . As he hangs onto the disconnected cable , visions of old enemies mock him : the decaying Master , a Dalek , the Captain , the Cyber - Leader , Davros , a Sontaran , a Zygon and the Black Guardian . Losing his grip , the Doctor plummets to the ground . The Master enters his own TARDIS , dematerialising before the Pharos Project guards reach the control room . The Doctor ' s companions run to where he has fallen . Dying , the Doctor sees visions of the companions that have accompanied his current incarnation on his travels : Sarah Jane Smith , Harry Sullivan , Brigadier Alistair Gordon Lethbridge - Stewart , Leela , K9 and Romana ' s first and second incarnations . Smiling , he looks up at his companions who has gathered at his side and says , " It ' s the end . . . but the moment has been prepared for . " They turn to see the Watcher approach , and Nyssa realises that " he was the Doctor all the time . " As the companions look on , the Watcher merges with the dying Doctor , triggering his fourth regeneration . Moments later the Fifth Doctor sits up , beaming with a delighted grin . Story notes . Closing credits . At the end of part four : Home video and audio releases . DVD releases . This story was released on DVD as part of the New Beginnings box set , alongside " The Keeper of Traken " and " Castrovalva " . Special features include :