Elementary, Dear Data

"Elementary, Dear Data" is the third episode of the second season of the American science fiction television series Star Trek: The Next Generation, the 29th episode overall. It was written by Brian Alan Lane and directed by Rob Bowman. It was originally released on December 5, 1988, in broadcast syndication.

Set in the 24th century, the series follows the adventures of the Starfleet crew of the Federation starship Enterprise-D. In this episode, a holographic adversary is created on the holodeck of the Enterprise when Data and Geordi take some time off to play a Sherlock Holmes game. The plot line from this episode was continued in the sixth season episode "Ship in a Bottle", and the Moriarty character appeared a third time in "The Bounty" (the sixth episode of Star Trek: Picard season 3).

In 1989, "Elementary, Dear Data" was nominated for two Emmy Awards: Outstanding Art Direction for a Series, Richard D. James, Art Director; Jim Mees, Set Decorator and Outstanding Costume Design for a Series, Durinda Wood, Costume Designer; William Ware Theiss, Starfleet Uniforms Creator.

Plot
As the Federation starship Enterprise, under the command of Captain Jean-Luc Picard, waits to rendezvous with the USS Victory, Chief Engineer La Forge and Commander Data go to the holodeck to recreate a Sherlock Holmes mystery. Data, playing Holmes, has memorized all of the Holmes stories, and recognizes and solves the mystery within minutes. Frustrated, Geordi leaves the holodeck, leaving Data confused. In Ten Forward, Geordi explains that the fun is in solving the unknown; Data does not understand. Overhearing their conversation, Chief Medical Officer Dr. Pulaski asserts that Data is incapable of solving a mystery to which he does not already know the outcome. Data accepts Dr. Pulaski's challenge and invites her to join them on the holodeck. There, Geordi instructs the computer to create a unique Sherlock Holmes mystery with an adversary who is capable of defeating Data.

In the new program, Dr. Pulaski is kidnapped, and Data investigates. They soon discover that Professor Moriarty is responsible, but when they find him with Pulaski in his hideout, they are shocked when they learn that Moriarty is aware of the holodeck program being a simulation, and is able to access the holodeck computer, showing them a sketch of the Enterprise he has drawn based on the computer's description. Data and Geordi leave the holodeck to alert the captain, and Geordi realizes that when he asked the computer to create the program he had asked for an adversary who could defeat Data, not Sherlock Holmes; as a result, the computer gave the holodeck character, Professor Moriarty, the intelligence and cunning needed to challenge Data, plus the ability to access the ship's computer. When Moriarty gains access to ship stabilizer controls, Data returns to the holodeck with Captain Picard.

Picard meets Moriarty, who demonstrates that he has evolved beyond his original programming and asks to continue to exist in the real world. Picard tells Moriarty that this would not be possible; instead, he saves the program and tells Moriarty that if they ever discover a way to convert holodeck matter into a permanent form they will bring him back. Picard discontinues the program and the USS Victory arrives, with La Forge preparing to present a model of the historic HMS Victory.



Production
"Elementary, Dear Data" was written by Brian Alan Lane and directed by Rob Bowman.

Story and script
According to co-executive producer Maurice Hurley, the idea for this episode was inspired by Data's experiences in "The Big Goodbye". Hurley stated, "It wasn't a writer saying, 'Let's do this.' It was one of the people living on the Enterprise."

This episode contains elements from and references to the Sherlock Holmes short stories "A Scandal in Bohemia", "The Red-Headed League", "The Adventure of the Speckled Band", and "The Adventure of the Bruce-Partington Plans", as well as the Holmes novel The Valley of Fear. Furthermore, Moriarty's creation being a result of Geordi La Forge requesting an opponent capable of defeating Data references Arthur Conan Doyle's creation of the same character for the short story The Final Problem – specifically, as an opponent capable of defeating Sherlock Holmes who, at the time, Doyle wanted to kill off.

Reportedly, the original ending had Jean-Luc Picard lying to Moriarty, that he could have existed outside the holodeck, the same way the piece of paper on which he drew the Enterprise also stayed intact outside the holodeck. Co-executive producer Maurice Hurley wanted to keep that ending, as it made Picard look clever, but Gene Roddenberry nixed it, saying it made Picard look cruel. Instead, the paper stays intact without any explanation.

Casting
The episode features Daniel Davis as James Moriarty. Daniel Davis used an English accent for this role, though he is from Arkansas and speaks with an American accent when not in character. Davis was auditioning for the role of Moriarty alongside another actor in the room Brian Bedford directly in front of director Rob Bowman. Davis said of being in the room with Brian Bedford, "So he's the standout in my mind, and we were sort of taking bets with each other about which of us would get it. We hadn't worked together or seen each other in a long time. So it was a very friendly rivalry. Then, when I got it, he was a very good sport and invited me to come to dinner to celebrate that I had gotten the part."

The episode also features Anne Elizabeth Ramsay, making her first Star Trek: The Next Generation appearance as Ensign Clancy. The actress reprised the role in "The Emissary", also in season two. Ramsay went on to a busy career as an actress. She co-starred as Lisa Stemple, the dysfunctional sister of Helen Hunt's character, in 123 episodes of Mad About You, for which she shared a Screen Actors Guild Award nomination. Ramsay also played a recurring role on Six Feet Under and Dexter.

Reception
In 1989, the episode was nominated for two Emmy awards.

In 2016, The Hollywood Reporter rated "Elementary, Dear Data" the 10th best episode of Star Trek: The Next Generation, and the 26th best of all Star Trek episodes to date. James Hunt of Den of Geek gave it a 100% watch rating and remarked it was "fantastic episode". In particular he praised concepts explored about computers and artificial intelligence as well as the Data and Geordi character sequences. Tor.com rated it 7 out of 10.

The episode's title "Elementary, Dear Data" was noted as a play on the iconic but false Sherlock Holmes phrase "Elementary, my dear Watson".

In 2011, this episode was noted by Forbes as one that explores the implications of advanced technology, in this case for exploring an apparently self-aware software program. In 2016, Time magazine rated the holographic Professor Moriarty as the 5th best villain of the Star Trek franchise.

In 2020, Looper listed this as one of the best episodes for Data, remarking that it is "The Next Generation having a whole lot of fun"; Geordi and Data tackle a holodeck gone wrong plot, with a Sherlock Holmes theme.