The first episode of BBC’s Sherlock opens with the roar of machine guns and a bursting bombshell. The screen goes black, then Dr. Watson wakes from the nightmare—a scene from his tour of duty in Afghanistan. When Watson later meets a potential roommate named Sherlock Holmes, Holmes deduces Watson’s troubled past from his haircut and an engraving on his cell phone. The pair move in together, and go on to solve a string of mysterious apparent suicides.

Janice Chen, a postdoctoral fellow at Princeton University, recently used this episode to investigate how the brain encodes memory. For a study in Nature Neuroscience, Chen and collaborators from several other labs had 22 men and women watch a 48-minute clip from Sherlock’s  2010 series premiere, “A Study in Pink,” and recorded their brain activity by fMRI. Immediately after, the participants were asked to recap the episode, also while under fMRI.

When Chen’s group compared participants’ brain activity as they watched the show to their brain activity as they recapped it, there wasn’t much overlap. This wasn’t much of a surprise, given that scientists understand there are significant differences between perceiving and remembering. But when Chen’s group compared the brain activity of all participants to one another as they recapped the show, there was a pattern: As they spoke, the participants’ brains lit up in similar places, roughly corresponding with the particular scenes they were describing.

It appeared that the neurocognitive processes participants went through to recall the show’s various scenes were roughly the same for each person. Each scene formed a distinct “fingerprint,” in Chen’s words, in everyone’s brains.

This result may help explain how memories are stored and accessed. It is well understood that a memory is not a perfect record of everything a person sees and hears and does. (Try and remember what you had for lunch last week and you’ll get the idea.) But relatively little is known about how memories map onto the brain, Chen’s study points out. When the brain takes in an experience, it condenses and encodes all the information into forms that differ from the original. How and where in the brain this happens isn’t clear, and it’s difficult to study, given that people don’t often experience, let alone remember, the same things.

Chen and her group found the show’s “fingerprints” in their participants’ default mode network (DMN), a group of interacting brain regions involved in a variety of high-level functions, including self-reflection, moral reasoning, and memory. As Charan Ranganath, head of the Dynamic Memory Lab at the University of California, Davis, wrote to me, the DMN is engaged when people attempt to recall a past event, imagine a possible future event, or when they “are actively trying to understand what they are reading or hearing in a conversation.”

With these functions combined, Ranganath and his colleagues believe the DMN mediates “knowledge about the world”a theory Chen’s study supports. None of the participants remembered every detail from the episode, but they all shared a basic “understanding” of what they saw—the term Ranganath uses to describe a sense of how the key elements of the plot fit together to form the story. As the study notes, “A possible interpretation of these findings is that participants shared familiar notions of how certain events are structured (for example, what elements are typically present in a car chase scene) and these existing schemas guided recall.” Viewers may not recall what what was engraved on Watson’s cell phone, but anyone who watches the show is likely to retell who, in the end, was behind the mysterious “suicides.”

When I asked Chen why her group chose Sherlock, she said that aside from being good enough to keep viewers’ attention, the show had a key complexity. “In order to drive these high-level brain regions, you actually need the narrative.” A well-written mystery triggers the kind of cognitive response she’s looking for because viewers must explain how everything relates.

Using a TV show is a departure in memory and brain imaging research, Chen says. Historically, experiments have shown participants random lists of words or pictures, and asked them to recall what they’ve seen. But Chen believes it’s important to do studies that are closer to real life. “If you strip away too much from the experience of people, then you're going to lose something in terms of what you can learn,” she said.

Of course, there are limits to what can be learned from this experiment. “We're definitely not trying to say everybody’s identical,” Chen told me. “We're just saying there’s a lot of stuff, maybe more than we would have expected, that is really similar between people about how they perceive and how they remember.”

Looking ahead, Chen’s group is planning to focus more specifically on how the brain handles individual scenes of an episode, and also when happens when a memory or understanding of a plot is communicated from one person to another. If a person who’s seen Sherlock, for example, summarizes the story to a friend, would that friend’s brain show the same “fingerprint?”

All of this research, Chen says, serves the larger goal of improving models of the human brain: “Based on what we know is happening” in the show, “can we then build a model to predict the activity in the brain?” Studies like this are just one step towards solving that mystery.