The Enterprise tests a computer that, if successful, could replace Kirk as the captain.



The USS Enterprise is summoned to a space station without explanation. Commodore Bob Wesley, commanding officer of the USS Lexington, explains that the Enterprise will be a test vessel for a revolutionary tactical computer called the M-5 multitronic unit, designed by the brilliant Dr. Richard Daystrom. The M-5 will handle all ship functions without human assistance.

Act One

"Captain's log, stardate 4729.4. The M-5 computer has been installed on board ship, and we have left the space station for test maneuvers."

Dr. Richard Daystrom, who designed the computers used on the Enterprise, arrives on board to install his new M-5 computer, which is capable of running a starship without personnel. The system is to be tested in a war games exercise against four other starships, led by Commodore Wesley. Daystrom describes the M-5 as "a whole new approach" to logic systems; what he has done, in fact, is to create a computer that thinks like a person by impressing Human "engrams" – his own – onto the circuits. "The relays are not unlike the synapse in the brain," Daystrom explains to Captain Kirk. "M-5 thinks, captain."

Kirk, meanwhile, wrestles with his own unease about the advance in technology and his own possible obsolescence. Daystrom, on the other hand, defends the advance as liberating man from hazardous duties. Dr. McCoy notes that Daystrom reacts toward the computer as a father to his child.

The Enterprise, under M-5 control approaches a planet, achieves standard orbit and makes its recommendations for the landing party. Kirk is at odds with the M-5's call, and disagrees with its recommendation, which doesn't include Kirk and McCoy in the landing party, calling them "non-essential personnel." While this is going on, power on decks 4 and 5 is cut, along with environmental controls for each deck. Scotty traces the source of the power shutdowns to be the M-5 itself.

Act Two

Dr. Daystrom examines the situation, but explains that the M-5 simply turned off the power to those decks since there was no one there that needed it. Eventually, Dr McCoy arrives on the bridge, since the sick bay's power was also cut. He is understandably infuriated by this computer's actions.

The Enterprise is approached by two ships, one of which turns out to be the Federation starship USS Excalibur. They engage in an unscheduled wargames drill, and the M-5 responds swiftly to simulated attacks, hitting back the "enemy" ships and maneuvering more quickly than it would have were a human in command. Kirk tries to be gracious to the computer's ability, telling Spock that such applications might be practical, but Spock tells Kirk that although true, such a thing as a computer running a starship would be undesirable. He goes on to explain that a key attribute of Human command is loyalty, loyalty to one man, and that this should never change. Captain Kirk, whose ego has been somewhat beaten up by all that is going on, appreciates the comment. Meanwhile, the M-5 is seen to be drawing increasing amounts of power.

Afterward, Enterprise's sensors detect a ship moving slowly. It is the automated ore freighter Woden. M-5 abruptly changes the Enterprise's course to intercept the ship, speeding up to Warp 3. It then engages the ship with photon torpedoes, destroying it, though it gave no threat to the Enterprise, and then resumes its prior course. Captain Kirk tried to disengage the M-5 in the process, but neither he, nor Sulu, nor Scotty is able to regain manual control.

Act Three

Dr. Daystrom still tries to make excuses and explanations for this, but there is clearly now something wrong.

Kirk, Spock, and Scotty go to engineering, and Kirk tries to approach the M-5 to shut it off, only to be thrown back by a force field. They attempt again to cut its power, but when an engineering ensign with a power coupler moves to cut the power, the M-5 vaporizes him and makes a direct connection to the warp engines using a power beam of its own devising.

In setting up the programs, Daystrom also – unwittingly – instilled the urge for survival in the computer, to the point where the automated freighter Woden, encountered on the way to the war games coordinates, is perceived as a threat and destroyed. In addition, M-5 taps into the matter/antimatter reactors as a new power source, giving it virtually unlimited power with no one able to shut the computer down.

Act Four

When the war games exercise begins, M-5 attacks the opposing starships with all weapons at full power (destroying the Excalibur in the process), and cuts off all communication from Enterprise to the fleet. When Commodore Wesley cannot raise the Enterprise by radio, he requests approval from Starfleet Command to destroy her.

"Captain's log, stardate 4731.3. The M-5 multitronic unit has taken over total control of the Enterprise."

Dr. Daystrom attempts to reason with his M-5 in an effort to stop the attack, but goes mad in the effort. Kirk then forces the computer to recognize its responsibility in the deaths of hundreds of people. Feeling Daystrom's regret over the deaths, M-5 shuts down, dropping the deflector shields and leaving itself open to attack to atone for its crime. Spock and Scotty then disconnect the computer from ship's control. With communications not quite restored, Kirk orders that the shields be kept down, gambling that Wesley will be both compassionate and cautious and break off the battle force. Dr. Daystrom, meanwhile, is cared for in sickbay under sedation and heavy restraint to await transfer to a total rehabilitation facility.

Memorable Quotes

"There are certain things men must do to remain men."

- Kirk to Daystrom, after the M-5 is installed on the Enterprise

"Did you see the love light in Spock's eyes? The right computer finally came along."

- McCoy to Kirk, after they walk away from Spock and Daystrom

"Only a fool would stand in the way of progress."

- Kirk, on being replaced by the M-5

"We're all sorry for the other guy when he loses his job to a machine. When it comes to your job, that's different. And it always will be different."

- McCoy, on technological progress

"Computers make excellent and efficient servants, but I have no wish to serve under them. Captain, the starship also runs on loyalty to one man. And nothing can replace it, or him."

- Spock to Kirk, after the war games exercise

"Our compliments to the M-5 unit, and regards to Captain Dunsel. Wesley out."

- Wesley, comparing Kirk's role to a part which serves no useful purpose

"To Captain Dunsel."
"To James T. Kirk, Captain of the Enterprise."

- Kirk and McCoy, toasting in Kirk's quarters

"All I ask is a tall ship, and a star to steer by."

- Kirk, quoting the poem "Sea Fever" by John Masefield

"Fantastic machine, the M-5. No off switch."

- McCoy, as the Enterprise chases the Woden

"Come along, Dr. Daystrom. M-5 is out of a job."

- Kirk, to Dr. Daystrom

"Please, Spock, do me a favor and don't say it's fascinating."
"No. But it is ... interesting."

- McCoy and Spock, on the M-5's increasing control of the Enterprise

"You don't shut a child off when it makes a mistake. M-5 is growing, learning."
"Learning to kill."
"To defend itself. It's quite a different thing."

- Daystrom and McCoy, on the growing threat of the M-5

"Men no longer need die in space or on some alien world! Men can live and go on to achieve greater things than fact-finding and dying for galactic space, which is neither ours to give or to take!"

- Daystrom, defending the need for the M-5

"Genius doesn't work on an assembly line basis."

- Kirk to McCoy, on Daystrom

"You can't simply say, today I will be brilliant."

- Kirk, on Daystrom's ingenuity

"It appears, Captain, we've been doing what used to be called pursuing a wild goose."

- Spock, after M-5 outsmarts an attempted manual override

"Commodore Wesley is a dedicated commander. I should regret serving aboard the instrument of his death."

- Spock, after Wesley receives orders from Starfleet to destroy the Enterprise

"Murder is contrary to the laws of man and God."

- M-5, on why it cannot commit murder

"Compassion. That's the one thing no machine ever had. Maybe it's the one thing that keeps men ahead of them."

- McCoy, on why Wesley did not attack the Enterprise

"It would be most interesting to impress your memory engrams on a computer, Doctor. The resulting torrential flood of illogic would be most entertaining."

- Spock's last jab at McCoy, on comparing Humans and machines

Background Information

Production timeline

Story and production

  • Mathematician Laurence N. Wolfe wrote the original story for this episode, which was based on his fascination with computers. However, it emphasized the M-5 unit and its creator, Dr. Daystrom, and barely featured the Enterprise crew. It was heavily rewritten by D.C. Fontana, who focused the storyline around Kirk's fear of being replaced by a machine. [1]
  • This episode was a social commentary on the American job losses caused by increased mechanization during the 1960s. (Star Trek Compendium)
  • The evocative music by George Duning, composed for "Metamorphosis", was re-used when Kirk romanticizes about sailing on a tall ship.

Cast and characters

Sets and props

  • Commodore Wesley's high-backed command chair appears to be the same one used on the ISS Enterprise's command chair in "Mirror, Mirror".
  • Daystrom's scanning device, which he used to analyze the M-5, resembles McCoy's medical scanner. It also resembles the one used in "The Naked Time", when Scotty used it to point out the critical engineering wall circuits and when Joe Tormolen used it on the surface of Psi 2000.
  • A close-up of the three scanning heads on the trident scanner in this episode seem to be a re-use of the disruptor weapons from "A Taste of Armageddon".


Other information

Remastered information

Video and DVD releases

Links and references


Also Starring

Guest Stars


Uncredited Co-Stars


Alpha Carinae II; Alpha Carinae system; Carstairs; chicken soup; class M; computer; death penalty; Dunsel; duotronics; Einstein, Albert; engram; Excalibur, USS; Finagle's Folly; general quarters; Harris; Hood, USS; Kazanga; Lexington, USS; M-5 computer; multitronics; nervous breakdown; nitrogen; Nobel Prize; Orion; oxygen; Phillips; Potemkin, USS; Rawlins; Sea-Fever; Sitar; Starbase 6; Starfleet Academy; Starfleet battle simulation; Starfleet Command; suicide; warp power indicator; Woden; Zee-Magnees Prize

External link

Previous episode produced:
"Patterns of Force"
Star Trek: The Original Series
Season 2
Next episode produced:
"The Omega Glory"
Previous episode aired:
"The Omega Glory"
Next episode aired:
"Bread and Circuses"
Previous remastered episode aired:
"The Changeling"
TOS Remastered Next remastered episode aired:
"Operation -- Annihilate!"
Community content is available under CC-BY-NC unless otherwise noted.