"The Ultimate Computer" is the twenty-fourth episode of the second season of the American science fiction television series Star Trek. Written by D.C. Fontana (based on a story by Laurence N. Wolfe) and directed by John Meredyth Lucas, it was first broadcast on March 8, 1968. In the episode, the crew of the Enterprise race to disable a rogue computer in total control of the ship. Plot The Federation starship Enterprise is summoned to a space station without explanation. Commodore Wesley (Barry Russo) explains that the Enterprise will be a test vessel for the M-5 Multitronic System, a revolutionary tactical and control computer designed by Dr. Richard Daystrom (William Marshall). The M-5 is to handle all ship functions without human assistance. While Science Officer Spock is impressed with M-5, Captain Kirk and Chief Medical Officer Dr. McCoy have doubts. The M-5 succeeds at its first tasks, performing ship functions more quickly and efficiently than a living crew. However, M-5 also exhibits unexpected behavior, such as turning off power and life support to unoccupied parts of the ship, and drawing increased power for unknown reasons; Daystrom maintains M-5 is working properly. In its first tactical drill, M-5 defends the Enterprise against mock attacks from Starships Excalibur and Lexington. The Enterprise is declared the victor, and Wesley jokingly refers to Kirk as "Captain Dunsel", employing a Starfleet Academy slang term for a part serving no useful purpose. Kirk is troubled by this. Some time later, M-5 detects the Woden, an unmanned freighter, and attacks with live torpedoes, destroying it. Kirk orders M-5 taken offline, but on attempting to do so, finds it protected by a powerful force field. Chief Engineer Scott orders Ensign Harper to disconnect its power source, but the M-5 creates a direct connection to the ship's warp engines, vaporizing Harper in the process. Spock and Scott attempt a manual override, but discover that the M-5 has rerouted all controls. Spock questions Daystrom on his computer design, and Daystrom reveals that he has imprinted human engrams onto M-5's circuits, creating what amounts to a human mind operating at the speed of a computer. Meanwhile, four of Enterprise'''s sister ships, Lexington, Potemkin, Excalibur, and Hood, approach to begin a new tactical drill. Since M-5 has disabled communications, Kirk is unable to warn M-5's targets. M-5 detects the ships, and attacks them with full-strength weapons. The crew watches helplessly as the Enterprise